# Automatic voltage selection using SPDT relay

I'm working on a design with two voltage inputs and I need to give priority to one of the two inputs when both are plugged simultaneously. Both must also work individually.

• the first input (V1) is from a battery (12VDC)
• the second input (V2) is from an AC/DC powersupply (12VDC)

When the battery and the power supply are connected simultaneously, I want the power supply to provide the energy so that the battery is not discharged (electrically disconnected). As soon as I disconnect the main power supply, the battery takes over and provide the energy.

To do this I thought of a circuit using a SPDT-NC relay: The non-priority input (battery) is connected to the NC input. The priority input (Main power supply) is connected to the NO terminal and I also use its voltage to switch the relay. The relay switch/latch from NC to NO as soon as the Main power supply is plugged.

relay datasheet:https://omronfs.omron.com/en_US/ecb/products/pdf/en-g5le.pdf

I specify that it is V3 (voltage on COM terminal) which will then power the system (the load), so I cannot control the relay coil form a microcontroller since it will not be powered..

Have you ever had this experience, and does the attached circuit diagram seem functional?

how to improve the whole design to add reliability and protection ?

My load is around 10A@12V so 15/20A D2PAK schottky should be fine.

What's important in your solution is to check that the min voltage at full charge of the main PSU is always higher than the max voltage of the battery, to be sure that diode is indeed reversed and not conductive with both source simultaneously.

When battery is used without main PSU, the schottky continuously conduct. With a power dissipation of 10A*0.3V=3W it can quickly heat up... Standard Rja~35°C/W and Ta=30°C, Tj=135°C. It can require an external heatsink. My design is passive thermal cooling and cannot be ventilated.

the solution with the relay avoid to drive high current in a component (except the relay which is made, for I guess...) and prevent temperature rising in some conditions.

What I'm missing is how to drive the relay coil to make sure I don't damage it by switching it everytime I turn on the main PSU...

• Not a bad question but it comes up all the time. Hold on I'll try to dig up one of my old answers.
– Drew
Commented Jun 17, 2022 at 7:29
• I couldn't find my old answer, but this is one is very similar: electronics.stackexchange.com/questions/616246/…
– Drew
Commented Jun 17, 2022 at 7:41

Here's a simpler solution, using Schottky diodes that have a low forward voltage drop.

The power supply, that is set to 13.8 V to reverse bias the Schottky diode in series with the battery, will predominate.

The battery will take over only when the utility supply fails or when the power supply is switched off.

• What if the battery voltage exceeds 12.2V? The battery type in the application is not given, but if it's a car battery a fully charged one can easily have 13.8 VDC or higher. Commented Jun 17, 2022 at 9:31
• Hi Rohat, Thank you very much for your pertinent question. Yes, the power supply voltage needs to be set to at least 13.8 V DC. The additional diode, to avoid back-feeding, is also a must. My answer has been edited accordingly. Commented Jun 17, 2022 at 14:17
• The power supply, that is set to 13.8 V well, sorry to say this but, seems impossible because the OP put this under my answer below: I cannot change the voltage from my sources since they are fixed by regulators. Commented Jun 17, 2022 at 14:42

how to improve the whole design to add reliability and protection ?

The whole design seems correct. At least it provides the functionality. And powering the relay's coil from PSU instead of battery is well though as it prevents unnecessary draining of the battery.

Normally this could have been done with discretes/semiconductors. Presence of mechanical elements such as relays brings some extra risks such as the contact welding. If inrush currents are involved this risk becomes more visible. Of course there are risks for semiconductor-based designs as well since they bring more complexity.

Diodes on their own could be enough as long as you can guarantee that the PSU's output voltage will always be higher than battery's because the supply with higher voltage will always takeover.

simulate this circuit – Schematic created using CircuitLab

The diodes can work as a protection against reverse polarity supply. For the relay-based solution, even if you apply the voltages in reverse the relay's coil can still be energised but the load will see the reverse supply which can be dangerous.

• Thank you Rohat Kılıç for your answer. unfortunatly I cannot change the voltage from my sources since they are fixed by regulators so the solution with diodes is not doable for me. what do you suggest to prevent contact welding and to limit inrush current ? Indeed the main PSU will latch the relay from NO to NC at every startup. What do you mean about "this could have been done with discretes/semiconductors" ? Are you talking about SSR (solid-state relay) ? Commented Jun 17, 2022 at 10:08
• @TunableWhite what do you suggest to prevent contact welding and to limit inrush current? No information about the load is given so I assumed that the load "could" be a capacitive load (e.g. an active device with big input filtering capacitors). Capacitive loads cause very high inrush currents and therefore contact welding. If the load is capacitive, you may want to consider using inrush-type relays or SSR (solid-state relay). With "discrete" I meant using discrete components such as MOSFETs, diodes, etc. to make a reliable circuit. Commented Jun 17, 2022 at 14:39