Loading simulator…
A device needs to draw power from its 5 V main supply whenever available, then transfer automatically to a 4.2 V backup. Two correctly oriented diodes form a simple diode-OR circuit that selects the higher available source and prevents one source from feeding the other.
D1 in series with MAIN_IN and I_MAIN, and D2 in series with BACKUP_IN and I_BACKUP. Both diode cathodes meet at VOUT, which supplies R_LOAD = 1 kΩ to ground.D1. VOUT is approximately . Because the backup is only 4.2 V, D2 is reverse-biased and the backup does not deliver current.MAIN_IN falls to 0 V, D1 stops conducting and D2 turns on. VOUT becomes approximately ; the load remains powered, now from the backup.VOUT falls toward 0 V.Test (MAIN_IN, BACKUP_IN) as (5 V, 4.2 V), (0 V, 4.2 V), and (0 V, 0 V). Expect approximately 4.37 V, 3.57 V, and 0 V at VOUT, respectively. Observe how I_MAIN and I_BACKUP exchange roles.