This script is currently broken and may not work correctly.
It is excluded from the default browse listing until the issue is resolved.
tools
broken
BatteryMonitor
Logs battery voltage and current to GCS, warns on low cell voltage.
| Version | 1.0.0 |
|---|---|
| Date | 2026-05-18 |
| Min firmware | 4.5 |
| Vehicle | copter, plane, rover |
/lua_ardupilot_scripts/tools/BatteryMonitor.lua
Download .lua
BatteryMonitor
Description
BatteryMonitor periodically reads the primary battery instance and sends voltage, per-cell voltage, and current draw to the GCS. It sends an additional warning message when the per-cell voltage drops below a configurable threshold.
Setup
- Copy
BatteryMonitor.luatoAPM/scripts/on your SD card. - Ensure a battery monitor is configured (
BATTx_MONITOR≠ 0). - Adjust the
WARN_VOLTAGEandCELL_COUNTconstants at the top of the script to match your battery pack.
Parameters
| Constant | Default | Description |
|---|---|---|
UPDATE_INTERVAL_MS |
10000 | How often to report (ms). |
WARN_VOLTAGE |
3.5 | Warning threshold in volts per cell. |
CELL_COUNT |
4 | Number of cells in series. |