# Protecting battery and USB inputs from each other

I have this circuit, which I expect will protect my primary cell from USB voltage and my USB port from being powered by the battery.

My logic is;

• D2 will stop anything flowing out of the USB port from the rest of the system
• When USB 5V is present, the PMOS (Q1) will be turned off regardless of if the battery is in place and restrict flow to the battery terminals.
• When the USB 5V is not present the PMOS will be on, allowing current to flow from the battery.
• C2 will provide a small amount of charge to handle power loss situations (looking at it now I think I'll increase R3 to restrict discharge back out through the USB port in a power loss scenario).

Is this a sensible circuit?

• For capacitor you would want a voltage rating of twice the supply voltage it filters. For the battery a 10V should suffice, for the USB 10V or better evven 16V. Nov 18 '20 at 11:32
• How would the FET ever turn off by applying USB supply? Nov 18 '20 at 11:35
• Depending on design constraints/budget/etc, you might be able to find an IC to help with l this, and possibly also add features like soft start. e.g. TPS2110 to TPS2115 series from TI. Nov 18 '20 at 12:24

Is this a sensible circuit?

Only you can decide if it's sensible. I can say what it doesn't do that you think it will do. Such as this: -

When USB 5V is present, the PMOS (Q1) will be turned off regardless of if the battery is in place and restrict flow to the battery terminals.

This won't happen - when the USB 5 volts is present, the PMOS source-gate voltage is 5 volts (-5 volts $$\V_{GS}\$$) and this will turn on the PMOS and connect the battery with the USB supply. I don't believe you want this to happen!

What you actually need is for the gate to be connected to USB 5 volts so that the PMOS turns off. You might be able to fiddle that a little like this: -

But don't take my word for it - simulate it and prove it works.

Given that this is a fundamental "insensibility" then I'm not bothering with the other points because you need to prove the modification I've suggested actually works in all scenarios. And then, once you have mastered the art of simulation, you won't need to re-ask this question because, the sim tool will tell you what you need to know.