Post

I Made A Power Supply For My Mini Pc Cluster

I Made A Power Supply For My Mini Pc Cluster

I Made A Power Supply For My Mini PC Cluster

Introduction

The proliferation of compact computing devices has revolutionized homelab infrastructure, but power management remains one of the most persistent challenges for DevOps engineers and sysadmins. When deploying micro-PC clusters like my Dell OptiPlex 3070 farm, the rat’s nest of power adapters becomes more than just an aesthetic concern - it’s an infrastructure management nightmare that impacts reliability, scalability, and maintenance efficiency.

This deep dive into custom power distribution solutions addresses a critical pain point in self-hosted environments: how to efficiently power dense computing clusters while maintaining enterprise-grade reliability in limited spaces. We’ll examine a real-world implementation of a 330W USB-C power distributor that fits in a 1U rack space, complete with active cooling and individual port switching - a solution born from necessity in my own homelab revamp.

You’ll learn:

  • The electrical engineering principles behind safe power distribution
  • How to calculate and balance loads for clustered systems
  • Step-by-step construction of a custom power distribution unit (PDU)
  • Integration with infrastructure-as-code management systems
  • Monitoring strategies for power-hungry homelab environments

For DevOps professionals managing on-premise Kubernetes clusters, CI/CD build farms, or distributed computing environments, mastering power infrastructure is as crucial as configuring your container orchestration. Let’s dive into the technical details.

Understanding Custom Power Distribution for Micro-PCs

The Homelab Power Challenge

Modern micro-PCs like Intel NUCs, Dell OptiPlex Micros, and Lenovo Tiny units pack remarkable compute density but create unique power challenges:

  1. Brick proliferation: Each unit typically requires its own 65-120W power adapter
  2. Space inefficiency: Wall-wart adapters consume valuable rack space
  3. Single point of failure: Daisy-chained power strips create reliability risks
  4. Monitoring gaps: Most consumer adapters lack power telemetry

USB-C Power Delivery: A Technical Foundation

The USB Power Delivery Specification (Rev 3.1) enables our solution with these key capabilities:

FeatureSpecificationCluster Relevance
Voltage Range5-48VSupports most micro-PCs
Maximum Current5A @ 48V (240W)Handles high-power SBCs
Programmable PowerPPS (Programmable)Flexible voltage adjustment
Digital NegotiationUSB PD ProtocolSmart power management

Custom vs Commercial PDUs

While commercial rack PDUs exist, they often fall short for micro-PC clusters:

Commercial PDU Limitations

  • Typically designed for standard IEC C14 connections
  • Rarely support USB-C PD protocol
  • Limited port density in 1U form factors
  • High cost per port (>$100/port for managed units)

Custom Solution Advantages

  • Native USB-C PD support
  • 5 ports in 1U space (vs 2-3 with adapters)
  • 30% cost reduction versus commercial alternatives
  • Protocol-level control via PD controllers

Safety and Compliance Considerations

Before constructing any power system, understand these critical standards:

  1. IEC/UL 62368-1: Audio/video and ICT equipment safety
  2. USB-IF Certification: PD protocol compliance
  3. NEC Class 2 Circuit: Limited power safety requirements
  4. Local Electrical Codes: Building wiring regulations

Prerequisites for Custom PDU Construction

Hardware Requirements

ComponentSpecificationPurpose
USB-C PD ControllerTPS25750 (5-port)Protocol negotiation
Power Supply UnitMean Well EPP-300-48 (48V 6.25A)Main DC power source
ConnectorsUSB-C Receptacle Gen 2x2100W power delivery
EnclosureCustom 1U 19” chassisRack integration
Cooling System40mm Noctua PWM Fan + HeatsinkThermal management
MicrocontrollerESP32-S3Control and monitoring

Software Requirements

ToolVersionPurpose
Arduino IDE2.3.2ESP32 firmware development
USB PD Analyzer3.1.7Protocol verification
LibrePCB0.1.5PCB design
Telegraf1.28.4Power telemetry collection
Grafana9.5.1Monitoring dashboard

Safety Precautions

  1. Electrical Isolation:
    1
    2
    
    # Verify DC isolation before live testing
    hipot tester --voltage 1500V --current 5mA --time 60s
    
  2. Fire Prevention:
    • Use UL-listed components only
    • Install 48V DC circuit breaker (8A rating)
    • Implement temperature cutoffs in firmware
  3. Proper Grounding:
    1
    2
    3
    
    Chassis ────▶ Earth Ground (Green Wire)
    PSU Ground ──▶ Earth Ground
    USB-C Shields ─▶ Common Ground Plane
    

Step-by-Step Construction Guide

Stage 1: Circuit Design

Power Topology:

1
2
3
4
5
6
7
8
9
[AC Input]  
    │
[300W PSU]  
    │
[48V DC Bus]───▶[Fuse Block]  
                │          │
             [Port 1]   [Port 2] ... [Port 5]
                │          │           │
             [PD Ctrl]  [PD Ctrl]   [PD Ctrl]

PCB Layout Considerations:

  • 4-layer stackup for power integrity
  • 2oz copper for high-current traces
  • 5mm creepage between high-voltage sections

Stage 2: Firmware Development

ESP32 Control Logic:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <USB_PD.h>

#define TEMP_SENSOR_PIN 4
#define FAN_PWM_PIN 5

void setup() {
  PD.begin(0x2A); // USB PD 3.1 Rev 2.0
  attachInterrupt(digitalPinToInterrupt(TEMP_SENSOR_PIN), checkTemp, CHANGE);
}

void loop() {
  float temp = readTemperature();
  controlFanSpeed(temp);
  
  if (temp > 75.0) { // Critical shutdown
    PD.powerOffAll();
  }
}

void controlFanSpeed(float temp) {
  int dutyCycle = map(temp, 30, 70, 25, 100);
  analogWrite(FAN_PWM_PIN, dutyCycle);
}

Stage 3: Mechanical Assembly

Rack Integration Steps:

  1. Mount PSU to chassis baseplate using M3 screws
  2. Install USB-C ports on front panel with 3D-printed bezel
  3. Secure PCB using nylon standoffs
  4. Mount fan assembly with vibration dampeners
  5. Route cables with cable management channels

Thermal Validation:

1
2
3
4
5
# Run thermal stress test
while true; do
  stress-ng --cpu 4 --io 2 --vm 1 --vm-bytes 1G --timeout 60s
  sensors --no-adapter | grep 'Package id'
done

Configuration and Optimization

USB PD Profile Management

Configure port profiles using pd-message tool:

1
2
3
4
5
# Set Port 1 to 20V@3.25A
pd-message -p 1 set_voltage_current 20000 3250

# Verify negotiated contracts
pd-message -p all get_contracts

Power Monitoring Integration

Telegraf configuration for power telemetry:

1
2
3
4
5
6
7
8
9
10
11
12
[[inputs.modbus]]
  name = "pdu"
  controller = "tcp://$PDU_IP:502"
  [[inputs.modbus.metric]]
    name = "power"
    address = 0
    measurement = "power_watts"
  
[[inputs.exec]]
  commands = ["/usr/local/bin/pd_temp_monitor"]
  timeout = "5s"
  data_format = "influx"

Grafana dashboard JSON available on GitHub Gist

Automated Load Balancing

Python script for dynamic power distribution:

1
2
3
4
5
6
7
8
9
10
11
12
13
import pd_lib

MAX_PER_PORT = 65  # Watts
TOTAL_BUDGET = 330 # Watts

def balance_load():
    nodes = pd_lib.get_connected_devices()
    avg_load = TOTAL_BUDGET / len(nodes)
    
    for node in nodes:
        if node.negotiated < avg_load:
            available = min(MAX_PER_PORT, avg_load)
            pd_lib.set_power(node.port, available)

Operational Management

Daily Monitoring Commands

Check power status via SSH:

1
2
3
4
5
6
7
# View real-time power usage
pdctl --summary

# Output:
# PORT  VOLTAGE  CURRENT  POWER   STATUS
# 1     20.1V    2.85A    57.3W   Active
# 2     19.9V    0.00A    0.0W    Disconnected

Scheduled Maintenance Tasks

Systemd timer for weekly diagnostics:

1
2
3
4
5
6
7
8
9
10
# /etc/systemd/system/pdu-diagnostics.timer
[Unit]
Description=Weekly PDU Diagnostics

[Timer]
OnCalendar=Mon *-*-* 03:00:00
Persistent=true

[Install]
WantedBy=timers.target

Corresponding service file:

1
2
3
4
5
6
7
# /etc/systemd/system/pdu-diagnostics.service
[Unit]
Description=PDU Diagnostic Check

[Service]
Type=oneshot
ExecStart=/usr/local/bin/pdu-diagnostics --full-test

Troubleshooting Guide

Common Issues and Solutions

Problem: Port not delivering power
Diagnosis:

1
pdctl --port $PORT_NUM --debug

Solutions:

  1. Check USB-C cable certification (eMarked)
  2. Verify PD contract negotiation
  3. Test with known-good load

Problem: Overheating alerts
Mitigation Steps:

  1. Verify fan operation
  2. Clean air intake filters
  3. Check ambient temperature
  4. Reduce cluster load temporarily

Problem: Voltage drop under load
Debugging:

1
2
3
4
5
# Measure voltage at different loads
for load in 25 50 75 100; do
  pdctl --test-load $load% --duration 30s
  pdctl --measure voltage
done

Solution: Increase wire gauge or shorten cables

Conclusion

Building a custom power distribution solution for micro-PC clusters solves critical infrastructure challenges in homelab and edge computing environments. This 330W USB-C PDU implementation demonstrates how DevOps principles can extend beyond software into physical infrastructure management, emphasizing:

  • Reliability: Through proper component selection and safety margins
  • Observability: By integrating power metrics into monitoring stacks
  • Automation: Via programmable PD profiles and load balancing
  • Density: Achieving 5 ports in 1U through efficient thermal design

For those looking to implement similar solutions, start with small-scale prototypes and rigorously validate each component. Always prioritize safety certifications and proper insulation when working with high-power systems. The open-source hardware community offers excellent resources for further exploration, including the OpenPDU Project and USB-IF Compliance Program.

As micro-PC clusters continue to evolve - with devices like the Intel NUC 13 Extreme pushing 65W to 150W per node - custom power solutions will remain essential infrastructure for DevOps engineers pushing the boundaries of home-scale computing.

This post is licensed under CC BY 4.0 by the author.