# P Channel MOSFET to do automatic switch between battery and power source

I need an application to switch between power source and battery. When the power source is absent, then battery will act as the power source for the load.

I try out with the P Channel MOSFET to do the power switching.

The MOSFET I am using is as follow. MOSFET datasheet link

simulate this circuit – Schematic created using CircuitLab

This circuit works where the MOSFET Turn off when V1 is on but when the V1 is switched off, then MOSFET is turned on. So RLoad will get the voltage source from battery when V1 is off.

However, i tried to measure the current flow from BAT1 to the circuit when the MOSFET is off and there is some current flow as well according to the RLoad.

As the RLoad higher then the current from the battery is going higher as well even the MOSFET also turn off.

I thought on the MOSFET turned off, then it would have no current flow through but there is still some current flow it from the battery source.

Is there anyway to prevent the battery current flow as this could reduce the battery voltage ?

1. MOSFET is upside down so it will conduct through the internal diode always.
2. You need to connect the gate to the other side of D1 so it is pulled low when V1 drops.

simulate this circuit – Schematic created using CircuitLab

I would have drawn it more like this for clarity though.

simulate this circuit

Be Aware, the 12V for V1 can try to charge the battery through M1 with this circuit though.

• Be Aware, the 12V for V1 can try to charge the battery through M1 with this circuit though. >>> and how can we avoid that? :) Commented Jun 2, 2020 at 14:37
• double schottky 2 in 1 out or just two schottkies as the crudest, yet maybe ok solution if you don't mind losing 0.15-0.2V
– Ilya
Commented Jun 8, 2020 at 20:58
• Why is C1 4.7uF specifically? More generally, what are good guidelines for C1 given different possible supply voltages or loads? Commented Mar 1, 2021 at 3:19
• To avoid the charging you can also use two back to back pfets. To be honest though, you'd need the battery to be as low as ~11.8 or 11.7 V, which depending on the chemistry might be a rare occurrence. Commented May 13, 2022 at 9:17