Build an Open-Source USB-C PD Lab Power Supply (2026 DIY Guide)
May 1, 202611 min readBy Maker's Workbench
DIYPower ElectronicsUSB-C PDLab

Build an Open-Source USB-C PD Lab Power Supply

A pocket bench supply that runs off your laptop charger. 0–20 V, 0–5 A, knob-driven, and totally hackable. Total cost: less than dinner for two.

12.34 V 2.105 A CC · 25.97 W VOLTAGE CURRENT USB-C IN

Why USB-C PD changed bench supplies

USB Power Delivery 3.1 negotiates up to 28 V at 5 A from a generic laptop brick. That means your bench supply doesn't need a transformer, a fuse box, or a metal chassis. The work shifts from generating the rail to shaping it — a tiny buck converter, a current sense resistor, a microcontroller, and a rotary encoder.

Why DIY? Commercial bench supplies start at $80 and feel like 2003. This build gives you a serial console, programmable presets, USB-C input, and a part you can read every line of.

Architecture in one picture

USB-C PD CH224KPD trigger TPS54331 buckDAC controlled INA226V/I sensing RP2040 + OLED
USB-C → PD trigger → buck regulator with DAC reference → V/I sense → MCU.

Bill of materials

PartWhyCost
CH224K PD trigger ICNegotiates up to 20 V over CC pins$0.80
TPS54331 buckWide input, adjustable, 28 V/3 A$2.20
INA226 current sensor16-bit V and I over I²C$1.40
MCP4725 DACSets buck feedback reference$1.10
RP2040 + 0.96" OLEDUI, encoder, USB-C config$5.50
Rotary encoders ×2 + knob capsVoltage + current$3
3D-printed shell + binding postsPETG works$5
JLCPCB 4-layer board (qty 5)$2/m² POE deal$8

Total $27 for the rev-1 board, ~$40 with a printed enclosure and decent banana posts.

Firmware, the smart part

Each rotary tick changes the DAC code; the MCP4725 sets the feedback divider on the TPS54331. The INA226 reads back V and I twice per encoder tick, and a PI loop closes voltage regulation. A "constant current" mode kicks in when measured current exceeds setpoint — drop the DAC to taste.

// MicroPython on RP2040
from machine import I2C, Pin
ina = INA226(i2c, addr=0x40)
dac = MCP4725(i2c, addr=0x60)
v_set, i_set = 5.00, 0.500
while True:
    enc = read_encoders()
    v_set += enc.v_delta * 0.01
    i_set += enc.i_delta * 0.005
    v, i = ina.bus_voltage, ina.current_a
    if i > i_set:                # CC mode
        dac.write(max(0, dac.last - 1))
    else:                         # CV mode
        target = int(v_set / 20.0 * 4095)
        dac.write(target + pi.step(v_set - v))
    oled.show(v, i, mode="CC" if i>=i_set else "CV")

Calibration in 90 seconds

Hook a known-good DMM in series and parallel. Run a 7-point sweep at 1 V, 5 V, 9 V, 12 V, 15 V, 18 V, 20 V. The RP2040 fits a 2-segment linear correction in flash. Repeat for current at 100 mA, 500 mA, 1 A, 2 A, 4 A. After this, your unit reads to ±0.5 % across the range — better than most $250 store-bought supplies.

Where to take it

Add a USB serial protocol so a desktop app can sweep V and log I — instant battery analyser. Add a second channel and you have a dual-rail supply for $60. Sell it on Tindie at $129 with a printed shell and you've shipped your first hardware product.

Next move: order the JLCPCB 4-layer prototype with assembled SMD on the bottom side. Total turnaround: 6 days. Cost: $36 for 5 boards.

Comments

Popular posts from this blog

10 Low Investment Business Ideas for Beginners in 2026 (Start Under $500)

10 Business Ideas You Can Start With $500 to $2,500 in 2026 (Beginner-Friendly & Profitable)