LIBRARYPower modes and sleep.
Sleep modes shut down parts of a microcontroller to cut current from milliamps to microamps. Why sleep current dominates battery life, with a runtime calculator.
A microcontroller does not have to run flat out. Sleep modes shut down parts of the chip to cut its current from milliamps down to microamps, and on a battery that is the difference between hours and months. A board that spends almost all of its time asleep can run for a very long time on a small cell.
Active, light sleep, deep sleep
In active mode the CPU and radio run and the chip draws the most current. Light sleep pauses the CPU but keeps its state and memory alive, so it wakes quickly and picks up where it left off. Deep sleep powers down almost everything, keeping only a tiny always-on domain, which drops the current to microamps but loses most of the chip's state, so it effectively restarts on wake. Each step trades responsiveness for lower current.
What wakes it
A sleeping chip wakes on a source you configure ahead of time: a timer after a set interval, a pin changing level, or a peripheral event. A typical sensor node deep-sleeps on a timer, wakes, takes a reading, sends it over the radio, and goes back to sleep, spending a few milliseconds awake for every several seconds asleep.
Why sleep dominates battery life
When a board is awake for a few milliseconds and asleep for seconds at a stretch, the sleep current sets the average almost by itself, and the brief active current barely counts. Halving the deep-sleep current can nearly double the runtime, while shaving the active current barely moves the needle. That is why low-power design chases deeper, more frequent sleep; slowing the CPU down barely helps.
Inputs
Result
13 h 20 m
estimated runtime
13.3 hours at 120 mA average
▸Deep dive· What stays powered in deep sleep
On the ESP32 a small low-power domain stays alive through deep sleep: an RTC timer to keep time and wake the chip, a little RTC memory, and a few RTC-capable GPIOs that can serve as wake pins. Everything else, the main cores and most peripherals, is powered off, which is where the microamp current comes from. Because normal RAM is lost, you stash the handful of bytes you need to survive the restart (a counter, a state flag) in that RTC memory, and read them back on wake. (Espressif ESP-IDF sleep modes)
Checkpoint
Quick check
One Thousand Drones engineering team · verified 2026-07