Skip to content
GEEKnodes

Electronics

ESP32 and Arduino Battery Life Calculator

Work out how long the battery in your ESP32 or Arduino project lasts with deep sleep: average current draw, real usable mAh and how to multiply your battery life.

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).
Battery with 70–85% usable capacity and the factors that reduce the available charge: cutoff, regulator, age and cold.
Rated capacity isn’t the same as the energy your circuit can actually use.

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
600-second cycle with 5 seconds active and 595 seconds in deep sleep, which lowers the average current.
A few active seconds weigh less when the rest of the cycle is spent asleep.

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:

StateESP32 (module only)Full development board
Wi-Fi transmittingspikes over 200 mAsimilar or more
Active, radio offtens of mAa bit more
Deep sleeparound 10 µAoften several mA
Comparison of deep sleep current between an ESP32 module and a full board with LED, USB-to-serial chip and regulator.
The components on the board can draw more than the sleeping microcontroller.

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

  1. Sleep as much as possible: the ESP32’s deep sleep is enabled with esp_deep_sleep_start() and a wake-up timer.
  2. 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.
  3. Send less often: measure every minute but send the data every 10 or 15 minutes.
  4. Turn off peripherals: power the sensors from a GPIO pin or a transistor and cut their power while sleeping.
  5. Choose a good regulator: look for one with a quiescent current of just a few µA.
  6. 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.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor