ESP32 interrupt not waking device after low battery

ldudel
Posts: 9
Joined: Thu Jun 24, 2021 11:23 pm

ESP32 interrupt not waking device after low battery

Postby ldudel » Wed Mar 16, 2022 10:16 pm

I'm running power testing on my custom ESP32 PCB. The following code works great when entering sleep:

Code: Select all

esp_sleep_enable_ext0_wakeup(gpio_num_t(CHARGER_PLUGGED_PIN), HIGH);
esp_deep_sleep(sleep_time);
The ESP wakes up after sleep_time. If the charger is plugged it wakes up immediately.

However, if the battery runs out, the ESP doesn't wake up when external power is connected.
* Connecting PROG port shows no activity on serial monitor.
* Connecting external power to VBUS moves CHARGER_PLUGGED_PIN to high, but the ESP doesn't wake. No serial monitor activity either.

Is this a known issue? Are there any workarounds?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interrupt not waking device after low battery

Postby ESP_Sprite » Thu Mar 17, 2022 1:55 am

The ESP32 will be in an indeterminate state if the voltage it gets is lower than the minimum voltage. The way to get it out of that state is to give it a proper reset pulse. On e.g. an USB-powered device, the RC-circuit included in most devices is sufficient, as a connecting cable makes the supply voltage raise fast enough for the RC circuit to work. For more complicated signal forms, you need more advanced solution, e.g. a voltage monitor / reset IC.

ldudel
Posts: 9
Joined: Thu Jun 24, 2021 11:23 pm

Re: ESP32 interrupt not waking device after low battery

Postby ldudel » Thu Mar 17, 2022 9:12 pm

Thanks for this response. Plugging the USB evidently doesn't generate a strong enough pulse in my design. Is there a reference design for how to make this work?

Here is the current design:
power_circuit.png
power_circuit.png (66.39 KiB) Viewed 3549 times

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interrupt not waking device after low battery

Postby ESP_Sprite » Fri Mar 18, 2022 12:27 am

The issue is likely that the battery, when it has run out, still supplies a voltage but not enough for the ESP32 to run off, putting the ESP32 in an indeterminate state. Plugging in the charger doesn't produce a reset pulse (as the power never fully went away) so the ESP won't get out of that situation.

We don't have a reference design with a voltage monitor, as far as I know, sorry, but there's some external information available on this topic.

ldudel
Posts: 9
Joined: Thu Jun 24, 2021 11:23 pm

Re: ESP32 interrupt not waking device after low battery

Postby ldudel » Fri Mar 18, 2022 12:52 am

Thanks for the link! On what pin does the reset pulse need to come in?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 interrupt not waking device after low battery

Postby ESP_Sprite » Fri Mar 18, 2022 12:24 pm

The EN pin doubles as the reset pin, so that one.

Who is online

Users browsing this forum: No registered users and 339 guests