Say that you have a datalogging project, which uses an ESP-32 and an SD card. The project is powered from a wall adapter, and implements supercapacitors to give the project some backup power, incase of a mains power outage.
Implementing undervoltage protection can be a good idea, as the supercapacitors can discharge to a voltage that is unsafe for the processor.
There are 2 method's I've seen for implementing undervoltage protection, which are both explained in one of Andreas Spiess' video's #315 How to use Voltage Supervisors to protect ESP32, Raspberry Pi, and Batteries - YouTube.
These 2 methods are;
-
Using a voltage supervisor IC, with the output of the supervisor connected to the reset pin of the MCU. When the voltage reaches an unsafe threshold, the reset pin is turned on (pulled to ground), which prevents the program from running when at an unsafe voltage.
-
Using a voltage supervisor (or a different type of external voltage comparator) and a Mosfet. The Mosfet is used as a high-side or low-side switch, to turn on/off power to the entire circuit. The supervisor turns on the mosfet when at a safe voltage, and the supervisor turns off the Mosfet when at a low enough voltage. As Andreas mentions, this method can also be used if you want to prevent a rechargeable battery from continuing to power the external circuit, which could lead to the battery becoming deeply discharged, which can damage it, however I don't think this is a problem with supercapacitors - Correct me if I'm wrong.
For the circuit using an ESP-32 and an SD card, if you implement the first method of undervoltage protection, by putting the ESP-32 in continual reset-state (RST pulled to GND) when at undervoltage, the ESP-32 itself is protected when at under voltage. However the SD card is still being powered at an unsafe voltage.
Can this undervoltage corrupt the data on the SD card, even though the ESP-32 cannot control the SD card when it is in a reset state? Would you need to implement the mosfet method (method 2) instead, which cuts power to the SD card?
Thank you.