# Power source switching circuit

I'm trying to design a circuit that will switch between two power sources using commands from a Raspberry Pi. Both power sources are 12 V and the desired output voltage is 12 V and max. 2 A.

How I want the circuit to work is as follows:

If I want source 1 to supply voltage, GPIO1 should send a HIGH signal.

If I want source 2 to suppy voltage, GPIO2 should send a HIGH signal.

One source or the other should supply voltage, or none at all. They should never be ON at the same time.

Question 1: Does this circuit achieve what I'm trying to design?

Question 2: In order to prevent a short circuit in case both GPIO1 and GPIO2 happen to turn on at the same time, would adding high-current diodes to the outputs of each transistor (Q1 and Q3) solve it? If yes, what type of diodes should I use to ensure that I get 12 V at the output voltage? Would they be connected in parallel or in series to the output of each transistor?

Does this circuit design achieve what I'm trying to design?

Yes, it does.

In order to prevent short circuit in case both GPIO1 and GPIO2 happen to turn on at the same time, would adding high current diodes to out of each transistor (Q1 and Q3) solve it?

Yes but remember that the voltage drop across the series diodes is not zero. Plus, the diodes will dissipate power: Even for a Schottky diode the dissipation can be as high as 1 W. Apart from this, if there's an inrush risk you should also take that into account.

A circuit that forces the the other channel off when one channel is on might work as well:

simulate this circuit – Schematic created using CircuitLab

(Don't mind the part numbers - I didn't bother with changing them)

NOTES:

• If there's something like a priority then one "silencer" can be omitted.
• The inputs of the silencers could have been come from GPIOs as well. You might want to get the input from the power input, depending on operational or safety reasons.
• There must be a series resistor, preferably 1k, from each GPIO to the respective pre-driver MOSFET.

Question 1: Does this circuit design achieve what I'm trying to design?

Yes, it does.

Question 2: In order to prevent short circuit in case both GPIO1 and GPIO2 happen to turn on at the same time, would adding high current diodes to out of each transistor (Q1 and Q3) solve it? If yes, what type of diodes should I use to ensure that I get 12V at the output voltage? Would they be connected in parallel or in series to the out of each transistor?

Well, adding one diode after each transistor helps to prevents back currents between the sources and this is a good practise. Keep in mind tha two source could be ORed, avoiding strange working state, if the have differt voltage values since it would work the source with higher voltage. Backing to your question, to avoid inrush current i would use an inrush current control (COTS or not depend on you). If you don't want to you can place may be a big capacitor (or even better an hold up circuit) before the series diode in each line in order to partially control the inrush event. Last thing the inrush event happen only when both sources are disconnected and one of them is connected to the load.

A 2-channel DPDT relay module should do.

Here's the schematic.

Source 1 would be output with Relay 1 on and Source 2 with Relay 2 on.

There would be no output with both the relays on.

The voltage drop across the relay contacts would be negligible.

You have PWR1 and PWR2, which run the risk of both being asked for at the same time, and which therefore means you need the complexities of your circuit. (In software this is a "normalisation" issue.)
Instead, why not have PWR and SELECT? PWR means something should be on, and SELECT says which.