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.
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).
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.
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.
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 because 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 because 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.
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.
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.