Projects‎ > ‎Hardware Projects‎ > ‎

Backup System for Cable Modem and Router

It's quite often to happen short term power outages where I live as we don't have nuclear power plants nearby (and I'm not planning to build one anytime soon). All my gadgets and equipments are connected to the main power grid. So whenever the power goes out, I will have to take a break and have a coffee may be, but only if there's mom. I don't make coffee myself. As I don't have a UPS or inverter or a solar system (moment of regret !), I go offline when there's no power. When the power comes back after a while, it'll take some time for my cable modem to re-establish connection and the router to start. Sometimes they don't come back to operable mode at all. I'll have to manually restart the modem or router myself multiple times which is infuriating.

That's why I decided to design and install a battery backup system for the modem and router. I didn't have much time or parts to build a full featured system. So I decided to build a very basic one with minimal features. Below is a block diagram of the system I designed.

Modem Backup System Block Diagram

The charger section consists of a voltage monitor and a timer controlled relay. Whenever the battery voltage drops below a certain preset voltage, the charger starts charging the battery by activating the timer. The timer has a set ON time. For my design it's about 23 minutes. After a charging cycle, the timer stops and thus the relay is turned OFF, regardless of whether the battery has been fully charged or not. But just after the timer stops, the voltage monitor circuit checks the battery voltage again, determining if it's below or above the set level. If it is still below, the timer will be triggered to initiate another charging cycle. This repeats until the battery is fully charged (means the battery voltage is above the set level).

I'm using 6V 5Ah sealed Lead-Acid (Pb-Acid) battery for my application. Specific techniques are to be used for charging Pb-Acid batteries in order to maximize lifespan and performance. But here we have a basic charger circuit which only regards the voltage. It does not monitor the current or control it. So this charger may not be a good option for your application. I designed this as a quick solution and didn't want it to be perfect by every means.

I used LM2596 based DC-DC converters for voltage regulation which I bought as modules from Inkocean. They offer great deal of performance when compared to ordinary linear regulators.

LM2596 DC to DC module

Below is the schematic of the circuit I finally came up with the required features.


The voltage monitor and trigger circuit is designed using a couple of voltage dividers and an LM393 dual comparator. R15 and R16 are used to generate a reference voltage from the constant 5V supply. They'll produce a voltage of 1.5V at the inverting terminal of the comparator. The second voltage divider consists of three fixed value resistors and a precision trimpot of value 1K. They will lover the battery voltage (which is up to 14V) to around the reference value. The trimpot enables us to vary this voltage level and thus let us to set the desired low state voltage. The calculations are straight forward.

Vref  (at negative terminal of comp) = (5V * 4.7 K) / (10K + 4.7K) = 1.599 V

Lower trigger voltage, VLT ( at R5 = 0K) = (1.599V * (2.2K + 14.8K)) / 2.2K = 12.3 V

Upper trigger voltage, VUT (at R5 = 1K) = (1.599V * (2.2K + 15.8K)) / 2.2K = 13.0 V

Therefore we can set the battery voltage level below which charging must start, from 12.3V to 13V.

The timer is nothing but a simple monoshot based around NE555 with an RC time constant of about 23 minutes. The output of the comparator is connected to the active low trigger input of 555 (pin 2) via a capacitor of value 10uF. When the battery voltage is above the set voltage, the comparator output will be +Vcc - offset. Whenever the battery voltage drops below the set level, the comparator output becomes low. This transition from high to low will cause a current flow through the coupling capacitor and will trigger the timer. The timer's output is directed to BD139 power transistor which drives a 12V relay. The relay then connects the input voltage (15-17V) from external SMPS to the battery through a series resistance and a 6A4 diode. Charging will continue as long as the T2 is on. When the timer finishes a cycle, T2 is turned off halting the charging process.

But there's a problem. Whenever the battery voltage drops below a certain level, the output of the comparator changes from high to low initiating a charging cycle. That's okay. But the problem is that the output of the comparator stays low regardless of whatever happens after. The comparator can initiate another charging cycle after comparing the battery voltage only if it's output is high. Because we need a high to low transition to trigger the timer. We don't get this if the comparator's output stays low after triggering the timer for first time. To solve this problem, I added a low value resistor (R6) in series with the battery's positive terminal and the voltage sensing resistor network is connected to the high side of the circuit, ie. to the relay's output. Now whenever a charging cycle starts, the output of the comparator is brought back to high.

The C10 and R20 combination is used to make sure that the timer finishes a timing cycle before we can trigger it again. Otherwise the comparator won't be able to trigger the timer properly at times.


I first tested the circuit on a breadboard and made numerous changes on the fly and the above schematic equates to the final version. After finalizing the circuit I soldered all the components to a perforated matrix PCB. The final board looked like this.

Modem backup system final board

Modem backup system
Modem backup system

The above pictures of the board have two LM2940 low drop regulators. I first used one of them to power my 5V router but later replaced it with an LM2596 DC-DC converter. You may be wondering why that precision potentiometer looks like that. It's becasue none of the potentiometers I had worked properly. Sometimes the slider got stuck that I was not able to vary the resistance. I found the problem after taking one of them apart. The slider didn't move becasue it was touching the outer plastic shell. I got one working after correcting this.


I had to test the board after soldering all the components to make sure it wouldn't fail after prolonged operation. I tested this for a week before installing it in a box permanently. 

Modem backup system

After testing I installed the board and all other modules inside an old PC SMPS box along with a 12V fan. The build is not perfect or modular just as I would do normally, due to the lack of components, connectors etc. May be I should rebuild this in a better way in future.

Modem backup system

With that the project was completed. But I won't recommend this to anyone because it is too basic like I said earlier. If you want to build a similar one, try adding more features. For example current monitoring, current limiting, timing control etc. I could've done this much better if I was using an Arduino Nano or something. But I like analog designing. Solving problems without a microcontroller is a real challenge ;)