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
| State | Typical current | Note |
|---|---|---|
| Bare module, deep sleep | ≈10 µA | Order-of-magnitude reference |
| Dev board with USB-UART bridge + LDO | 100 µA – several mA | Peripheral leakage dwarfs the chip |
| Wi-Fi transmit burst | 80 – 150 mA | This 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
| Source | Note |
|---|---|
| Timer | esp_sleep_enable_timer_wakeup(us) — the usual choice |
| ext0 | One RTC GPIO reaching a given level |
| ext1 | A combination of several RTC GPIOs (any / all) |
| Touch | Supported on the original ESP32 |
| ULP co-processor | Keeps 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
- Call
rtc_gpio_isolate()on unused RTC pins; it removes a surprising amount of leakage. - Remove or bypass the power LED and the LDO on dev boards — usually the biggest culprits.
- Switch sensors with a MOSFET and cut them off entirely rather than trusting "standby mode".
- Use large pull-ups (100 kΩ range), or feed them from a GPIO only when needed.
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
I²CWhich two pins to use for I²C on the ESP32, what pull-up value to pick, and why your device never shows up on the bus scan.SPIWhich pins HSPI and VSPI default to, how fast you can realistically clock them, and why your display stays black.UARTWhich pins each of the three UARTs defaults to, why UART1 appears broken, and what to check when flashing fails.RMT (IR & WS2812)RMT is the most underrated ESP32 peripheral: IR remotes, WS2812 strips and one-wire sensors all depend on it. Channels, resolution and the Wi-Fi interference problem.LEDC PWMThe ESP32 LEDC offers 16 PWM channels. Frequency and resolution trade off against each other — here is the maths and recommended values.