Ad Space — Top Banner

Deep Sleep Not Working

Espressif ESP32

Severity: Moderate

What Does This Error Mean?

ESP32 deep sleep not working is usually caused by a missing wake-up source configuration, or peripheral devices on GPIO pins preventing the ESP32 from actually entering the low-power state. Call esp_sleep_enable_timer_wakeup() before esp_deep_sleep_start() and disconnect external pull-up currents.

Affected Models

  • ESP32 DevKit
  • ESP32-WROOM-32
  • ESP32-S2
  • ESP32-S3
  • ESP32-C3
  • ESP32 WROVER

Common Causes

  • No wakeup source configured — ESP32 enters sleep but never wakes
  • USB-UART bridge keeping power rail active on development boards
  • External pull-up resistors connected to GPIO pins drawing current during sleep
  • Wi-Fi or Bluetooth not properly stopped before calling esp_deep_sleep_start()
  • Power supply not supporting the low current draw — brownout at wake-up

How to Fix It

  1. Configure a wake-up source before sleeping.

    An ESP32 without a configured wake source will enter deep sleep and never wake unless reset. Add one of: esp_sleep_enable_timer_wakeup(MICROSECONDS) for timer wake, or esp_sleep_enable_ext0_wakeup(GPIO_PIN, LEVEL) for GPIO wake. Call this before esp_deep_sleep_start().

  2. Disable Wi-Fi and Bluetooth before sleeping.

    Active Wi-Fi or Bluetooth radios will not power down properly with deep sleep. Add WiFi.disconnect() and WiFi.mode(WIFI_OFF) before calling esp_deep_sleep_start(). Also call btStop() if Bluetooth was used. This ensures full current reduction during sleep.

  3. Measure current draw on battery, not USB.

    On development boards, the USB-UART bridge chip continues to draw power from the USB 5V rail even during ESP32 deep sleep. To test actual deep sleep current, power the board from a battery through the 3V3 or VIN pin (not USB). True deep sleep current should be 10–150µA depending on the ESP32 module.

  4. Set unused GPIO pins to input or hold state.

    Floating GPIO pins during deep sleep can draw unexpected current. For each GPIO you don't need active during sleep, either set it to input with internal pull-down (gpio_set_pull_mode(pin, GPIO_PULLDOWN_ONLY)) or use esp_deep_sleep_pd_config() to power down domains.

  5. Handle the wake-up restart in setup().

    After waking from deep sleep, the ESP32 runs setup() again — it does not resume from where esp_deep_sleep_start() was called. Use esp_sleep_get_wakeup_cause() in setup() to detect wake source and skip initialization that only needs to run on first power-on.

When to Call a Professional

ESP32 deep sleep is a software-implemented feature. If sleep mode current is much higher than expected (should be <10µA), external components on the board are likely drawing current — measure and isolate them.