Keep the ESP32-S3 powered so its timer can wake it from deep sleep. Put a P-channel MOSFET in the e-paper module’s positive supply lead, then switch it off after the refresh. An E Ink panel keeps its last image with power removed. Espressif sleep guide, UT Austin MOSFET switching circuit, E Ink technology guide.
Wire the MOSFET on the display supply
This example adds a cutoff to an existing 3.3 V SPI display setup. It uses an ESP32-S3-DevKitC-1 v1.1 and a regulated 3.3 V supply shared by the controller and the switch input. When feeding the DevKit through 3V3 and G, disconnect USB and leave the board’s 5V pin unpowered. DevKitC-1 power options and header map.
| Connection | Where it goes |
|---|---|
| Regulator 3.3 V output | DevKit 3V3 and MOSFET source |
| MOSFET drain | E-paper module’s 3.3 V supply input. Move the original power wire here. |
| MOSFET gate | Direct to DevKit GPIO21 (J3 pin 18) in this example, configured as open-drain output |
| Gate pull-up | Between the MOSFET gate and source |
| Ground | Tie the regulator, DevKit and display grounds together. |
The direct GPIO21 connection in this example uses the DevKit header map and ESP-IDF’s open-drain mode. Drive the gate low to power the display. Release it to let the pull-up bring the gate back to the source voltage, switching the display supply off. UT Austin’s separate P-channel circuit in Figure 8.3.3 uses a 2N2222 gate driver and a 10 kΩ pull-up. DevKitC-1 header map, Espressif GPIO guide, UT Austin high-side switch, Figure 8.3.3.
Check the MOSFET’s on-resistance at the available gate drive and its current rating against the module’s load. The AO3401A is one example with on-resistance specified at a gate-drive magnitude of 2.5 V. AO3401A product data.
Keep the display signals from feeding the rail
On a signal switch without powered-off protection, an input can back-power the switch’s own supply if it forward-biases the protection diode. Stop display bus activity, then disable the ESP32-S3 outputs and internal pulls on the dedicated display lines before cutting power. TI powered-off isolation brief, Espressif GPIO guide, Waveshare shutdown sequence.
If another device must keep using a shared SPI bus, isolate the display branch with a signal switch specified for powered-off isolation. During shutdown, remove power from the signal switch itself so its VDD reaches 0 V. This feature keeps the signal path high-impedance when the switch itself is unpowered at VDD = 0 V. Check the switch’s leakage specification with its supply at 0 V. TI powered-off isolation brief.
Refresh, cut power, and sleep
Apply this sequence around your module’s existing display driver. Waveshare’s integrated ESP32-S3-LR1121-ePaper-2.9 example puts the panel and radio to sleep and isolates the wireless pins. It then switches off and holds off peripheral power before putting the controller into deep sleep. Waveshare deep-sleep example.
- Power up and refresh. Configure GPIO21 as
GPIO_MODE_OUTPUT_ODwith internal pulls disabled. Usegpio_set_level()to set GPIO21 to0. Initialize the display and refresh. Wait for your existing driver to finish the refresh before putting the panel to sleep or cutting its power. Put the panel to sleep if your driver supports it. Espressif GPIO guide, Waveshare shutdown sequence, Waveshare display sleep and initialization guidance. - Release the signals before cutting power. On the dedicated display pins, use
gpio_config()withGPIO_MODE_DISABLE,GPIO_PULLUP_DISABLEandGPIO_PULLDOWN_DISABLE. If you rely on powered-off isolation for shared SPI, remove power from the signal switch itself and wait until its VDD reaches 0 V before cutting display power. Then set the open-drain GPIO21 output to1withgpio_set_level(). Callgpio_hold_en()on GPIO21 and any output-capable dedicated display pins, then callgpio_deep_sleep_hold_en(). Espressif GPIO modes and hold functions, TI powered-off isolation brief. - Arm the timer and sleep. If your application started Wi-Fi, stop it with
esp_wifi_stop(). Pass your sleep duration in microseconds toesp_sleep_enable_timer_wakeup(sleep_us), check forESP_OK, then callesp_deep_sleep_start(). Espressif sleep and timer APIs. - Restart in a known state. On wake, configure GPIO21 as open-drain with both pulls disabled and set its output level to
1. Configure the dedicated display pins withGPIO_MODE_DISABLEand both pulls disabled. Callgpio_hold_dis()on each held pin. Drive the gate low again to turn display power back on. If you use shared SPI, power the signal switch back on before initializing or refreshing the panel. Use your existing display driver’s setup to restore the display’s SPI pin routing. Reinitialize the panel before the next refresh if its driver requires it. Espressif GPIO hold-release guidance, Waveshare display sleep and initialization guidance, TI powered-off isolation brief.
Check wake-up and estimate battery life
On startup, check that esp_sleep_get_wakeup_cause() returns ESP_SLEEP_WAKEUP_TIMER. The DevKit stays powered during deep sleep. With the MOSFET off, the pull-up brings the gate to the source voltage. If the display path uses a signal switch without powered-off protection, check whether an input is back-powering that switch’s own supply through its protection diode. Espressif wake-cause API, UT Austin high-side switch, TI back-powering example.
Measure the whole frame at the battery input during both a refresh cycle’s awake portion and the sleep portion. A current profiler can capture active and deep-sleep current across a cycle. Adafruit ESP32 power profiling, TI duty-cycling guide.
| To find | Calculate |
|---|---|
| Average battery current | (awake current × awake time + sleep current × sleep time) ÷ total cycle time |
| Estimated hours of runtime | usable battery capacity in mAh ÷ average battery current in mA |
| Average-current budget for a multi-month target | usable battery capacity in mAh ÷ target runtime in hours |
Use the same unit for both time terms and compare your average current with the target budget. Use battery-side current for both terms so the estimate includes everything powered by the battery during those intervals. TI duty-cycle calculation, Adafruit battery-runtime examples.
Evidence and limits. The firmware steps use the ESP32-S3 ESP-IDF v5.5 GPIO and sleep documentation. The wiring draws on the DevKitC-1 v1.1 guide and the linked circuit references. Sources were checked on November 26, 2026. The wiring and firmware were not tested on hardware.