An ESP32 sensor that measures the temperature every 10 minutes can last months on a battery or just one day, depending on how you program it. The key is the average current draw: how much it uses awake, how much asleep and how long it spends in each state. This calculator does the math for you.
In short
- Battery life ≈ usable capacity (mAh) / average current (mA).
- The average current depends mainly on how long the microcontroller stays awake.
- In devices that sleep, every microamp counts: regulators, LEDs and sensors can draw more than the chip itself.
Calculator
- Average current
- —
- Battery life
- —
- Without sleep
- —
How it’s calculated
1. Usable capacity
A 2,000 mAh battery doesn’t deliver 2,000 usable mAh. You have to subtract:
- The part you can’t use before the voltage drops too low for your circuit.
- Regulator losses.
- Aging and temperature (in the cold, capacity drops).

Using 70–85% of the rated capacity is a reasonable estimate.
2. Average current with a sleep cycle
If the device is awake for t_on seconds out of every T-second cycle:
I_avg = (I_active × t_on + I_sleep × (T − t_on)) / T

Example: 80 mA for 5 s every 10 minutes (600 s), and 20 µA asleep:
I_avg = (80 × 5 + 0.020 × 595) / 600 ≈ 0.69 mA
Battery life = 1600 mAh / 0.69 mA ≈ 2300 h ≈ 3 months
Without sleeping, at a continuous 80 mA, the same battery would last about 20 hours.
Typical current draw
Real values depend a lot on the specific board. Measure them whenever you can:
| State | ESP32 (module only) | Full development board |
|---|---|---|
| Wi-Fi transmitting | spikes over 200 mA | similar or more |
| Active, radio off | tens of mA | a bit more |
| Deep sleep | around 10 µA | often several mA |

Why such a big difference in deep sleep? Many development boards have a power LED, a USB-to-serial converter and a regulator with a high quiescent draw that keep consuming power even while the chip sleeps. For battery projects, use boards designed for low power or the bare module without the development board.
How to multiply battery life
- Sleep as much as possible: the ESP32’s deep sleep is enabled with
esp_deep_sleep_start()and a wake-up timer. - Cut the active time: connecting to Wi-Fi can take seconds. Use a static IP instead of DHCP and save the connection details to reconnect faster.
- Send less often: measure every minute but send the data every 10 or 15 minutes.
- Turn off peripherals: power the sensors from a GPIO pin or a transistor and cut their power while sleeping.
- Choose a good regulator: look for one with a quiescent current of just a few µA.
- Remove the indicator LEDs or desolder the power LED.
How to measure the real current draw
- Multimeter in series in mA or µA mode: works for steady states (asleep), but misses the Wi-Fi spikes.
- USB current meter: convenient, but it usually also measures what the development board draws.
- Power analyzer or power profiler: logs the spikes and calculates the average current. It’s the most accurate option.
Switching the multimeter from mA to µA can reset the circuit because of the voltage drop across the meter: keep that in mind when measuring deep sleep.
Common mistakes
- Calculating with the rated capacity: the result will always be optimistic.
- Measuring deep sleep with the board plugged into USB: the USB powers the converter and skews the reading.
- Forgetting the boot time: when it wakes up, the ESP32 takes time to boot and connect; that time counts as active.
- Unprotected LiPo batteries: a lithium cell discharged below its minimum voltage gets damaged. Use batteries with a protection circuit or cut off in software.



