I have a project which gets its power from a car battery or a 12V wall wart. What I'd like to do is have both of these wired in, but when the mains power is present, have the battery no longer supplying. The battery and the mains supply are going to be kept independent, so no charging occurs, and I'd like to make it automatic so the battery can kick in almost as a UPS.
Is this as simple as using a P channel MOSFET with the wall-wart output into the gate to turn off the battery supply, and adding a diode at both supplies so neither can feed power into the other? Or are there other issues I need consider? Presumably since a MOSFET is switched by voltage I can put a large value resistor before the gate to ensure low power consumption for this switching? Also, the 12V is split to run some devices directly, but a microcontroller and supporting ICs via a switched mode 12-5V DC-DC converter - is there any issue with one of those interfering with this concept?
Thanks in advance for your advice, Geoff