Basically I'm looking to use a simple transistor circuit to diconnect one V+ (or ground) when another is connected and automatically switch back when the switching source is removed. Like having a small lithium batt in a device with charge circuit external. When the charge supply is connected I'd like to run the device from the external supply while charging the battery and automatically swap back to battery supply when the charger is removed. Planning to work with 5VDC.
Basically looking for pointers on how to setup such a switch? already have the external charger worked out.
For clarity's sake: I'd like to charge the battery while still in circuit with the load device while powering the device. Wouldn't the batt need to be removed from load to do this safely? Could this be achieved by detecting the charger input with transistor switching and how?