Home
Relay Switched Router UPS






This simple Uninterruptable Power Supply (UPS) was built as an addition to my 12 volt solar powered battery backup system to give continued internet access in the event of a mains power outage (conveniently my router runs on 12V). I experimented with MOSFET transistors as switches but in the end preferred to use a relay because it will always provide isolation between the main and backup power supplies due to the air gap between the contacts. The relay chosen draws less than 15mA at 12V when energised and so hardly adds any extra load to the router's mains adapter. One problem with relays is that there is a period when the contacts are in mid air as they move from one position to the other, effectively disconnecting the load for a very brief 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 interuption 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 (apart from being a basic relay changeover switch) is to provide power for the fraction of a second it takes for the relay contacts to move position, preventing the router from dropping out




Schematic


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, they don't energise at their specified voltage. The relay used in this circuit has a 12V coil but it will pull the contacts at approx 8V and, even worse, only release them when the coil voltage drops to approx 4V. So what actually happens when the mains fails is that the relay will de-energise only when the supply voltage has dropped below 4V which will cause a router designed to work at 12V to drop out and reboot. Conversely, when the router is running from the battery and mains power is restored, the relay will energise at approx 8V which still isn't enough for the router to operate and again it will reboot. So, to address the two prime 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 (or near) 12V, but can also supply power during the contact changeover period




Veroboard layout


The way the circuit works is actually quite simple. The relay is switched by an NPN transistor with its base connected to the 12V supply via a zener diode and current limiting resistor. The transistor will only switch on and power the relay when the supply voltage rises to just under 12V because of the voltage dropped across the 11V zener and the base junction (0.7V). So the relay now pulls and releases nearer to 12V and the router will continue to operate uninterupted during the contact change over period due to the charge stored in the 4700u reservoir capacitor which will also be close to 12V. Note: This capacitor was too large to fit on the board and so had to be mounted externally, connected between the OUTPUT +12V and GND terminals. 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 4700u may not be needed. Not so my TalkTalk router! Across the relay coil was added an LED to show when it's 'ON' and a protection diode to prevent the transistor from being damaged by the back EMF when the magnetic field in the coil collapses


12V IN (adapter)   12V IN (battery)   12V OUT (lamp)   12V OUT (router)




Relay type: MCB-S-212-CH
Relay on its own:
Pulls at 7.5V
Releases at 3.9V
Relay in UPS circuit:
Pulls at 11.7V
Releases at 11.7V
Current consumption:
Relay on its own - 13mA at 12V
Relay with LED - 21mA at 12V
Note: The 2 poles are connected in parallel to share the current



The circuit is constructed in a Hammond/Eddystone diecast enclosure (type 27134PSLA) with four high quality 2.1mm x 5.5mm sockets for the power connections (see diagram above). There are two paralleled outputs because in addition to the router I also wanted to feed a small LED table lamp which is a good thing to have during a power cut! Because this type of socket has the negative terminal connected directly to its body/mounting nut, a common ground system can be used. The veroboard is grounded to the case through one of its two M3 (10mm hex) mounting pillars using an eyelet tag. If the circuit board is mounted so the LED is central, the hole in the lid for it to protrude through will be much easier to drill as it will be right in the middle, though a bit of experimenting will still be required to get the height just right! Overall I'm very impresed with the performance of this circuit which has proved to be reliable and works flawlessly