Home / Peripherals / Deep Sleep

ESP32 Deep Sleep: Wake-up Sources, Power Draw and RTC Memory

How low the current really goes, which pins can wake the chip, and whether your variables survive. Use it with the battery life calculator.

What the chip actually does in deep sleep

In deep sleep the CPU, most RAM and nearly all peripherals lose power. Only the RTC domain stays alive: RTC memory, RTC peripherals and the ULP co-processor. Waking up is a full reboot — setup() runs again from the top and ordinary global variables are gone.

How much current

StateTypical currentNote
Bare module, deep sleep≈10 µAOrder-of-magnitude reference
Dev board with USB-UART bridge + LDO100 µA – several mAPeripheral leakage dwarfs the chip
Wi-Fi transmit burst80 – 150 mAThis is what actually drains the cell
Before optimising anything, put your numbers into the battery life calculator and see which of the two dominates. In most projects you should not be optimising that 10 µA at all.

Wake-up sources

SourceNote
Timeresp_sleep_enable_timer_wakeup(us) — the usual choice
ext0One RTC GPIO reaching a given level
ext1A combination of several RTC GPIOs (any / all)
TouchSupported on the original ESP32
ULP co-processorKeeps sampling and only wakes the main core past a threshold
Only RTC GPIOs can wake the chip from deep sleep. On the original ESP32 they are: 0, 2, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 37, 38, 39. Wire your wake button anywhere else and you get a board that never wakes up no matter how hard you press.

Keeping data across sleep

Declare anything that must survive as RTC_DATA_ATTR (ESP-IDF), e.g. RTC_DATA_ATTR int bootCount = 0;. Such variables live in RTC slow memory and survive sleep. Space is tight — keep it to counters and state flags.

To learn what woke you up, call esp_sleep_get_wakeup_cause().

Practical ways to cut leakage

This page describes the original ESP32. RTC GPIO lists, available wake sources and sleep currents vary a lot between chips — check the documentation for your target.
Data verified:2026-10-20 · Cross-checked against Espressif documentation. Anything that varies between chips or ESP-IDF releases is marked rather than guessed. Official peripheral docs →

Related