DIY Mini UPS for WiFi Router / Modem




Introduction: DIY Mini UPS for WiFi Router / Modem

About: I am a DIY hobbyist by passion and a Power Engineer by profession. Most of my works are related to Solar Energy and Arduino.

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 that 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 about this UPS is that it uses minimal components and it can easily fit inside my jeans pocket during 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.

Support me On Patreon:

If you enjoy my work here on Instructables, consider joining my Patreon, it will be a great help for me to make more interesting projects in the future.

Patreon Link:

Update on 13.10.2020

Check out my UPS V2.0.

You can visit my website :

My Hackaday Prize 2019 entry

Step 1: 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 )

Step 2: How the Circuit Work?

The working of the circuit is very simple, in normal condition, power from the mains is drawn by a USB charger to charge the 18650 battery and to provide power to the router. When the mains power fails, the stored energy in the battery is used to power up the router.

In the schematic diagram, the 18650 battery is connected to a TP4056 charging module. The output of the TP4056 module is connected to the two boost converter modules: one to power the Router (12V) and another to USB Socket (5V) for smartphone charging. The output voltage of the boost converter (SX1308 module ) can be set by twisting the trimpot on the PCB board. In my case, I have set it to 12V. If your router is running at 9V, then set it to 9V. The output from the boost converter (SX1308) is connected to the external 5.5mm DC jack via an SPST switch.


Please note that you are working on Li Ion battery which is potentially very hazardous. I cannot be held responsible for any loss of property, damage, or loss of life if it comes to that. This tutorial is written for those who have ample knowledge on rechargeable lithium ion technology.Please do not attempt this if you are novice. Stay Safe.

Step 3: Selecting the Battery

First, check the specs of your router/modem, you can get all the information on the specification sticker.

My router input power is 12V and 0.5 A. So, the power requirement for the router is 12 x 0.5 = 6W

I was considered a backup time for 30 minutes. So Watt Hour Required is = 6 x 0.5 = 3Wh

The 18650 Battery nominal voltage is 3.7V

Required Capacity = 3 Wh / 3.7V = 0.810Ah = 810mAh

The same battery also used for charging my smartphone. Let I need to charge my phone up to 35-40% for emergency use only. My Smartphone (One Plus 6) battery is rated for 3300mAh.

The final capacity required is = 810 + 3300 x0.4 = 2130 mAh

By taking the losses in the converter into consideration, I have chosen a 3400mAh Panasonic battery for this mini UPS.

Step 4: Remove the Onboard Status LEDs

The charging status of the 18650 battery is indicated by two LEDs on the TP4056 module. My objective is that the led should be visible to the outside of the enclosure. So I desoldered the onboard LEDs and soldered two 5mm LEDs ( Red and Green ).

Take fine tip soldering iron, and carefully remove the LEDs from the board by taking the help of tweezers.

I have highlighted it in the pictures shown above.

Note: Be careful during the desoldering, otherwise you will damage the soldering pads on the PCB.

Step 5: Solder the Charging Status LEDs

I used 5mm red and green LEDs to indicate the charging status of the battery.

First I trim the legs of the LEDs as shown in the figure. The longer leg designated as the positive terminal.

Then solder 24AWG hookup wires to the LED legs. For solid connection and protection to the soldering joint, apply heat shrink tube on it.

At last, solder the LED terminal wires to the soldering pads of the onboard LEDs on the TP4056 module. The pads which are towards the TP4056 chip is negative terminals.

Step 6: Connect the 18650 Battery Holder

First, apply a small amount of solder to the B+ and B- soldering pads on the TP4056 module.

Then solder the red wire of the battery holder to the B+ and black wire to the B- terminal of the TP4056 module.

Step 7: Connect the Boost Converters

Similar to the previous step, apply a small amount of solder to the Out+ and Out- terminal of TP4056 module.

Then solder the wire from the Boost converters to the TP4056 Module as shown in the schematic.

SX1308 Module:

VIN+ connects to Out+

GND connects to Out-

USB Boost Converter:

VIN+ connects to Out+

VIN- connects to Out-

You can see the above image for better understanding.

Step 8: Prepare the DC Jack and Switch

Solder wires to the terminal of the SPST switch and DC Jack.

The smaller leg of the DC jack is the positive terminal.

At this stage don't connect the DC jack and switch to the Boost Converter module, it will be done after installing them into the 3D printed enclosure.

Step 9: Prepare the DC Output Jack

Now you have to prepare the adapter to connect the UPS output to the router input. First check the specification of your router to confirm the size of the jack ( Sleeve size ) and the tip polarity. Your router will have a small diagram indicating the polarity expected by it; care should be taken to adhere to this, as an improper power supply may damage the device.

In my case the size of the jack is 5.5mm and the tip polarity is positive. According to the size, order two male DC Jack. Then solder red wire to the tip (smaller one ) and black wire to the sleeve.


Step 10: 3D Printed Enclosure

To give a nice commercial product look, I designed an enclosure for this project. I used Autodesk Fusion 360 to design the enclosure.

The enclosure has two parts:

1. Main Body

2. Cover Lid

The Main Body is basically designed to fit all the components including battery. The Cover lid is to cover up the main body opening.

I used my Creality CR-10S printer and 1.75 mm Grey and Red PLA filaments to print the parts. It took me about 5 hours to print the main body and around 1 hour to print the top lid.

My settings are:

Print Speed: 60 mm/s

Layer Height: 0.2mm ( 0.3 also works well)

Fill Density: 25%

Extruder Temperature: 200 deg C

Bed Temp: 60 deg C

Download the STL files from Thingiverse

Step 11: Installing the Components

Insert the components ( TP4056, Boost Converters, LEDs, Rocker Switch, and DC Jack) on the Main Body slots as shown in the picture.

At last, insert the 18650 battery inside the battery holder. Make sure you have to insert with the right polarity. The polarity is marked in the battery holder.

Finally, place the top lid and secure the 4 screws at the corners.

Step 12: Testing and Conclusion

Plug in the UPS to standard micro USB mobile charger (5v/1A). During the charging process, the red LED will be ON and when the charge finished it will be turned off and the green LED will be switched ON.

Now connect the Mini-UPS the to router by using the adapter cable prepared in the earlier step. The router LEDs should lit up.

To test the USB port, I plugged in my smartphone, and checked the charging process by using Ampere app.

Thanks for reading my Instructable.
If you like my project, don't forget to share it. Comments and feedback are always welcome.

This project is entered in to Pocket-Sized Contest, please vote for me.

Pocket Sized Contest

Runner Up in the
Pocket Sized Contest

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Make it Glow Contest

      Make it Glow Contest
    • Organization Challenge

      Organization Challenge



    6 months ago

    Hey! This is really a good project, I'm looking forward to make this for my 5V 1A rated router. My question is, is that UPS online or offline type? Does it continously charge the battery and router at the same time or switches between battery and UPS mode automatically when there's a power cut? Please reply.


    11 months ago

    This is very helpful. I have made my own mini power backup using your idea but change it little by using 3s bms and step-down converter. Thanks. Keep it up.


    Question 1 year ago

    Seems a good project, however have I missed something. Do you just power the router from the battery or do you also connect the normal charger into the charging port as well keeping the battery fully charged until power fails?


    1 year ago

    Salut poti sami zici si mie cum se face o chestie desta prin mesaje


    Question 2 years ago

    Hi, thanks for the project, it looks awesome, my router needs 1.5a at 12v do any of these modules need to change? would this have enough juice to do that? what are the part numbers of the new modules i'd need please?


    Answer 2 years ago

    I am making a new version for handling higher power requirement.
    I will post it in this week.


    2 years ago

    I tried to power power my router using the boost module and using 1 18650 battery but it wont work. it will turn on but not initialize the internet(not enough blinking leds)


    3 years ago

    Great! I am working on roughly the same project. My modem and router uses about 1.2 Amp.
    My main concern is when you use a Lithium battery, voltage drops, so eventually you will not be able to provide a steady 12 volts. What will happen to my router and modem when voltage drop under 12 volts. Can it damage them ? Should I install some kind of device to cut-off power under 12 volts ? thanks


    Reply 2 years ago

    Sir I need your help I made 12v ups for my router but my router can't run properly ,it showed power light but starts blinking .without connecting ups ,connects with the Adapter it's stable and run properly
    My router specifications are
    Huawei 12v 1A


    Reply 2 years ago

    I also have the same problem, I have Huawei 12V 2A router.
    Let me know if you are able to fix this issue


    Tip 3 years 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)


    Reply 2 years ago

    agreed and 2 anode wires are inutile, TP4056 got a comman anode supply for the 2 smd led, so only 1 common anode was anough. and of course as the said bi-color led are the best. but when buying/ ordering, the type with comman anode should be selected!


    2 years ago on Step 5

    Great and very usefull device!
    You could use only 1 positive wire for the leds, seens the TP4056 have a common anode for the leds indicator (charging and Charge full). so then 2 negative wires...
    I do it all the time, and it works fine ;)


    3 years ago

    will the kit ever be instock again? 300 beans is a fine price... thanks..


    3 years 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).



    Reply 3 years ago

    Vaz, you are right. It is not good to discharge the battery when the input power is available. There are special ICs/modules that can charge AND power an output using the input. For a ready to use solution see Adafruit PowerBoost 1000 module or make your own by using a MCP73871 chip/module. The feature of the charger is called "load-sharing".


    Reply 3 years ago

    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.


    Reply 3 years ago

    So when the battery is charged, the TP4056 won't charge it anymore?


    Reply 3 years ago

    it supposed to but my build drains the battery overnight while still plugged to a wall charger. it lights red so it means its still charging. if i add a diode from a charger line right before the battery and the load the charger doesn't recognize the current voltage of the batteries thus the charger lights a green light which means full.

    but mine is a 3s setup. my tv is only pulling 0.3amps while on standby. so overnight it wasnt supposed to drain my batt while plugged to a power source which has a float voltage of 12.6v. anyway this thread just give me an idea and applied it to my 12v setup


    Question 3 years 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.