This post is intended to illustrate the steps into making a less-than-a-buck battery voltage measurer to monitor the life of your UAV battery. It has been used successfully on a generic autopilot board (running MegaPirateNG), but it should also work on original ArduPilot or other boards.
On the hardware side you need a simple voltage divider and optionally a capacitance-type filter (100nF):
"Wait! What's going on?" You wouldn't want to send your raw battery power directly to the board, unless of course you wanted to see it flaming up. This voltage divider sends a ~2.2V (when battery is fully charged at ~12.6V) voltage to your controller board. This value is then multiplied by a scaling factor to get the original battery voltage level to be displayed on your GCS.
Connect GND to a ground pin on your board and insert the the socket into the AD0-Ax slot.
Measure your battery voltage with a multimeter (you'll need this value in a second). Now cable the battery to the newly made circuit and the latter to the system.
Connect your board to your computer via USB and start MissionPlanner.
You can follow these visual steplines on the wiki while reading the following.
Click on the Initial Setup tab and under the Optional Hardware slot on the left select Battery Monitor.
Select the following:
-Battery Monitor: 3 Battery Voltage
-Sensor: 1
-APM Version: <your version here>
Type the battery's voltage value in the Measured Battery Voltage entry and press enter. The following entry (named Battery Voltage (Calced)) will monitor your battery voltage. This info is also visible on the bottom left corner of the HUD in the Flight Data screen, and you can also set battery failsafe..how cool is that!
Comments
added to my diy skills.
On the subject, anyone have success with measuring mah accurately?