How to estimate your project's battery life
How battery life is calculated
life (h) = usable capacity (mAh) / average current (mA)
A battery-powered board is rarely awake all the time: it wakes up, measures, sends, then sleeps. What counts is the average current. The duty cycle is the share of time spent awake, so Iavg = Iactive × duty + Isleep × (1 − duty) + Iregulator.
The voltage regulator and other always-on parts (power LED, USB chip, sensor) draw current 24 hours a day. On many boards this quiescent current, not the microcontroller, decides the battery life: an AMS1117 alone draws about 5 mA.
A battery never gives its full rated capacity: the circuit stops before the battery is completely empty, and the battery also loses charge on its own. The calculator uses a usable share of 70% to 90% depending on the chemistry, and adds a monthly self-discharge.
Worked example: an ESP32 sensor on an 18650 cell
An ESP32 wakes every 10 minutes, stays awake 5 seconds at 80 mA, then sleeps at 10 µA. It runs from a 2 600 mAh 18650 cell (85% usable) through a low-quiescent regulator (5 µA).
- Duty cycle
5 s / 600 s = 0.83% - Average current
80 mA × 0.0083 + 0.010 mA + 0.005 mA ≈ 0.68 mA - Usable capacity
2 600 mAh × 0.85 = 2 210 mAh - Battery life (with self-discharge)
2 210 mAh / 0.75 mA ≈ 2 940 h ≈ 4 months
About 4 months, and almost 90% of the charge goes to the awake time, so shortening it is the best lever. The same project behind an AMS1117 (5 mA quiescent) lasts only about 16 days.
Common mistakes
Using the chip's deep-sleep figure for the whole board
The ESP32 itself sleeps at about 10 µA, but a DevKit board with its regulator, power LED and USB chip still draws several milliamps. Measure the board, not the datasheet.
Forgetting the regulator
An AMS1117 adds about 5 mA around the clock, 500 times the sleeping ESP32. Pick an LDO with a quiescent current of a few microamps for battery projects.
Expecting the rated capacity
Capacity is measured at a low, steady current. High peaks (Wi-Fi transmissions reach 300 mA or more), cold weather and the cut-off voltage reduce what you really get.
Powering a project from a 9 V battery
A 9 V battery holds only about 500 mAh, and a linear regulator wastes almost half of it as heat. Three AA cells or an 18650 last many times longer.
Battery life FAQ
Always on with Wi-Fi (about 100 mA on average): roughly a day. Waking every 10 minutes with a good regulator: several months. The awake time and the regulator's quiescent current make all the difference.
The Uno draws about 45 mA doing nothing, so a 500 mAh 9 V battery lasts around 8 hours. For long battery life use a bare ATmega328P or a Pro Mini with the power LED and regulator removed.
The share of time the circuit is awake. Awake 5 seconds every 10 minutes is 5 / 600 = 0.83%; the active current only counts for that share of the time.
Put a multimeter in series on the µA range once the board is asleep (it may reset when switching ranges). For the full profile with its peaks, a USB power meter or a dedicated current monitor works better.
Not reliably: a CR2032 holds about 220 mAh and its voltage collapses above about 15 mA, while Wi-Fi needs peaks of several hundred milliamps. It suits low-power chips and BLE sensors.








