Loading simulator…
The device should run from the main 5 V supply when available, automatically transfer to 4.2 V backup power, and briefly survive a complete shutdown. Diode-OR power selection provides one-way supply isolation; a capacitor across the load provides stored energy.
D1 from MAIN_IN/I_MAIN and D2 from BACKUP_IN/I_BACKUP toward a common output node. Their cathodes meet at the supply node feeding R_LOAD = 1 kΩ.C_HOLD = 100 µF across R_LOAD. With both sources removed after backup operation, the capacitor starts near 3.57 V and discharges through the 1 kΩ load. Its time constant is .Check normal and backup supply states, and inspect I_MAIN/I_BACKUP for negligible reverse current into either source. For shutdown, first settle the circuit on backup only; then set both supplies to 0 V and measure load voltage at 10 ms and 100 ms.