Skip to content

ESP32 Light Sleep Wakes Immediately

DodaTech Updated 2026-06-26 1 min read

In this tutorial, you'll learn about ESP32 Light Sleep Wakes Immediately. We cover key concepts, practical examples, and best practices.

The Problem

ESP32 enters light sleep but wakes up immediately or never enters sleep.

Quick Fix

Wrong

esp_light_sleep_start();  // Interrupts cause immediate wake
Light sleep lasts <1ms. CPU stays at high power.
esp_sleep_enable_timer_wakeup(5 * 1000000);  // 5 seconds
esp_light_sleep_start();
uint64_t sleepTime = esp_sleep_get_wakeup_time();
Serial.printf("Slept for %llu us\n", sleepTime);
Slept for 5000000 us
(5 seconds of light sleep at 0.5mA)

Prevention

Disable WiFi/BT before light sleep (esp_bluedroid_disable(), esp_wifi_stop()). Configure wake sources properly. Mask unwanted wake-up interrupts. Use esp_sleep_enable_gpio_wakeup() for GPIO wake. Light sleep keeps RAM powered (0.5mA).

DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.

FAQ

### What is the light sleep current?

Light sleep current is ~0.5 mA with RAM retention. Much higher than deep sleep (10 uA) but faster wake time (~1ms vs ~50ms).

Does light sleep preserve Wi-Fi connection?

No. Wi-Fi disconnects during light sleep. Use MQTT LWT to signal offline status and reconnect on wake.

When should I use light vs deep sleep?

Light sleep: frequent wake cycles (1-5 seconds), need fast wake, higher power OK. Deep sleep: infrequent wake (minutes+), need ultra-low power.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro