Close
0%
0%

DIY UPS for Home Assistant Green & Xfinity XB7 Mod

DIY 12V LiFePO4 UPS for Home Assistant Green and Xfinity XB7 modem. Victron BP-65 LVD, MOSFET ideal diode, 13.3V float, Shelly Plus Uni

Similar projects worth following
0 followers
System Overview
AC grid powers a Mean Well LRS-100-12 PSU set to 13.3V float, which charges a 12V 10Ah LiFePO4 battery through a MOSFET ideal diode. On grid failure, loads switch directly to battery in under 1ms. A Victron BatteryProtect BP-65 disconnects loads at 11.8V to prevent over-discharge. A Shelly Plus Uni reports battery voltage and temperature to Home Assistant.

DIY UPS for Home Assistant Green & Xfinity XB7 Modem


A 12V LiFePO4-based uninterruptible power supply for keeping a Home Assistant Green and Xfinity XB7 cable modem running during grid outages. Built into an IP65 enclosure with Home Assistant monitoring via Shelly Plus Uni.

Honest context: A $75 APC BE600M1 would do the same job out of the box. This build costs roughly $200 more over 10 years than that option. The engineering rationale — longer battery life, faster switchover, direct HA integration, no DC-DC converter voltage regulation — is documented in https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/design-rationale.md. Build this if those tradeoffs matter to you.

System Overview


AC grid powers a Mean Well LRS-100-12 PSU set to 13.3V float, which charges a 12V 10Ah LiFePO4 battery through a MOSFET ideal diode. On grid failure, loads switch directly to battery in under 1ms. A Victron BatteryProtect BP-65 disconnects loads at 11.8V to prevent over-discharge. A Shelly Plus Uni reports battery voltage and temperature to Home Assistant.

AC Power (Wall)
                 ↓
┌────────────────────────────────────┐
│  Mean Well LRS-100-12 PSU          │
│  Input: 85-264VAC  Out: 13.3V      │
└────────────────┬───────────────────┘
                 │ 13.3V (float)
                 ↓
┌────────────────────────────────────┐
│  Pololu Ideal Diode (4-60V, 10A)   │
│  Prevents PSU backfeed from batt.  │
└────────────────┬───────────────────┘
                 │
                 ↓
┌────────────────────────────────────┐
│  Cyclenbatt 12V 10Ah LiFePO4       │
│  Built-in 10A BMS, 5000+ cycles    │
└────────────────┬───────────────────┘
                 │
                 ↓
┌────────────────────────────────────┐
│  Victron BatteryProtect BP-65      │
│  LVD: 11.8V (Setting 7)            │
│  Reconnect: 12.8V, 90s delay       │
└────────────────┬───────────────────┘
                 │ 11.71–13.16V at device terminals
            ┌────┴─────┐
         [F3:2A]    [F4:5A]
            │          │
         HA Green   XB7 Modem
           (3W)      (~14W)

┌────────────────────────────────────┐
│  Shelly Plus Uni (Monitoring)      │
│  ADC → Battery Voltage             │
│  GPIO → DS18B20 Temperature        │
│  WiFi → Home Assistant             │
└────────────────────────────────────┘

Key Specifications


ParameterValue
BatteryCyclenbatt 12V 10Ah LiFePO4
Float voltage13.3V (set on PSU trimmer)
LVD cutoff11.8V (Victron BP-65, Setting 7)
LVD reconnect12.8V (30s delay after threshold met)
Device voltage envelope11.71–13.16V at terminals
Switchover time<1ms (MOSFET ideal diode)
Typical load~17–18W combined
Runtime at typical load~6.3 hours
EnclosureLeMotech IP65 ABS, 9.6″×7.6″×4.5″
MonitoringShelly Plus Uni → Home Assistant
Total build cost~$234

Operating Modes


Mode 1 — AC Present: PSU outputs 13.3V through ideal diode; battery held at float equilibrium. Loads draw from PSU, not battery.

Mode 2 — AC Failure: PSU output drops to 0V. Ideal diode blocks. Battery feeds loads directly, no interruption.

Mode 3 — Low Battery (~12.2V): Shelly detects threshold via ADC. Home Assistant initiates graceful HA Green shutdown; modem continues on battery.

Mode 4 — LVD Cutoff (11.8V): Victron BP-65 disconnects loads after 90-second hold-off.

Mode 5 — AC Restoration: PSU resumes 13.3V, ideal diode switches source, BP-65 reconnects after 30s hold-off.

Assembly Layout


Component Layout

Elevation (top) and plan (bottom) views of LeMotech junction box. Dimensions in inches.

Documentation


FileContents
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/bom.mdFull bill of materials with vendor, price, and notes
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/wiring.mdFrom/To wiring tables, fuse locations, component mounting
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/specifications.mdElectrical, performance, and protection spec tables
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/design-rationale.mdBuild-vs-buy analysis, float charging strategy
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/component-selection.mdPer-component selection rationale
https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/docs/cost-analysis.md...
Read more »

  • 1 × Mean Well LRS-100-12 PSU
  • 1 × Cyclenbatt 12V 10Ah LiFePO4 Battery
  • 1 × Victron BatteryProtect BP-65 12/24V
  • 1 × Pololu Ideal Diode 4-60V 10A
  • 1 × Shelly Plus Uni

View all 16 components

  • 1
    Wiring Instructions

    Wiring Reference


    All wiring is 16AWG. See voltage-drop-analysis.md for resistance and drop calculations.

    Fuse Locations and Ratings


    FuseRatingLocationPurpose
    F110A fast-blowPSU outputProtects PSU output circuit
    F210A fast-blowBattery positiveINSTALL FIRST — protects battery circuit
    F32A fast-blowBP-65 OUT → HA GreenProtects HA Green load circuit
    F45A fast-blowBP-65 OUT → XB7 ModemProtects Xfinity Modem load circuit
    Install F2 before connecting the battery to any other part of the circuit. This is the primary short-circuit protection for the battery.

    Component Mounting


    ComponentMounting Method
    Mean Well LRS-100-12 PSUVelcro to enclosure base, stabilize to wall
    Victron BatteryProtect BP-65Velcro to enclosure base
    Pololu Ideal DiodeFloat — secure with wire ties
    Shelly Plus UniFloat — secure with wire ties
    Lever NutsFloat — secure with wire ties
    WiringCable clips as needed for strain relief

    Wiring Connections — From/To Reference


    AC Input → PSU


    FromToNotes
    Power Cord — Black (Hot)PSU Pin 1 AC/L
    Power Cord — White (Neutral)PSU Pin 2 AC/N
    Power Cord — Green (Ground)PSU Pin 3 GroundSafety ground — required

    PSU → Ideal Diode


    FromToNotes
    PSU Pin 4/5 DC Output V−Ideal Diode GND (V−)
    PSU Pin 6/7 DC Output V+Ideal Diode VIN (V+)Via F1 (10A)

    Ideal Diode → Terminal Block


    FromToNotes
    Ideal Diode GND (V−)Input 2 (−)Terminal Block has 2 inputs
    Ideal Diode VOUT (V+)Input 2 (+)Terminal Block has 2 inputs

    Battery → Terminal Block


    FromToNotes
    Battery (V−)Input 1 (−)Terminal Block has 2 inputs
    Battery (V+)Input 1 (+)Via F2 (10A)

    Terminal Block → Victron BatteryProtect BP-65


    FromToNotes
    Terminal Block +BP-65 IN terminal
    Terminal Block −BP-65 GND terminalUse included 1.5mm² wire

    Victron BP-65 OUT → Loads


    FromToNotes
    BP-65 OUT terminalLever Nut (+) — F3 input (2A)HA Green load circuit
    F3 outputHA Green barrel plug (center +)5.5mm × 2.1mm, center-positive
    BP-65 OUT terminalLever Nut (+) — F4 input (5A)Xfinity Modem load circuit
    F4 outputXB7 Modem barrel plug (center +)5.5mm × 2.1mm, center-positive
    Terminal Block −Lever Nut − HA Green barrel plug (sleeve)Common return
    Terminal Block −Lever Nut − XB7 Modem barrel plug (sleeve)Common return

    Shelly Plus Uni Monitoring


    FromToNotes
    Battery + (Terminal Block)Shelly Pin 1 (V+)Module power in (+)
    Battery − (Terminal Block)Shelly Pin 2 (GND)Module power in (−)
    Battery + (Terminal Block)Shelly Pin 3 (Analog In)Bridge to Pin 1 — battery voltage sense; primary shutdown trigger at 12.2V
    DS18B20 Yellow/White (Data)Shelly Pin 5 (Data)1-Wire temperature data
    DS18B20 Black (GND)Shelly Pin 6 (Sens. GND)Temperature sensor ground
    DS18B20 Red (VCC)Shelly Pin 7 (3.3V Out)Temperature sensor power

    Enclosure Layout


    See https://github.com/wkcollis1-eng/DIY-LiFePO4-UPS/blob/main/assets/UPS_Layout_with_12_Volt_Regulator.png for the assembly drawing image.

    The enclosure is a LeMotech IP65 ABS junction box (9.6″×7.6″×4.5″ interior). Key layout decisions:

    • PSU occupies the left side; battery occupies the center. Physical separation provides AC/DC segregation and reduces EMI coupling.
    • Cable glands (1/2" NPT) on the bottom face: AC input on the left, DC output barrel jacks on the right.
    • Victron BP-65 mounts on the right side wall. Terminal block sits between battery and BP-65.
    • Shelly and ideal diode float above the battery, secured with wire ties.
    • All 16AWG runs are kept to approximately 6" segments to hold voltage drop within the analyzed 88mV budget.

View all instructions

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates