Ein schöner Artikel, der die power modes, wake up sources und deren Anwendung ausführlich erklärt: ESP32 Deep Sleep with Arduino IDE and Wake Up Sources | Random Nerd Tutorials. Anbei in Auszügen.
ESP32 power modes and wake up sources explained
The ESP32 can switch between different power modes:
- Active mode
- Modem Sleep mode
- Light Sleep mode
- Deep Sleep mode
- Hibernation mode
You can compare the five different modes on the following table from the ESP32 Espressif datasheet.
The ESP32 Espressif datasheet also provides a table comparing the power consumption of the different power modes.
And here’s also Table 10 to compare the power consumption in active mode:
Wake up sources
- You can use the timer, waking up your ESP32 using predefined periods of time.
- You can use the touch pins.
- You can use two possibilities of external wake up: you can use either one external wake up, or several different external wake ups.
- You can use the ULP co-processor to wake up – this won’t be covered in this guide.
Invoking deep sleep mode
To write a sketch to put your ESP32 into deep sleep mode, and then wake it up, you need to keep in mind that:
- First, you need to configure the wake up sources. This means configure what will wake up the ESP32. You can use one or combine more than one wake up source.
- You can decide what peripherals to shut down or keep on during deep sleep. However, by default, the ESP32 automatically powers down the peripherals that are not needed with the wake up source you define.
- Finally, you use the esp_deep_sleep_start() function to put your ESP32 into deep sleep mode.