I am trying to create a UPS circuit purely to provide battery power when main input power is lost. I think I've figured out part of the circuit that stops the battery input when the main power is still on:
simulate this circuit – Schematic created using CircuitLab
But, as you can see, when main input is lost, the battery will end up providing voltage to Q2, ultimately grounding Q1 … Creating some sort of paradox there Lol … I'm thinking that there is another high side switch, or PNP that I need to add to this circuit for it to work. This is all theoretical, and Main Input = Battery Input.
UPDATE
From the comments and answers, I think I've found that diodes could solve this circuit … Here's my new schematic … It seems to work in my head Lol:
Best Answer
Do you need to use switching transistors? You can accomplish the same switching by using just two diodes. Select the diodes to safely pass the highest amount of current expected, and the diode's reverse voltage to withstand the highest voltage expected. (Including a fuse on the battery side is also a good investment in case of any problems.) .See below.
simulate this circuit – Schematic created using CircuitLab