Introduction: πŸ”‹ How to Make a DIY Wi-Fi Router UPS at Home

About: Hi, I'm Estiak Khan, a B.Sc. engineer in Electrical and Electronic Engineering (EEE), a DIY electronics enthusiast, and a content creator. I specialize in Arduino, PIC microcontrollers, IoT automation, and pow…

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

  1. IRF9540 – P-Channel MOSFET (automatic switching)
  2. LM2596 Buck Converter – Adjustable DC buck (9V/5V output)
  3. XL6009 Boost Converter – (Used only if boosting needed)
  4. DC Socket 12V (Input/Output)
  5. 1N5822 – Schottky diode (low voltage drop)
  6. 220 Β΅F Capacitor (Electrolytic)
  7. 103 Variable Resistor (10k preset for fine control)
  8. 12V Lead-acid / LiFePO4 / Li-ion battery (2S/3S)
  9. Wires, heat shrink, screw terminals, PCB or Vero board

Step 1: ⭐ Features


  1. βœ” 12V, 9V & 5V output for all Wi-Fi routers and ONU devices
  2. βœ” Instant switching (router never restarts)
  3. βœ” Uses IRF9540 MOSFET for automatic changeover
  4. βœ” Uses LM2596 for DC buck conversion
  5. βœ” Uses XL6009 for boost conversion (if needed)
  6. βœ” Uses 1N5822 Schottky diode for low-loss rectification
  7. βœ” Compact, efficient and long backup
  8. βœ” Protects router from burn or voltage drop


Step 2: Safety Precautions


  1. Never short the battery terminals.
  2. Check polarity before powering.
  3. Do not exceed converter voltage limits.
  4. 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:

  1. 12V Output β†’ Direct from battery (optional diode protection)
  2. 9V Output β†’ LM2596 Buck Converter
  3. 5V Output β†’ LM2596 Buck Converter
  4. Boost output (if battery drops below 12V) β†’ XL6009

The 103 preset is used to fine-tune output voltage.

3️⃣ Protection Section

  1. 1N5822 prevents reverse current
  2. 220uF capacitor smooths voltage dips
  3. MOSFET ensures fast switching
  4. 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

  1. LM2596 β†’ trimmed to 9V using 103 preset
  2. LM2596 β†’ trimmed to 5V using 103 preset
  3. Direct 12V output
  4. 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


Source β†’ Adapter 12V
Drain β†’ Output to Routers
Gate β†’ Battery + through resistor
1N5822 β†’ Across MOSFET for reverse current protection

The MOSFET ensures seamless switching.

Step 5.3 β€” Add the Battery Terminal

Use 2-pin screw terminal:

  1. Pin-1 β†’ Battery +
  2. Pin-2 β†’ Battery –

Connect battery negative directly to all module grounds.

Step 5.4 β€” Install the 220Β΅F Capacitor

Place it across:


+12V line β†’ 220uF β†’ GND

This reduces voltage drop during fast switching.

Step 5.5 β€” Add LM2596 Buck Converter (9V Output)

  1. Connect VIN+ to MOSFET output
  2. Connect VIN– to Ground
  3. Adjust output using 103 preset
  4. Set to exactly 9.0V

Label output: 9V OUT

Step 5.6 β€” Add Second LM2596 (5V Output)

Repeat the same:

  1. VIN+ β†’ MOSFET output
  2. VIN– β†’ Ground
  3. Adjust to 5.0V

Label output: 5V OUT

Step 5.7 β€” Optional: Add XL6009 Boost Converter

If you want:

  1. A stable 12V even when battery drops
  2. A long backup

Connect:

  1. XL6009 VIN β†’ Battery/UPS output
  2. 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:

  1. Reverse current
  2. Over-voltage
  3. Sudden spike damage

Step 5.9 β€” Final Output Sockets

Add 3 DC sockets:

  1. 12V OUT
  2. 9V OUT
  3. 5V OUT

All from MOSFET-controlled output.

Step 5.10 β€” Final Wiring Check

Before powering:

  1. Check MOSFET orientation
  2. Check 1N5822 direction
  3. Verify LM2596 outputs using multimeter
  4. Ensure no short circuits


Step 6: πŸ”‹ Testing the Mini UPS


Test 1 β€” Power from Adapter

  1. Router should power from 12V IN
  2. No current drawn from battery

Test 2 β€” Adapter OFF

  1. Router should NOT restart
  2. Battery takes over instantly

Test 3 β€” Measure Output Voltages

  1. 12V β†’ stable
  2. 9V β†’ LM2596 trimmed
  3. 5V β†’ LM2596 trimmed

Test 4 β€” Load Test

Connect:

  1. WiFi router
  2. ONU
  3. IP camera
  4. Switch


Step 7:

πŸ“¦ Step 7: Final Enclosure

Use a plastic box with:

  1. Cooling holes
  2. Battery compartment
  3. Sockets labeled (12V/9V/5V)
  4. 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:

  1. WiFi Router
  2. ONU/ONT
  3. Switch
  4. CCTV
  5. IP Cameras
  6. Small DC devices