
This app note from Maxim describes how to build a USB powered circuit that will provide a short power-failure notice before losing power. This is called the “Dying Gasp” and it allows devices to preform a proper shut-down when USB power fails.
A safe USB “dying gasp” shutdown requires a local energy storage capacitor to power the device and prolong operation for orderly shutdown. A circuit for a 5V USB “dying gasp” application provides a power-fail output warning time of 2.88ms.
The circuit described uses a 4.7mF capacitor to store energy for this prolonged shut-down. USB specification instructs that the input capacitance of any usb device must not exceed 10uF or have a inrush current greater then 100mA. This is upheld by limiting the charge current of the large capacitor with a resistor.
Once USB power fails the capacitor continues to power the circuit and discharge. When the charge drops below a threshold level the MAX1970 IC pulls the PFO pin high. This shuts off the input MOSFET Q1 and provides a warning to devices powered by the MAX1970 IC.
