How to switch to a second power source if the first loses power
If you don't care which one supplies the power when both are present, you can just use two diodes (assuming the sources are DC).

The one with the higher voltage supplies the current. You will get a small voltage drop in the diodes (Schottky diodes have a bit less drop typically). 







simulate this circuit &ndash; Schematic created using CircuitLab

The diode rating must be adequate for the current, and the diode must be able to withstand the reverse voltage when one source is off. The type shown is adequate for a couple amperes at any realistic voltage.