ESP32 Calcs

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

Average draw
10.045 mA
Runtime
6.6 days
In days
6.6
Usable charge
1,600 mAh
Duty cycleAverage drawRuntimeDays
1%1.05 mA63.5 days63.5
5%5.048 mA13.2 days13.2
10%10.045 mA6.6 days6.6
25%25.038 mA2.7 days2.7
Two numbers dominate everything: the duty cycle and the sleep current. Sending one Wi-Fi reading every 10 minutes (0.1% duty) can push a 2000 mAh cell from days to months — but only if your board actually deep-sleeps. Most dev boards leak 1–10 mA through the USB bridge and regulator, which caps sleep-based battery life at weeks; for multi-month builds use a bare module or cut the power LED and regulator. Capacity is taken at 80% usable (protection cutoff and voltage sag leave the rest behind).
Core facts
Formulausable capacity ÷ weighted average current
Usable capacity80% of nameplate (configurable)
Typical ESP32 sleep0.01–0.15 mA (chip) · 1–10 mA (dev board)
Typical ESP32 active80–120 mA average with Wi-Fi
OutputHours · 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?
Multiply each current by the fraction of time it flows: active current × duty cycle + sleep current × (1 − duty cycle), then divide 80% of your battery capacity by that average. A 2000 mAh battery with 10 mA average draw lasts ≈ 160 hours ≈ 6.7 days. The duty cycle is the dominant factor: going from awake 10% of the time to 1% multiplies runtime by roughly 10×.
How long does an ESP32 last on a 18650 battery?
A good 18650 (3000 mAh) gives about 2400 usable mAh. Continuously on Wi-Fi (~100 mA) that's 24 hours. Awake 10% of the time with deep sleep between: ~9.7 days. Awake 1%: ~3.3 months — but only if the board's sleep current is genuinely low (a bare module, not a dev board with a USB bridge).
Why does my ESP32 dev board drain the battery even in deep sleep?
Because the chip isn't the only thing on the board. The USB-UART bridge, the power LED and the LDO regulator together draw 1–10 mA continuously — day and night, regardless of sleep mode. The fix is hardware: remove (or power-gate) the power LED and bridge, or use a board designed for batteries. Software can't deep-sleep them away.
Is mAh the same as mA per hour?
mA·h is charge: a 2000 mAh battery can supply 2000 mA for one hour, or 1 mA for 2000 hours, in theory. "mA per hour" isn't a unit. Runtime in hours = capacity (mAh) ÷ average current (mA) — simple division, with the 80% usable factor on the capacity.
Should I use deep sleep or light sleep?
Deep sleep for anything battery-powered and intermittent: current drops to tens of microamps, at the cost of losing RAM state (the chip reboots on wake). Light sleep keeps state but draws ~0.8 mA — that's 80× more, and it's usually the wrong trade for a sensor that reports every few minutes.
How do I measure the sleep current for real?
Put a multimeter in series between the battery and the board (make sure it's a µA-capable range) and let the board sit powered with the ESP32 in deep sleep — but understand the board, not the chip, sets the number. If the meter reads milliamps while the ESP32 should be asleep, the culprit is on the board, and cutting the LED or using a bare module is the next step.

More guides

ESP32 AI Hardware Projects

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.

How Many LEDs Can an ESP32 Drive?

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

LED Resistor Calculator

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.

Voltage Divider Calculator

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.

PCB Trace Width Calculator

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.

LED Strip Power Calculator

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.