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:
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.
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: