ESP32 Calcs

ESP32 Deep Sleep & Battery Power — From Hours to Months

The ESP32's headline battery trick is deep sleep: the chip drops to tens of microamps and wakes on a timer, a GPIO edge, or the ULP coprocessor. In practice, most people's battery projects die at weeks — not because the chip is bad, but because the dev board leaks milliamps and the wake cycle is wrong. This guide closes that gap.

Quick answer: Four levers decide battery life: sleep mode (deep sleep ≈ 0.01–0.15 mA, light sleep ≈ 0.8 mA), what's on the board (a dev board's USB bridge + regulator + power LED adds 1–10 mA permanently — remove or power-gate them), the duty cycle (awake 1% vs 10% is a 10× runtime difference), and the battery's usable capacity (80% of nameplate). Measure your real sleep current once — the battery-life calculator then predicts weeks vs months honestly.

The sleep modes in one table

ModeTypical current (chip)KeepsTypical use
Modem sleep~10–40 mACPU + RAM, Wi-Fi offshort waits between sends
Light sleep~0.8 mARAM, wake on timerfrequent but slow reporting
Deep sleep0.01–0.15 mARTC memory onlyreporting every minute or slower
Hibernation~0.002–0.01 mAnothinglong unattended sensing

Wake sources

Timer (esp_sleep_enable_timer_wakeup) for periodic reporting; GPIO (ext0 — any pin, edge; ext1 — a set of pins, wake on any) for door/motion sensors; touch wake on chips with touch pins; and the ULP coprocessor for wake-on-analog-threshold without waking the main CPU. For periodic sensors, timer wake is the 95% case. The RTC memory holds a small state blob through deep sleep — enough for a sequence number or calibration, not for your heap.

The dev-board leak (the thing most people miss)

A typical dev board draws 1–10 mA with the chip in deep sleep, because the USB-UART bridge, regulator quiescent current and power LED are all on the board, not powered by the chip. The fix is choosing hardware: a bare module with an external 3.3 V regulator and a battery connector, or a board explicitly built for batteries. If you must keep the dev board, cut the power LED and consider desoldering the bridge or feeding it from an I/O pin that goes low during sleep. Whatever you do, measure — the number on the spec sheet is the chip's, not yours.

A battery-life prediction recipe

1) Measure sleep current with the board in deep sleep (µA mode on the meter). 2) Measure or estimate active average — for Wi-Fi transmits, 80–120 mA typical. 3) Pick the duty cycle your sensor needs. 4) Run the battery-life calculator. If the answer is days and you need months, the first lever is the dev-board leak, the second is duty cycle, and only then battery size — 10× gains come from sleep current, not from doubling mAh.

Frequently Asked Questions

How low can an ESP32 deep sleep current go?
The chip itself: 0.01–0.15 mA depending on the chip revision and RTC settings, with the ULP running and RTC memory kept. Hibernation mode (no RTC memory) reaches single-digit microamps. A dev board, however, adds 1–10 mA of regulator/bridge/LED leakage no matter what the chip does.
Can I wake the ESP32 from deep sleep with a button?
Yes — GPIO wake (ext0/ext1) with a pull-up: the pin edge wakes the chip. The classic catch is the strapping pins: on the classic ESP32, a button on GPIO0 held low at reset enters the bootloader instead of waking normally, so prefer a non-strapping GPIO (e.g. GPIO13 or GPIO27) for the wake button.
Does deep sleep keep my Wi-Fi connection?
No — Wi-Fi is fully off in deep sleep; on wake the chip reconnects, which takes ~0.5–2 s and is part of your active-time duty cycle. That reconnect time (and its ~100 mA draw) is usually the real reason battery life disappoints on 'quick' reporting projects — count it in the duty cycle, don't ignore it.
How do I measure the sleep current without special gear?
A regular multimeter in µA mode, in series with the battery or supply. Set the board to deep sleep and read. If the meter shows mA, hunt the leak — usually the power LED or the USB bridge — before believing any battery prediction.
What's the difference between deep sleep and the ULP?
Deep sleep is a chip state; the ULP is a tiny coprocessor that keeps running in deep sleep and can wake the main CPU. Use it to sample an ADC or compare a value while the main core sleeps — e.g. wake only when battery voltage crosses a threshold.

More tools used in this guide

Battery Life Calculator

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.

ESP32 Pinout

Interactive pinout for the ESP32 family: click any pin on a DevKitC V4, S3-DevKitC-1, C3-DevKitM-1 or C6-DevKitC-1 to see its GPIO number, every official function, and the boot-time traps — transcribed from Espressif's official header tables.

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.

More guides

ESP32 Projects for Beginners

10 starter projects in the right order: from blink to Wi-Fi to your first cloud dashboard, with the hardware list and the wiring traps each one teaches.