Relay Switched Router UPS

This simple Uninterruptible Power Supply (UPS) was built as an addition to my 12V solar powered battery backup system to give continued internet access in the event of a mains power cut (conveniently my router runs on 12V). I thought about using MOSFET transistors to do the switching but decided instead to use a relay because there will always be isolation between the main and backup power supply due to the air gap between the contacts. The relay chosen draws less than 13mA at 12V when energised so hardly adds any extra load to the router's mains adapter. One problem with relays is that there is a moment when the contacts are in mid air as they move from one position to the other, effectively disconnecting the load for a short period of time. This won't matter too much if the load being switched is, for example, a light bulb where all you might notice is the light dim for a fraction of a second, but if the relay is switching a router, a brief power interruption will cause it to quickly turn off and on again taking your network down for several minutes while it reboots. The purpose of this circuit is to provide power during the changeover period so that the router doesn't drop out


Under normal operating conditions the relay is energised, supplying 12V to the router from its own mains adapter via the normally open (NO) contacts which are now closed because this same voltage is also used to power the relay. If there is a mains failure the relay will de-energise, the contacts will return to their normally closed (NC) position and the router will now be supplied from the 12V backup battery. If the relay actually switched over at 12V it would be fine but in practice it doesn't, because another problem with relays is that they don't energise at their specified voltage. The relay used in this circuit has a 12V coil but will pull the contacts at approximately 8V and, even worse, only release them when the coil voltage drops to approximately 4V. So without this circuit, the relay would de-energise only when its supply voltage has fallen below 4V which will cause a router designed to work at 12V to reboot. Conversely, when the router is running from the battery and mains power is restored, the relay would energise at approximately 8V which still isn't enough for the router to operate and again it will reboot. This occurs because the mains adapter that powers the router has an internal smoothing capacitor which takes time to discharge when power is removed and charge when power is restored. To address the two main issues that relays have (not cutting in and out at their specified voltage and relatively slow changeover times) we need a circuit that not only makes the relay operate at 12V (slightly under is better), but can also supply power during the contact changeover period

Veroboard layout

Circuit operation is straight forward. The relay is switched by an NPN transistor with its base connected to the 12V supply via a zener diode and current limiting resistor. With this arrangement the transistor will only switch on and power the relay when the supply voltage rises to around 11V because of the voltage dropped across the 10V zener and the transistor base junction. So the relay now pulls and releases close to 11V and the router will continue to operate uninterrupted during the contact changeover period due to the charge stored in the two 2200u reservoir capacitors which is also close to 11V. The only reason that two 2200u capacitors are used in parallel instead of a single 4700u is because it's housed in a compact enclosure and two smaller caps are 5mm shorter than a single larger one! It's worth noting that some routers have enough internal capacitance to allow them to 'ride the storm' during very brief voltage dips, in which case the capacitors may not be required (not so my TalkTalk router). The diode across the relay coil is to protect the transistor from being damaged by the large reverse voltage that occurs when the magnetic field in the relay core collapses

12V OUT (router)                      12V IN (battery)      12V IN (adapter)
Relay type: MCB-S-212-CH
Relay on its own:
Pulls at 7.5V
Releases at 3.9V
Relay in UPS circuit:
Pulls at 10.8V
Releases at 10.8V
Current consumption:
<13mA at 12V
Note: The 2 poles are connected in parallel to share the current

Usually, connecting relay poles in parallel to increase the switching current is not recommended because one pole could connect and/or disconnect slightly before the other causing it to pass more amps than it's design rating, which could prematurely burn out the contacts. Here it's OK though, as I'm not aiming to double the current capacity but halve it by sharing the load between the two poles. The design rating is never exceeded

The circuit is constructed in a Hammond/Eddystone diecast enclosure (type 27134PSLA) with 'chunky' 2.1mm DC power connectors for inputs and output. Because this type of socket has the negative terminal connected directly to its body, the enclosure can serve as a common ground. Due to the enclosure not having much headroom, the board is mounted on two 5mm M3 hex pillars which were the longest I could get away with while still allowing the capacitors to fit with the lid on (20mm was the lowest height capacitors I could find). The pillars are also used to ground the circuit down to chassis by simply adding four little 'dobs' of solder, one either side of each mounting hole (shown on the board layout as 4 black dots)