Which method of undervoltage protection for a project using an SD card?

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;

  1. 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.
    image

  2. 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.

The SD card will probably handle low voltage ok. After all, it experiences dropping voltage every time its power is cut off. So it probably is designed to deal with that.

But it seems to me the bigger problem with using a supervisor is that it may shut things down without warning right in the middle of a write operation to the card. It seems you would want the ESP32 to detect low voltage and suspend writing to the card in an orderly manner.

I just thought maybe something could go awry if you had the SD card lose voltage very slowly, even if nothing was getting written/erased on it. But you raise a good point.

Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.