I live in a area with frequent power failures lasting up to 5 hours. During this time I would like to power my router so that I can still use the internet with my phone/PC.

I've looked at UPS solutions, but they are quite expensive and not very efficient. I've decided that I want to build my own battery backup solution that uses a 12V 7 AH AGM sealed lead acid battery to directly power the router when the power is off (my router requires 12V DC)

The question is how do I charge the battery while there is mains power and how do I then seamlessly switch to battery power when the mains power fail.

I'll first need a charging circuit. Can I create a simple charging circuit using a regulator such as the LM317 of L200C or should I go for something more advanced such as TI's UC2906? Or what's the recommend way a charging one of those batteries? I assume I'll also need a small transformer and rectifier circuit to power the charging circuit. I would also like to see the battery's remaining capacity and an indicator to show that it is fully charged. Not sure of any of these options will make it easier?

Next, how do I set it up so that the battery goes from charge mode to supply mode when the power goes out? Can I simply connect the battery to the router and that way the charger both charges the battery and powers the router? Then when the power goes off the battery powers the router. Or would I need a switching circuit that senses when the power is off and switches to battery power (through a relay or some other means)?

Lastly, does the output of the battery need to go through a regulator to ensure it is exactly 12V or can I connect it directly to the router?

I've found this product, but I think I can make it my own battery backup for under $30 (plus it's a lot more fun)

  • 2
    \$\begingroup\$ Just a general question.. Are you sure the power outage is not affecting your internet infrastructure? \$\endgroup\$
    – Eugene Sh.
    Commented Apr 7, 2015 at 20:31
  • \$\begingroup\$ My phone still works when the power is off so I assume the internet will still work \$\endgroup\$
    – Kritz
    Commented Apr 7, 2015 at 20:33
  • \$\begingroup\$ @EugeneSh. That's a good question. When power goes out in our area our ISP apparently has 3 hours worth of backup battery because our internet connection invariably goes down 3 hours after the power. So planning for X hours of backup might be excessive if the ISP only stays up for X-N hours. \$\endgroup\$
    – John D
    Commented Apr 7, 2015 at 21:20
  • \$\begingroup\$ What is it you want? \$\endgroup\$
    – EM Fields
    Commented Apr 7, 2015 at 21:55
  • \$\begingroup\$ 12v battery must float at 13.7V. Higher or lower is bad in this application. batteryuniversity.com . Router PROBABLY tolerates somewhat more than 12V in- measure existing supply loaded and O/C. If Vpsu > Vbattery a diode will handle changeover. If not a relay or transistor switch operated by lost mains or psu voltage will. \$\endgroup\$
    – Russell McMahon
    Commented Apr 8, 2015 at 0:02

1 Answer 1


To answer this a bit clearer, when the charging circuit (aka rectifying the mains, power to recharge) goes out. It counts as a "closed circuit". Yes you can add measures and all, problem is, it may drain your resources. Deep cycle batteries can help cause they slowly trickle power, enough to run your router. I am running a little bit of sleep. So no need of special circuitry to switcj from charge to drain. However if that becomes an issue, just have an off on switch on the discharge ONLY. Otherwise it can charge your battery and power your router if assuming the circuit is parallel. Hopefully it makes sense!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.