Page 1 of 1

ESP32 interrupt not waking device after low battery

Posted: Wed Mar 16, 2022 10:16 pm
by ldudel
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?

Re: ESP32 interrupt not waking device after low battery

Posted: Thu Mar 17, 2022 1:55 am
by ESP_Sprite
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.

Re: ESP32 interrupt not waking device after low battery

Posted: Thu Mar 17, 2022 9:12 pm
by ldudel
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 3059 times

Re: ESP32 interrupt not waking device after low battery

Posted: Fri Mar 18, 2022 12:27 am
by ESP_Sprite
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.

Re: ESP32 interrupt not waking device after low battery

Posted: Fri Mar 18, 2022 12:52 am
by ldudel
Thanks for the link! On what pin does the reset pulse need to come in?

Re: ESP32 interrupt not waking device after low battery

Posted: Fri Mar 18, 2022 12:24 pm
by ESP_Sprite
The EN pin doubles as the reset pin, so that one.