Battery Life Calculator — Hours and Days from Duty Cycle
Who this is for: For battery-powered sensor nodes and wearables: if you've ever promised a customer "a year on two AA cells", this is the calculation that decides whether that's true.
Battery runtime for microcontroller projects: enter capacity, active current, duty cycle and sleep current to get real-world battery life in hours and days — the way it actually behaves on an ESP32-class board.
Quick answer: Battery life = usable capacity ÷ average current. Usable capacity is your mAh rating × 80% (protection cutoff leaves the rest behind); the average current is active current × duty cycle + sleep current × (1 − duty cycle). Example: a 2000 mAh cell, 100 mA while awake 10% of the time and 0.05 mA asleep, averages 10.05 mA and lasts about 6.6 days. Cut the duty cycle to 1% (one reading a minute) and the same cell lasts around 66 days — the duty cycle, not the battery, is the lever.
ESP32 + Wi-Fi average: 80–120 mA while transmitting
Share of time the board is awake
Bare chip ~0.01–0.15 mA · dev boards with regulator ~1–10 mA
| Duty cycle | Average draw | Runtime | Days |
|---|---|---|---|
| 1% | 1.05 mA | 63.5 days | 63.5 |
| 5% | 5.048 mA | 13.2 days | 13.2 |
| 10% | 10.045 mA | 6.6 days | 6.6 |
| 25% | 25.038 mA | 2.7 days | 2.7 |
| Formula | usable capacity ÷ weighted average current |
|---|---|
| Usable capacity | 80% of nameplate (configurable) |
| Typical ESP32 sleep | 0.01–0.15 mA (chip) · 1–10 mA (dev board) |
| Typical ESP32 active | 80–120 mA average with Wi-Fi |
| Output | Hours · days · months + duty-cycle table |
How the battery life calculation works
Battery estimates go wrong in two places: people use the peak current instead of the weighted average, and they use the battery's nameplate capacity instead of what the protection circuit will actually let you draw. This calculator bakes in both: it weights active and sleep current by your duty cycle, and takes capacity at 80% usable by default.
The second reality check is the board itself. A bare ESP32 chip deep-sleeps at ~10 µA, but a typical dev board adds 1–10 mA of overhead from the USB bridge chip, the power LED and the regulator's quiescent current. That overhead doesn't care about your duty cycle — it's on 24/7 and often dominates the average. The calculator's sleep-current field is where you put your real measured number (measure it! a multimeter in series with the battery answers this in two minutes), and the duty-cycle table above shows how the answer swings across 1%, 5%, 10% and 25% awake time.
The result panel reads in hours, days and months because "how long will it last" has a different acceptable answer per project: an hourly-updating sensor node should show months, a camera trap can show weeks, a continuous Wi-Fi stream will show hours and that's simply the truth.
Common uses
- Deciding between 18650, AA×2 and a LiPo pouch for an outdoor sensor node
- Sanity-checking a vendor claim of "1 year battery life" before you commit to a design
- Showing why dropping from 10% to 1% duty cycle matters more than doubling the battery
- Estimating when a wildlife camera or soil sensor will need its next battery change
- Comparing sleep strategies: light sleep vs deep sleep vs powering the sensor from a GPIO
Realistic ESP32 current numbers to start from
Bare chip: deep sleep 0.01–0.15 mA, light sleep ~0.8 mA, active with Wi-Fi transmitting averages 80–120 mA (peaks near 500 mA). Dev board: add 1–10 mA continuous overhead unless you've removed the power LED and bridge chip. Sensor for the reading: whatever its datasheet says, times its warm-up time. If the numbers you enter are guesses, your result is a guess — measure the sleep current once and this calculator becomes a planning tool instead of a wish.
The math (so you can check it)
average_current = active_current × duty + sleep_current × (1 − duty); runtime_hours = (capacity_mAh × 0.80) ÷ average_current. Nothing else — no Peukert exponent, no temperature derating. At typical sensor-node currents those effects sit inside your measurement error, and adding them would imply a precision the inputs don't have.
Frequently Asked Questions
How do I calculate battery life for an ESP32 project?
How long does an ESP32 last on a 18650 battery?
Why does my ESP32 dev board drain the battery even in deep sleep?
Is mAh the same as mA per hour?
Should I use deep sleep or light sleep?
How do I measure the sleep current for real?
More guides
The AI hardware builds everyone is making: voice assistants, desktop AI boxes, smart displays and AI toys — with the parts list, the wiring, and what each one actually teaches.
The honest answer: data pins drive unlimited addressable LEDs, GPIO pins safely drive one 10 mA indicator — here's the wiring that makes big strips work.
More Electronics calculators
Series resistor for one or more LEDs: enter supply, forward voltage and target current to get the exact resistance, the nearest E24 value to buy, actual current and the power rating you need.
Two-resistor voltage divider: output voltage, divider current and dissipation — plus the R2 value that hits a target voltage, and the ESP32 ADC limits that decide whether your reading will actually be stable.
IPC-2221 trace width for your current, temperature rise and copper weight — external or internal layer — plus resistance and voltage drop when you enter the trace length.
Power supply sizing for LED strips: enter length and W/m to get total watts, total amps, the PSU wattage to buy with headroom, and how many power injection points the strip needs.