Battery Runtime Calculator
Calculate battery runtime for IoT devices with sleep/wake cycles. Enter active current, sleep current, duty cycle, and battery capacity to get realistic runtime estimates for ESP32 deep sleep projects.
IoT Battery Runtime with Sleep Cycles
For battery-powered IoT projects (ESP32, Arduino, nRF52), most time is spent in sleep mode drawing microamps, with brief wake-ups for measurement/transmission. Calculate realistic runtime by entering average current draw during active mode, sleep current, duty cycle, and battery capacity. Higher duty cycles = faster battery drain. Critical for remote sensors, GPS trackers, and LoRa nodes.
Avg Current = (I_active × DC + I_sleep × (1−DC)) / 100
e.g. 3000 mAh = 3 Ah · Check battery datasheet
Current during measurement/transmission
Deep sleep mode current (often μA)
% time in active mode · 10% = 540 min awake per day
Total Runtime
12.4 days
- Avg current
- 10.09 mA
- Hours total
- 297.3 h
Average current is what matters
A battery-powered sensor node spends most of its life asleep and wakes briefly to measure and transmit. Battery life depends on the average current:
Iavg = (Iactive × tactive + Isleep × tsleep) ÷ (tactive + tsleep)
Then runtime (h) ≈ usable capacity (mAh) ÷ Iavg (mA).
Typical currents
| Device / state | Typical current |
|---|---|
| ESP32 Wi-Fi transmitting | 120–240 mA (peaks ~350 mA) |
| ESP32 modem sleep / light sleep | 0.8–20 mA |
| ESP32 deep sleep (bare module) | 10–150 µA |
| ESP32 dev board in deep sleep (with USB chip, LED, regulator) | 5–15 mA |
| ESP8266 deep sleep | ~20 µA |
| nRF52 / ATmega328P power-down | 1–5 µA |
| AMS1117 regulator quiescent | ~5 mA |
| MCP1700 / HT7333 LDO quiescent | 1.6–4 µA |
The usual surprise: the board, not the chip
An ESP32 chip sleeps at around 10 µA, but a typical DevKit board keeps drawing 5–15 mA in deep sleep because of its power LED, USB-serial chip and AMS1117 regulator. That alone limits a 2500 mAh battery to about a week. For long battery life, use a bare module or a low-power board (FireBeetle, TinyPICO, XIAO ESP32-C3) with a low-quiescent regulator.
Reducing the active time
- Use a static IP and store the Wi-Fi channel/BSSID in RTC memory to connect in under 1 s instead of 3–5 s.
- Batch readings and transmit every few cycles instead of every wake.
- Consider ESP-NOW or LoRa instead of Wi-Fi for very long battery life.
Formula, inputs and worked examples
Formula and method
Iavg = Iactive × duty_cycle + Isleep × (1 − duty_cycle); runtime (hours) ≈ usable_capacity (mAh) / Iavg (mA).
Worked examples
Weather sensor every 15 minutes
ESP32 module active 4 s at 130 mA, asleep 896 s at 15 µA with an MCP1700: Iavg = 0.59 mA. A 3000 mAh cell at 80 % lasts about 4070 hours, roughly 5.5 months.
Same code on a DevKit board
Sleep current rises to 8 mA, so Iavg becomes 8.5 mA and the same battery lasts about 12 days.
Door sensor that wakes on interrupt
Waking 20 times a day for 3 s at 150 mA and sleeping at 10 µA averages about 0.11 mA: well over two years on 2500 mAh, limited by self-discharge.
Inputs
- Battery capacity — Unit: mAh
- Active current — Unit: mA
- Sleep current — Unit: mA
- Active duty cycle — Unit: percent
What the result means
- Weighted average current — Unit: mA
- Estimated runtime — Unit: hours / days
Practical tips and common mistakes
- Measure sleep current with a multimeter in series on the µA range, or a power profiler.
- Remove or cut the power LED on modules that stay powered.
- Power sensors from a GPIO or switched rail so they are off during sleep.
- Budget for self-discharge: about 2–3 % per month for Li-ion.
Assumptions and limitations
- Duty cycle must be a fraction from 0 to 1 for the stated formula.
- Include Wi-Fi/radio startup peaks, sensor warm-up, regulator quiescent current, and battery self-discharge where relevant.
- Treat the result as an estimate and validate it with a current logger on the real device.
Frequently asked questions
How long will an ESP32 run on batteries?
With Wi-Fi always on, about a day on a 2500 mAh cell. Waking every 10 minutes for 5 seconds with a low-quiescent regulator and bare module, several months; on a typical DevKit board, about one to two weeks.
Why is my ESP32 deep sleep current so high?
The development board, not the chip: the power LED, USB-to-serial converter and AMS1117 regulator draw several milliamps. Measure the bare module or use a board designed for low power.
How do I calculate average current with deep sleep?
Multiply each state's current by its time, add them, and divide by the total cycle time. 150 mA for 3 s and 0.02 mA for 597 s gives (450 + 11.9) ÷ 600 ≈ 0.77 mA.
What battery is best for an ESP32 project?
A single 18650 or LiPo cell (3.7 V) with a low-dropout, low-quiescent 3.3 V regulator such as the MCP1700 or HT7333. Avoid 9 V batteries; their capacity is small and the regulator wastes most of it.
Learn more
More IoT & RF