These circuits generally follow one principle: prioritize the use of the circuit with the highest voltage.
Actually, this circuit was first discovered in lithium battery charging circuits. The datasheet thoughtfully provided a reference application for automatic switching between dual power supplies, which is simple and easy to implement.
If you need to switch between battery and USB power, simply place the USB power source on top and the lithium battery source on the bottom. Regardless of the orientation, the voltage on top will always be higher than the voltage on the bottom.
Circuit:
Actual circuit phenomena:
When the AC adapter is plugged in, the circuit will automatically switch to AC adapter power.
When only a USB-5V power supply is plugged in, the circuit will automatically switch to USB power.
At the same time, connect the AC adapter and the USB-5V power supply to the circuit. Since the output voltage of the AC adapter is generally above 5.5V, which is slightly higher than the 5V of the USB power supply, the circuit will automatically switch to AC adapter power supply.
Circuit principle:
The circuit consists of one P-MOS (such as AO3401), one diode (Schottky diode is recommended due to its low voltage drop), and one pull-down resistor of appropriate value.
Assuming the USB power supply voltage is 5.0V, the AC adapter voltage is 5.5V, which is slightly higher than the USB voltage.
When the AC adapter's 5.5V is connected alone, the diode conducts, and the circuit automatically switches to AC adapter power supply. At this time, the voltage at the power supply terminal is 5.5 - 0.3 = 5.2V.
When the USB-5V is connected alone, the P-MOS's DS parasitic diode conducts first, with a source voltage of 5 - 0.7 = 4.3V. Meanwhile, the gate (G) is pulled down to 0V by the pull-down resistor, so Vgs = 0 - 4.3 = -4.3V. Since -4.3V < the P-MOS's minimum gate-gate voltage, the P-MOS conducts, and the voltage at the power supply terminal is 5 - I*Ron. Because the turn-on voltage of MOS transistors is relatively low, around tens of mΩ, and the current in a typical circuit generally does not exceed 2A, the P-MOS's turn-on voltage drop is almost negligible. This allows for very efficient 5V output to the power supply terminal.
When both the 5.5V AC adapter and the USB-5V input are connected simultaneously, Schottky diode D1 conducts. At this time, the gate voltage of the P-MOS is 5.5V, the source voltage is 5.2V, and Vgs = 5.5 - 5.2 = 0.3V. Since 0.3V is greater than the minimum turn-on threshold voltage of the P-MOS, the P-MOS turns off. The circuit then automatically switches to power from the AC adapter with the higher input voltage.
Similarly, this method also applies to automatic switching between battery input and USB power. Connect the USB power supply to the top of the circuit input side, and the 4.2V lithium battery to the bottom; the circuit will preferentially select the higher voltage.
Copyright Notice: This article is the author's original work and is licensed under CC 4.0 BY-SA. Please include the original source link and this statement when reprinting.