Introduction: π How to Make a DIY Wi-Fi Router UPS at Home
If your Wi-Fi router disconnects every time the electricity goes out, this project will solve it permanently. In this tutorial, youβll learn how to build a DIY Wi-Fi Router UPS at home using easily available components. It provides three different outputs: 12V, 9V, and 5V, so it works with Wi-Fi Routers, ONU, ONT, Modems, Switches, CCTV, and other DC devices.
This powerful mini-UPS works from a 12V battery and instantly switches power when the main supply fails β without restarting the router.
Supplies
Step 1: Components Required
Main Components
- IRF9540 β P-Channel MOSFET (automatic switching)
- LM2596 Buck Converter β Adjustable DC buck (9V/5V output)
- XL6009 Boost Converter β (Used only if boosting needed)
- DC Socket 12V (Input/Output)
- 1N5822 β Schottky diode (low voltage drop)
- 220 Β΅F Capacitor (Electrolytic)
- 103 Variable Resistor (10k preset for fine control)
- 12V Lead-acid / LiFePO4 / Li-ion battery (2S/3S)
- Wires, heat shrink, screw terminals, PCB or Vero board
Step 1: β Features
- β 12V, 9V & 5V output for all Wi-Fi routers and ONU devices
- β Instant switching (router never restarts)
- β Uses IRF9540 MOSFET for automatic changeover
- β Uses LM2596 for DC buck conversion
- β Uses XL6009 for boost conversion (if needed)
- β Uses 1N5822 Schottky diode for low-loss rectification
- β Compact, efficient and long backup
- β Protects router from burn or voltage drop
Step 2: Safety Precautions
- Never short the battery terminals.
- Check polarity before powering.
- Do not exceed converter voltage limits.
- Use proper heat dissipation for buck converters.
Step 3: π§ How the Wi-Fi UPS Works
1οΈβ£ Automatic Switch-Over Section (IRF9540)
The IRF9540 P-MOSFET works as an ideal diode.
When the main 12V adapter is present β router gets power from adapter.
When the main power fails β MOSFET instantly connects the battery output.
β No delay
β No relay click
β No router restart
2οΈβ£ Voltage Regulation Section (LM2596 / XL6009)
For OUTPUTS:
- 12V Output β Direct from battery (optional diode protection)
- 9V Output β LM2596 Buck Converter
- 5V Output β LM2596 Buck Converter
- Boost output (if battery drops below 12V) β XL6009
The 103 preset is used to fine-tune output voltage.
3οΈβ£ Protection Section
- 1N5822 prevents reverse current
- 220uF capacitor smooths voltage dips
- MOSFET ensures fast switching
- DC socket ensures polarity safety
Step 4: π§ Circuit Explanation
12V Adapter β IRF9540 MOSFET β Outputs
If adapter fails:
Battery β IRF9540 β Outputs
Charging Section (Optional)
If you add a battery charging module (TP5100, 2S BMS), it provides auto-charging.
Voltage Outputs
- LM2596 β trimmed to 9V using 103 preset
- LM2596 β trimmed to 5V using 103 preset
- Direct 12V output
- Optional XL6009 for boosting from 8β12V to stable 12V
Step 5: π οΈ Building the UPS (Step-by-Step)
Discover Easy, Affordable, and Reliable PCB manufacturing with JLCPCB!Register to get $70 New customer coupons:https://jlcpcb.com/?from=EST
Special Deal: Get a $30 coupon for JLCPCB premium 6-layer PCBs: https://jlcpcb.com/6-layer-pcb?from=getcoupon
Step 5.1 β Install the DC Input Socket
This is your Main 12V Adapter Input.
Label it: 12V IN.
Step 5.2 β Connect the IRF9540 MOSFET
The MOSFET ensures seamless switching.
Step 5.3 β Add the Battery Terminal
Use 2-pin screw terminal:
- Pin-1 β Battery +
- Pin-2 β Battery β
Connect battery negative directly to all module grounds.
Step 5.4 β Install the 220Β΅F Capacitor
Place it across:
This reduces voltage drop during fast switching.
Step 5.5 β Add LM2596 Buck Converter (9V Output)
- Connect VIN+ to MOSFET output
- Connect VINβ to Ground
- Adjust output using 103 preset
- Set to exactly 9.0V
Label output: 9V OUT
Step 5.6 β Add Second LM2596 (5V Output)
Repeat the same:
- VIN+ β MOSFET output
- VINβ β Ground
- Adjust to 5.0V
Label output: 5V OUT
Step 5.7 β Optional: Add XL6009 Boost Converter
If you want:
- A stable 12V even when battery drops
- A long backup
Connect:
- XL6009 VIN β Battery/UPS output
- Adjust output to 12V fixed
Step 5.8 β Add 1N5822 Schottky Diode
Connect in series with battery or DC adapter depending on your design.
This prevents:
- Reverse current
- Over-voltage
- Sudden spike damage
Step 5.9 β Final Output Sockets
Add 3 DC sockets:
- 12V OUT
- 9V OUT
- 5V OUT
All from MOSFET-controlled output.
Step 5.10 β Final Wiring Check
Before powering:
- Check MOSFET orientation
- Check 1N5822 direction
- Verify LM2596 outputs using multimeter
- Ensure no short circuits
Step 6: π Testing the Mini UPS
Test 1 β Power from Adapter
- Router should power from 12V IN
- No current drawn from battery
Test 2 β Adapter OFF
- Router should NOT restart
- Battery takes over instantly
Test 3 β Measure Output Voltages
- 12V β stable
- 9V β LM2596 trimmed
- 5V β LM2596 trimmed
Test 4 β Load Test
Connect:
- WiFi router
- ONU
- IP camera
- Switch
Step 7:
π¦ Step 7: Final Enclosure
Use a plastic box with:
- Cooling holes
- Battery compartment
- Sockets labeled (12V/9V/5V)
- LED indicator (optional)
Step 8: Video Reference
Discover Easy, Affordable, and Reliable PCB manufacturing with JLCPCB!Register to get $70 New customer coupons:https://jlcpcb.com/?from=EST
Special Deal: Get a $30 coupon for JLCPCB premium 6-layer PCBs: https://jlcpcb.com/6-layer-pcb?from=getcoupon
Step 9: π Conclusion
You have successfully built a DIY Wi-Fi Router UPS that provides:
β 12V Output
β 9V Output
β 5V Output
β Instant switching (zero downtime)
β Long battery backup
β Router safe from fluctuations
β Reliable operation using IRF9540 + LM2596 + XL6009
This UPS can power:
- WiFi Router
- ONU/ONT
- Switch
- CCTV
- IP Cameras
- Small DC devices





