I want to make a circuit where the power to mcu switches from mains transformer to dc battery when when mains power is not available.
The basic concept is to use a transistor to stay open circuit to keep the battery from supplying the mcu while the mains transformer is active.
Once mains power goes out it should make the transistor conductive and close the circuit with battery.
In a nutshell when mains power is on transistor is off and vice versa
A complimentary congiguration with pnp would have been ideal but I'm limited to using bc548 atm
Please guide me to the right direction