UPDATE: I've added in the body diode of the PMOS, in the top circuit, the source faces the battery, and if for some reason the USB voltage is too high, it will power the battery (you don't want that). In the bottom one, the source, along with the body diode, faces the other side where it will block the power from USB.
This circuit will automatically switch between the 3.6V battery and the 5V external supply using a P-MOS.
The gate of the P-MOS us pulled down to ground, so the Vgs is normally negative (0-3.6=-3.6V)and the P-MOS conducts.
When 5V is presented to the gate of the P-MOS, Vgs is now positive (5-3.6=1.4V) and the P-MOS stops conducting.
The diode prevents voltage from flowing back to 5V USB, and when the P-MOS is turned off, prevents 5V from reaching the battery.
This is also known as a battery load sharing circuit. See more: http://ww1.microchip.com/downloads/en/appnotes/01149c.pdf
|