drone-flight-controller
drone-flight-controller copied to clipboard
battery_voltage
Hi Man,
Don't understand how to set battery voltage. What's the default battery_voltage? And how to connect Li battery to Arduino MLB pin? Can you explain detail. Thanks very much bool isBatteryConnected() { // Reduce noise with a low-pass filter (10Hz cutoff frequency) battery_voltage = battery_voltage * 0.92 + (analogRead(0) + 65) * 0.09853;
return battery_voltage < 1240 && battery_voltage > 800;
}
Do you have any update plan on the Arduino Drone? Like GPS, Pan&Tilt...
Hi @Hugh20210
At very first, battery_voltage has no value, meaning 0. => Maybe I should initialize it explicitly.
This code reads the voltage on PIN A0, then apply a 10Hz-low-pass filter to remove noise:
battery_voltage = battery_voltage * 0.92 + (analogRead(0) + 65) * 0.09853;
On the PIN A0, apply a voltage divider bridge in order to get 5V from your Lipo.
Thanks for your fast reply. It is superise for me. So we need to connect Battery to Arduino board VCC and motor, and also need divider battery voltage for analog A0.
BTW, do you have any other upgrade or suggest for your drone?