Power cuts are a fact of life#

If you run a homelab in India, power interruptions aren’t a question of if — they’re a question of when. Gurgaon gets frequent short outages (a few seconds to a few minutes to a few hours), plus occasional longer cuts during storms or maintenance windows.

My goal was simple: keep the homelab and network running through every outage, no matter how brief. Servers should never see a power blip. The gaming PC gets its own dedicated protection because it draws too much for the main inverter.

The power flow#

Here’s how everything is wired:

                                  ┌──────────────────────────────────────────────────────────┐
                                  │                        Home                              │
                                  │                                                          │
                                  │                 ┌──── APC UPS ──────┐                    │
                                  │                 │  • Raspberry Pi   │                    │
                ┌─────────────┐   │                 │  • WD 4TB HDD     │                    │
Main Power ────►│  Microtek    │──►│  Mains ────────►│  • Lenovo PC      │                    │
                │  UPS/Inverter│   │  Outlets        │  • Router         │                    │
                │  800VA       │   │                 │  • Switch         │                    │
                │              │   │                 └───────────────────┘                    │
                │              │   │                                                          │
                │              │   │                 ┌───────────────────┐                    │
                │              │   │  Mains ────────►│  Main Router      │                    │
                └──────────────┘   │                 └───────────────────┘                    │
                                  │                                                          │
                                  └──────────────────────────────────────────────────────────┘
                                  
                ┌─────────────┐   ┌───────────────────┐
Main Power ────►│  Microtek    │──►│  Gaming PC        │
                │  Legend      │   │                   │
                │  1000VA UPS  │   └───────────────────┘
                └─────────────┘

Two separate UPS units, two separate protection zones. Let me break down why.

Layer 1 — Microtek UPS/Inverter 800VA (whole-home)#

The first layer is a Microtek 800VA UPS/Inverter that sits between the main power supply and my home’s electrical circuit. This is a home inverter — it conditions the incoming power and switches to battery during an outage.

What it protects: Everything on the home circuit — lights, fans, fridge, and the outlets that feed my homelab and networking gear. The 800VA capacity is sized to handle both the household appliances and the homelab load together.

What it does well:

  • Voltage regulation — stabilises the output even when mains voltage dips or surges
  • Extended backup — with an external battery, it can sustain the home circuit for 30+ minutes during longer outages
  • Handles household loads — fridge, fans, lights all stay on during outages

The catch: Home inverters like the Microtek have a high switchover time (~10–20ms). Appliances like fans, lights, and the fridge don’t care — they ride through the brief gap without any issue. But sensitive electronics like the Lenovo ThinkCentre and other PCs will reboot during that switchover. This is exactly why I needed the next layer.

Layer 2 — APC UPS (critical homelab devices)#

The inverter keeps the house running, but its slow switchover time is a dealbreaker for PCs and servers. That’s where the APC UPS comes in — it sits between the inverter output and my critical homelab devices, providing the near-zero transfer time (~2–4ms) that sensitive electronics need.

What it protects:

DeviceWhy it’s critical
Raspberry Pi 4BRuns DNS (Pi-hole), monitoring, and lightweight services
WD 4TB HDDStores all media and NVR recordings — abrupt power loss risks data corruption
Lenovo ThinkCentreMain server — runs Proxmox, Frigate, Jellyfin, and a dozen containers
Router (TP-Link)Keeps the network alive for all devices
Switch (TP-Link SG108E)VLAN trunk — connects everything together

Why the APC UPS is essential (not optional):

  1. Fast switchover — the primary reason. The inverter’s ~10–20ms transfer time causes PCs to reboot. The APC’s ~2–4ms transfer time is fast enough that devices don’t even notice the power blip
  2. Double battery backup — when the inverter is on battery, the APC is fed by it. If the inverter battery dies, the APC catches the drop on its own battery — buying extra time for a graceful shutdown
  3. Surge protection — the APC provides additional surge filtering, protecting sensitive hardware from spikes that might get through the inverter

The main router is plugged directly into the inverter (not behind the APC UPS) because it can handle the slower switchover without rebooting, and I wanted to keep the APC’s capacity reserved for the more sensitive gear.

Layer 3 — Microtek Legend 1000VA UPS (gaming PC)#

The gaming PC gets its own dedicated Microtek Legend 1000VA UPS. This is connected directly to the main power, bypassing the home inverter entirely.

Why a separate UPS?

  • The gaming PC can draw 300–450W under load — that would eat up the 800VA inverter’s capacity and starve the rest of the house
  • Gaming sessions can’t tolerate any power interruption — even a brief flicker kills an online match or corrupts a save
  • The 1000VA capacity gives enough headroom for the PC’s peak draw plus a monitor

This UPS is only active when the gaming PC is on, so it doesn’t waste battery cycles during idle periods.

How it works in practice#

Here’s what happens during a typical power cut:

Short outage (< 5 seconds):

  1. Mains drops → Microtek 800VA inverter switches to battery instantly
  2. Home circuit stays live — homelab devices don’t even notice
  3. APC UPS stays on mains (fed by the inverter) — no battery drain
  4. Power returns → inverter switches back, batteries start recharging
  5. Net effect on homelab: zero disruption

Medium outage (5–30 minutes):

  1. Same as above, but the inverter runs on battery for the duration
  2. At ~71W homelab load, the inverter battery can sustain this easily
  3. APC UPS remains on standby — only kicks in if the inverter gives out
  4. Net effect on homelab: zero disruption

Long outage (30+ minutes):

  1. An ESP32 board monitors the power state and triggers an automated graceful shutdown of all homelab devices
  2. When mains power is restored, the same ESP32 automation brings everything back up automatically
  3. Net effect: fully automated graceful shutdown and recovery — no manual intervention needed

The ESP32 automation#

I didn’t want to rely on being awake (or even home) to handle long outages. So I built a small automation using an ESP32 microcontroller that monitors the power situation and handles shutdown/startup automatically.

How it works:

  • The ESP32 monitors whether mains power is available
  • When it detects a prolonged outage (inverter battery getting low), it sends shutdown commands to the homelab devices over the network
  • Services are stopped gracefully — docker compose down on the ThinkCentre, clean shutdown on the Pi
  • When mains power is restored, the same ESP32 automation brings everything back up automatically
  • Everything comes back up in the correct order — network gear first, then servers, then services

This means even if I’m away or asleep during a 2 AM power cut, the homelab shuts down cleanly and boots back up on its own when power returns. No data corruption, no manual intervention, no 3 AM SSH sessions.

What about the gaming PC?#

The gaming PC’s dedicated 1000VA UPS handles outages independently:

  • Short outages: seamless, I keep gaming
  • Medium outages: the UPS buys me enough time to save and quit
  • Long outages: no point gaming without internet anyway — I shut down

Cost of this setup#

EquipmentApproximate cost
Microtek 800VA UPS/Inverter~₹5,000
APC UPS (600VA)~₹3,500
Microtek Legend 1000VA UPS~₹5,500
Total~₹14,000

₹14,000 for complete power protection. Considering that a single hard drive failure from a power spike could cost more than that to replace (plus the data loss), it’s a no-brainer.

Lessons learned#

  1. Layer your protection — a single UPS is a single point of failure. Two layers means you always have a fallback.

  2. Separate high-draw devices — don’t put your gaming PC on the same UPS as your servers. Their power profiles are completely different.

  3. Size your UPS for the load — my 800VA inverter running a 71W load means it’s at ~9% capacity. This gives maximum battery life and keeps the unit cool and quiet.

  4. Monitor your UPS — know when batteries are degrading. A UPS with a dead battery is just a fancy power strip.

  5. Plan for graceful shutdown — always have a procedure for clean shutdowns. Data corruption from abrupt power loss is far worse than a few minutes of downtime.

Bottom line#

Power interruptions don’t have to mean downtime. With a layered approach — an inverter for the house, a UPS for critical servers, and a separate UPS for the gaming rig — my homelab has survived hundreds of power cuts without a single unplanned reboot or data loss incident.

The total cost is less than what most people spend on a single gaming peripheral. If you’re running a homelab in India (or anywhere with unreliable power), invest in proper power protection. Your data will thank you.


See also: Power Consumption & Cost · Hardware overview