Home
Relay Switched Router UPS





This simple Uninterruptable Power Supply (UPS) was built as an addition to my 12 volt solar powered backup system to give continued internet access in the event of a mains power cut (conveniently my router runs on 12V). I experimented with MOSFETs and bipolar transistors as switches but in the end settled on a good old fashioned relay. The relay chosen has a low current consumption coil that only draws about 30mA when energised and so does not add too much extra load to the router's mains adapter. The problem with using a relay is that it takes time for the contact to move (or change over as is the case here) from one position to another, albeit 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, you would think that a brief power interuption would cause it to quickly turn off and on again taking your network down for several minutes while it reboots. As it happens this isn't the case




The schematic


While experimenting, I found that my router (a standard D-Link supplied by TalkTalk) will carry on working without power for a short period of time because of the remaining charge left in its internal reservoir capacitors. When the power plug is disconnected, the front panel LEDs look as though they go out instantly, but in fact the stored energy lasts longer than the switching time of the relay, which we can use to our advantage. We don't get away with it that easily though, as the main problem with relays is that they don't energise at their design voltage and this is the issue that really needs addressing. The relay used has a 12V coil but it will pull the contact at approx 8V and even worse, only release it when the coil voltage drops to approx 4V, and so this has to be overcome. Under normal operating conditions the relay is energised and will supply 12V to the router from the router's own mains adapter via the normally open contact. This same voltage is also used to power the relay. If there is a mains power cut the relay will de-energise, the contact will return to the closed (resting) position, and the router will now be supplied from the 12V backup battery. If the relay actually switched over at 12V then this would be fine, but as mentioned earlier, it doesn't. What actually happens is, if there is a mains power cut the relay will de-energise only when the supply voltage has dropped below 4V, whether this 4V is the remaining charge left in the router or the mains adapter. The router definately won't run at 4V and so will reboot. Conversely, when the router is running from the battery and mains power is restored, the relay will energise before the supply reaches 12V, and again the relay will reboot. So we need a circuit to make the relay operate at (or near to) 12V




The veroboard layout


After all that preamble, 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 10V zener and current limiting resistor. The transistor will only switch on and power the relay when the supply voltage rises to approx 11V due to the voltage dropped across the 10V zener and the base junction. So the relay now 'pulls' and 'releases' nearer to 12V and the router will continue to operate uninterupted (due to the energy stored in its internal capacitors) while the contacts change over. There may of course be routers out there that don't have big enough reservoir capacitors to ride the storm during the changeover period, but this can be remeded by adding a 2200uf 25V capacitor from the relay contact to ground (+12V OUT). Across the relay coil there 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 produced when the field in the coil collapses. Overall I've been very impresed with the performance of this circuit and not once has the router dropped out while I've been disconnecting and reconnecting the supply. I even added some extra load in the form of a light bulb across the router to try to discharge its capacitors sooner, but still it worked flawlessly