book collections email follower instructable user
Picture of DIY Mini UPS for WiFi Router / Modem
IMG_6687 (2).jpg

In my locality, frequent load shading is a very common problem during the summer evening. I am really tired of this problem. I always wanted to have a mini UPS system which can power up my WiFi-Router/Modem for internet purposes and also charge my Smartphone. After some brainstorming and by using my past DIY experience, I have landed to this simple Mini UPS design . The best thing of this UPS is that it uses minimal components and it can easily fit inside my jeans pocket during the traveling.

It is capable of powering either a standard wireless router (that requires 12V DC), a Raspberry Pi/ Arduino, charging a smartphone or any 5V DC-powered device at up to 1A current.

You can visit my website :

My Hackaday Prize 2019 entry

Step 1: Components and Tools Required

Picture of Components  and Tools Required

Components Required :

1. TP4056 Charger ( Amazon / Banggood )

2. Boost Converter ( Amazon / Banggood )

3. USB Boost Converter ( Amazon / Banggood )

4. LEDs ( Amazon / Banggood )

5. DC Jack- Female ( Amazon / Banggood )

6. DC Jack-Male ( Amazon / Banggood )

7. Rocker Switch ( Amazon / Banggood )

8. 18650 Battery ( Banggood )

9. 18650 Battery Holder ( Amazon / Banggood )

10. 24 AWG Wires ( Amazon / Banggood )

11. Heat Shrink Tube ( Amazon / Banggood )

12. PLA Filament-Silver (GearBest)

13. PLA Filament-Red (GearBest)

Tools Used :

1.Soldering Iron ( Amazon )

2. Hot Glue Gun ( Amazon )

3. Wire Cutter ( Amazon )

4. Wire Stripper ( Amazon )

5. PCB Vise ( Amazon )

6. 3D Printer ( Amazon / Banggood )

7. Hot Air Gun ( Amazon / Banggood )

vazquezjm13 days ago
Hi! Congrats on your project. I'm working on something very similar but instead of a router, I want to power up my Raspberry Pi.

What I've done is what you can see in the images attached. I'm using a P-Channel MOSFET to switch from mains to bat. Currently it is not working because of the transistor (I need to find the appropriate part #).

Reading your project description I noticed you do not use that kind of switching, you're powering the DC boost module from TP4056 directly. Would't that affect the way the battery is charged? I'm asking this because the module will be charging the battery while powering the Raspberry (or router in your case).

the concept of the ups is to make the battery always available during power failures. im working also on a similar project for a digital atomic clock which always hooked to outlet which draws 12v 1amp. so a 3s 1p bms setup would be enough. as for charging, the bms protect the batteries from over charging hence cutting the current supplied to the batteries.

So when the battery is charged, the TP4056 won't charge it anymore?
kkbinukk20 days ago
I need 4 hours backup for 12 volt router..please suggest features of battery ( howmuch volt ?? mah??)
Reply plssssss
oyeka3 months ago
Good job there.
Please, I want to power my Laptop for at least 24hours during outages now what modifications do I need?
Remember, Laptops have only AC adapters.
webcamsu oyeka1 month ago
In the ideal case for a battery, it is best to use LiFePO4 cells, like 32700. It's much safer than lithium batteries. 32700 has 3.2V and a capacity of about 6500 mAH. It's can supply a current about 30 A.
Ardutronico oyeka3 months ago
That depends on the power consumption of your laptop. For example, if the laptop battery lasts 8 hours and it's 72 Wh, then you need a 72 * 24/8 = 216 Wh battery (pack), plus losses, say 250-300 Wh. That's quite a big (and expensive) one, but you can buy/make one, with the same voltage as your laptop. You also need to set your boost converter to your laptop's voltage, and you're done.
Nice idea of an easy way to determine Watts of laptop without having to measure Amps. How long does the known quantity battery lasts... I like it.

of course if laptop battery is not fully charged when power goes out, the laptop will consume (significantly?) more than the approximately 8W in your example because we need to power the laptop and charge the battery.

of course in this scenario, the laptop was plugged in all the time, so the battery would be fully charged. But if it’s not... I guess you need to determine how long it takes to fully charge to determine the watts going into the battery while charging and add that to the number you determined for the laptop.
garzo oyeka3 months ago
Laptops don't have AC socket, they have AC-DC "power brick" therefore you'll only need a big DC power bank. You definitely can't use a TP4056 (or several ones), no matter of how much capacity can be provided by your cells (connected in parallel), you'll have no more than 5W (1.2A) at the TP4056 output. At first glance you'll need at least a "big" buck converter and a boost converter, a BMS (with cell balance feature) a couple of mosfets and several cells. That's not something that should be handled by everyone, lithium cells are not a joke.
A buck and boost converter?
Couldn’t you wire them all in parallel and eliminate the BMS/cell balancing?
(just run the whole thing at 3.7V like his design now).

calculate the watts of the laptop. Volts (18?) times the current (which you’ll have to measure because it’s less than what the power brick says it’s capable).
lets say your laptop draws 2A at 18V. That’s 36W.
24 Hours... 864Wh.

as an aside, 36W load on the boost converter backs out to an input of 36W (if life were 100% efficient. Your boost is probably more like 80%)
so we need 36 watts into the boost. That’s at 3.7V (assuming you put all the batteries in parallel to avoid cell balancing issues) . 36W at 3.7V is, of course 10A.
keep that in mind when choosing your wire etc.

a single 18650 cell is usually around 2000mAh I’ve found that any that claim more than 2000 are totally lying and are probably less (much less) than they say.
2000mAh at 3.7V is 7.4Wh Oh, wait. We need 864Wh.

crap. That’s over one hundred 18650 cells!

(some things might be easier if you put them in series/parallel, some things will be harder. But in either case, the Watts and Watt Hours are the same).

Volt - unit of potential
Amp - unit of “flow”
Watt - unit of power (volts times Amps)
Watt hour - unit of energy. ( volts times amp Hours)
Amp hour - is just confusing by itself because without knowing the voltage, it kinda is meaningless.

thats why converting everything to watts makes life easier.
you do t have to carry all the voltages through your calculations.
Buy more batteries for it Buy a generator.
Daijoubu2 months ago
I would use a bi-color LED, common anode, either leave the 10k SMD resistor on the grounds or use a resistor on the positive and wire the 2 cathodes to the TP4056. Ideally this thing should take 12V input and 12V output, a switching charging IC may be better in that case (eg TP5000)
Nice project!

a couple quick comments. The charger may not put out enough juice to charge the battery and power the router. Could be a problem after a power outage. If the battery is really low, it will put out less than 3.7v while it’s charging, slowly going to 4.2v where it should shut off.
the charger probably charges at a constant current until you get to 4v.
problem is, during charging your router is pulling current from the charger and so is the battery. I don’t know what your router draws or how much current the charger can put out.

over discharging a lithium ion cell will ruin it. It looks like your charger may have discharge protection (two + and two - pads) and you wired it correctly. But you should make sure and perhaps mention this issue in your instructable.
or you could use a “protected” 18650. They have a tiny circuit under the false negative contact. It prevents over charging, over discharging, and short circuit/over current protection. The circuit is cool. Pull the wrapper off a dead protected battery. There is a thin strip of metal acting as a wire from the positive pole of the battery, down to the circuit.
the negative metal circle can be pulled off the actual battery minus and reveal the tiny circuitry.

not a bad idea to pay a little extra and get protected cells.

Your switch is in the output which is good.
have you measured how much current flows out of the battery when the thing is just sitting there, not connected to anything?
if it’s significant, you might consider a second switch in the red wire from the battery.
(one of the LEDs is on? The two boost converters are on, even though they’re not connected to anything. It’s called quiescent current. What something draws when it’s not actually doing what it’s supposed to do).

in your stated use, you don’t need it.
but you mention traveling and your pants..
itd be a shame to get where you’re going and have a dead power bank.

if I could teach you how to twist wires together your cable would look nicer.
twisting wires is exactly like how they twist three small “ropes” together to make a larger rope.
trick. Solder one end to the connector. Do not solder the other yet!
twist the wires tightly together. While you do this, the individual wires will want to “spin” the other way - you have to let them in order for it to work. That’s why you didn’t solder the second connector yet.

your case looks like you may get be able to fit a second 18650 (wired in parallel) for double the fun.
An UPS would need a proper load sharing/power path, just need a schottky diode+mosfet to disconnect the cell when power is present/applied.
GTO3x23 months ago
A bit off-topic, but I've been wanting a mini UPS that is enough to sustain 120V/60Hz power (maybe 10 watts) for up to 10 seconds. I keep a VCR in use, and occasional power blips clears the time setting.
Daijoubu GTO3x22 months ago
I would try to open up the VCR to identify the time keeping component and only power that instead, just like radio clocks that keep times using a single coin cell battery for the RTC chip.
Open Green Energy (author)  GTO3x23 months ago
I will try to make one if possible in future.
Thanks for putting this point.
Amazon now carry’s a line of small UPS.
from the comments, they don hold much energy.
but they’d keep the clock going on you VCR (what’s a VCR:)
what’s a vcr without a blinking clock?

i doubt the inexpensive amazon ones I reference could power a 3D printer for very long.
in the comments, people have wildly different opinions of how long a pc will last on each model. Most of them have no clue. They do not know the difference between Volts, Amps, Watts and most importantly Amp Hours and Watt Hours.
(they make strange, but authoritative, estimates based on the VA rating of the device. Which has no relationship to the capacity of the battery). That’s where the Amp Hours (Ah) of the battery are multiplied by the voltage of the battery (probably 3.2V or 12V) to get Watt Hours. Then you determine how many watts you’re drawing (amps to router times volts to router is watts to router - and voila. Watt Hours (available) divided by watts (being consumed)... drumroll... is Hours.
of course the regulators are probably 80% or so efficient so you should derate for that.

(if you’re confused by my math, remember that Amp Hour Ah is not Amps per hour (which would be A/h) it’s more like Amps for hours. 4Ah means you can draw 4A for an hour. Or 1A for four hours etc.)
Yep, that could also be used for 3D printers. Fortunately power outages are rare in my location but if one happens during a long 3D print...
I would think a commercial UPS is justified there - higher power consumption.
frarugi873 months ago
I think you are out-of-spec for both a router battery and, definitely, for a UPS.
The specification for your items are:
- Battery: 3.7V, 4.8A current max
- 12V step up: max 2A
- Lithium battery charger: 1A

If you want to use the 12V output only, the router you have has a 12V 1A input. This means that the current required from the battery is 12V*1A/3.7V = 3.2A. The battery can sustain that, but I'm not sure about the boost (the maximum output current of 2A is probably at very low voltages, not at 3x the input voltage). Probably the 1A current for the router is the absolute maximum one, but some more calculations are needed. For sure you can't charge your mobile while the router is powered...

Regarding the UPS usage, so using it while it is plugged in, the charger output of 1A will never be able to sustain the 3.2A current required. For this reason, you can't use it as a usual UPS.
Agreed. After a power outage that drains the battery (hopefully the device does it’s job and gets you through the blackout), when power comes back the charger will be putting out 1A - probably at a lower voltage than 3.7v. But your boost regulators are drawing more than an amp. Which means... you’re going to continue to discharge the battery.

In fact, starting out with a full battery, it will discharge during use, even if charger is plugged in.

(for me, it’s easier to convert everything to watts, then you don’t have to keep putting voltages into your calculations.).

in this case, you’re charger is putting in 5W.
your router (if it really draws an amp at 12v) is drawing 12W.

As Frarugi87 points out, the math just doesn’t work for using it as UPS.

The router would need to draw less than about 0.25A for the math to work.

it will make a very nice power bank, though.
Usually the given limit for a boost converter is the input, so a 2A DC-DC converter like you said would be able to do 3.7V nominal * 2A * 0.7 (assuming 70% efficiency) / 12V = 0.43A, I would do a 4S configuration (14.8V nom) and use a buck converter with usually higher efficiency. Personally, I have a bunch of power tools batteries with 5S and 5S2P laying around, I'm going to convert an old charger into an UPS instead :) Router/modems nowadays needs 2.5A+ because of higher power ARM SoC, dual band radios and are power hogs.
huyyy12 months ago
wow can't wait to start this project
RakeshK1582 months ago
Rakesh kumar WhatsApp
geofflee3 months ago
Really nice job!
Open Green Energy (author)  geofflee3 months ago
Thank You.
suvatn3 months ago
Very simple project in a very very good explanation, I love it.
Open Green Energy (author)  suvatn3 months ago
Thank You.
eggu3 months ago
Does this also help to filter "not clean" electricity from the wall? So does it all go through the battery or only when the input power is cut out?
excessnet eggu3 months ago
Yes and no.

The device only do DC-DC, so unclean power from the wall will go into the AC/DC power supply BEFORE this device. Since it have been regulated in DC before entering the UPS, it will "clean" the bad wave from the AC...

But, typically, device using DC have the exact same setup as this, but without any battery in case of "lost of power".

When we are talking about UPS "cleaning" noise from AC, it's because those UPS are doing AC to DC, then DC to AC, doing a full sin wave. In this case, there's no return to AC.
oyeka excessnet3 months ago
OK. I want to power my Laptop for at least 24hours during outages now what modifications do I need?
See my post above. I guessed the laptop draws 2A. If I’m wrong, adjust my numbers accordingly.

With my assumed 2A, you need one hundred 18650 cells.
you also need a boost regulator that can handle 10A in and 2A out.

If I was trying to do what you want to do, I’d definitely go with deep cycle car batteries.
I think a large car battery is something like 100Ah. At 12V, that’s 1200Wh.
We “only” need 864Wh, so one large car battery could do the job.
smaller car batteries are more like 40Ah, so you’d need three.

get a battery (sears)
get a trickle charger (harbor freight)
get your boost regulator - which now only has to handle about 3A in (eBay)
some connectors...

a lot lot cheaper and easier than 100 18650’s.
and perhaps safer (100 18650’s multiplies that risk of a LiIon cell doing something nasty by 100).

Or you could just buy a commercial UPS that is rated at 1000Wh.
Hmmm. After some googling to see how expensive that would be, I see that UPS vendors rate them by Watts and/or VA - which is how big a load it can handle.
it gives you no indication of time.
excessnet oyeka3 months ago
You will have to change pretty much everything. A laptop with need about 70 to 120W at 16-20VDC, depending on a model (that's about 4A).

So you will have to change pretty much everything to handle and provide 5A and higher DC voltage at bare minimum. Then, you will have to hook a pretty big battery that will last atleast 20 hours (cause the laptop will last 4 hours on itself I guess?).

It's not an easy project.
raven-19113 months ago
would it not be possible to add a second jack plugged to mains power to charge the mini-ups and when the power goes out the router will stay up for 30 minutes until the battery drops specific voltage cutoff. and will start recharging as soon as the power comes back on.
Open Green Energy (author)  raven-19113 months ago
No need to add a second jack.
You can plug in a 1A Mobile charger to the micro USB port and power it up from the mains.
garzo3 months ago
It's a nice idea with a clean explanation, unluckily the TP4056 can't (or, at least, shouldn't) be used this way.
It's not meant to sustain at the same time battery charge and power output. The issue is the terminating current feedback, which won't be triggered in any case, and this could lend to a li-ion overcharge (with all the potential troubles that we know).
You could use a protected cell, so you don't have to rely on the TP4056 safety circuit, but this isn't optimal because you aren't fully expoiting the TP4056 and the protected cells are more expensive.
Also, the maximum output current on a standard TP4056 is 1.2A, so you'll have a power output in the 3-5W range depending on the battery charge level. It shouldn't withstand the power requirements of the router or a fast charging phone, especially if you consider also the DC-DC converter efficiency.
In the end it "could" work, i can consider this solution for something not critical in the garden, but i wouldn't use it in my house in case flammable materials are near.

Ardutronico garzo3 months ago
Yep, to fix that you can add a microUSB socket (you can buy microUSB to pin header adapters), and wire it to the TP4056 and the boost converter in parallel.
garzo Ardutronico3 months ago
Assuming that you're using a TP4056 with the DW01A safety chip onboard, how does this react to 5V applied at its output? Shouldn't it assumes that's the cell is overvolted and blocks any charge attempt?
Open Green Energy (author)  garzo3 months ago
thank you so much for reading my Instructables.
I really appreciate your valuable suggestion and safety alert.
1-40 of 60Next »