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 cut (conveniently my router runs on 12V). I experimented with MOSFET and bipolar transistors as switches but in the end decided to use a relay because the main and backup power supplies will always be isolated from each other by the air gap between the contacts. The relay chosen has a very low current consumption coil that draws less than 15mA at 12V when energised and so hardly adds any extra load to the router's mains adapter. But the problem with using a relay is that it takes time for the contacts 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, a brief power interuption would cause it to quickly turn off and on again taking your network down for several minutes while it reboots. With this circuit that isn't the case
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 you might think, which can be used to our advantage. We don't get away with it that easily though because another problem with relays is that they don't energise at their design voltage. The relay used has a 12V coil but it will pull the contacts at approx 8V and even worse, only release it when the coil voltage drops to approx 4V. 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 which will now be closed because 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 at approx 8V which still isn't enough for the router to operate, and again it will reboot. So we need a circuit to make the relay operate at (or near) 12V
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 just under 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 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 +12V OUT terminal to ground. 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 when the field in the coil collapses. Overall I'm 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 it still worked flawlessly. In fact the output is split 2 ways so it can also run an emergency light!
The circuit is constructed in a Hammond/Eddystone diecast enclosure (type 27134PSLA) using high quality 2.1mm x 5.5mm sockets for the inputs and outputs. 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 mounting pillars using an eylet tag. If the circuit board is mounted with the LED central, the hole in the lid for it to protrude through will be so much easier to drill as it will be right in the middle! A bit of experimenting may be required with the length of its legs to get the height just right