Skip to main content
Raspberry Pi HATs

Building a USB Power Delivery Trigger HAT

Overview

This tutorial builds a Raspberry Pi HAT that acts as a USB Power Delivery sink. It uses a CH224K-style trigger controller to request a fixed PDO from a USB-C charger, then routes the negotiated 5V, 9V, 12V, 15V, or 20V rail to an output terminal block. The HAT also includes status indication, input and output filtering, and an optional GPIO header for enable and power-good monitoring.

Circuit Requirements

The HAT should provide:

  • A USB-C receptacle connected to a PD sink controller
  • Fixed-voltage negotiation for 5V, 9V, 12V, 15V, and 20V charger profiles
  • A terminal block for the negotiated output voltage and ground
  • Input and output capacitors close to the power path
  • A power-good LED so the requested voltage can be checked at a glance
  • Optional Raspberry Pi GPIO access to enable the trigger and read PGOOD

How the Trigger Works

The CH224K is a small USB Power Delivery sink controller. It connects to the USB-C connector's CC pins, advertises itself as a sink, and asks the charger for one of the fixed Power Data Objects. The selected output voltage appears on the same VBUS rail after the PD negotiation succeeds.

The three configuration pins, represented by CFG1, CFG2, and CFG3, are pulled down by default and brought to a header. You can populate solder bridges, a DIP switch, or jumpers to encode the voltage option used by your controller variant. Always confirm the exact truth table in the controller datasheet before assembling hardware.

Building the Circuit Step by Step

Step 1: Start with the HAT board

import { RaspberryPiHatBoard } from "@tscircuit/common"

export default () => (
<RaspberryPiHatBoard name="HAT1">
{/* Components go here */}
</RaspberryPiHatBoard>
)

Step 2: Add the USB-C input and PD controller

The USB-C connector exposes VBUS, GND, CC1, and CC2. The controller monitors the CC pins and negotiates the requested output voltage.

Schematic Circuit Preview

Step 3: Add the voltage selector

The voltage selector is modeled as a six-pin header. Three pins connect to the controller configuration inputs, while the other side exposes rails that can be used for jumpers or solder bridges.

<chip
name="JP1"
footprint="pinrow6"
manufacturerPartNumber="3-bit voltage select header"
pinLabels={{
pin1: ["CFG1"],
pin2: ["CFG2"],
pin3: ["CFG3"],
pin4: ["GND"],
pin5: ["VDD"],
pin6: ["VOUT"],
}}
/>

Step 4: Add filtering and output terminals

The input capacitor stabilizes VBUS near the connector and controller. The output bulk capacitor sits near the terminal block and helps absorb load steps when the downstream device turns on.

<capacitor name="C1" capacitance="10uF" footprint="0805" />
<capacitor name="C2" capacitance="100nF" footprint="0402" />
<capacitor name="C3" capacitance="47uF" footprint="1210" />
<capacitor name="C4" capacitance="100nF" footprint="0402" />
<chip
name="J2"
footprint="pinrow2"
manufacturerPartNumber="2-pin 5.08mm terminal block"
pinLabels={{ pin1: ["VOUT"], pin2: ["GND"] }}
/>

Step 5: Add status and Raspberry Pi monitoring

PGOOD drives the status LED through R5. The optional J3 header lets the Pi pull EN low or read whether negotiation completed before enabling a load.

<chip
name="J3"
footprint="pinrow3"
manufacturerPartNumber="GPIO status header"
pinLabels={{ pin1: ["EN"], pin2: ["PGOOD"], pin3: ["GND"] }}
/>
<resistor name="R5" resistance="2.2k" footprint="0402" />
<led name="D1" color="green" footprint="0603" />

Voltage Selection Table

Use the controller datasheet as the source of truth for the final jumper map. This table is a practical layout worksheet for the HAT:

Target outputTypical useLayout note
5VPi accessories, logic boardsSafest first power-up setting
9VSmall motors, routers, LED driversCheck downstream regulator rating
12VFans, relays, light stripsUse wider copper for higher current
15VAudio boards, lab modulesConfirm capacitors are rated above 15V
20VUSB-C laptop adapters, buck inputsUse 25V or higher rated capacitors

Bill of Materials

RefPartNotes
J1USB-C receptacleChoose a footprint matching your assembly process
U1CH224K USB-PD sink controllerFP6601Q/FP28xx or PD2001 can be adapted
JP13-bit voltage select headerReplace with solder jumpers or a DIP switch if preferred
J22-pin terminal blockRated for the maximum current you expect
J33-pin logic headerOptional Pi-side EN, PGOOD, and GND
C110uF, 25V or higherVBUS input bulk capacitor
C2, C4100nFLocal decoupling capacitors
C347uF, 25V or higherOutput bulk capacitor
R1-R3100kDefault pulldowns for voltage select pins
R410kEnable pullup
R52.2kLED current limiting resistor
D1Green LEDPower-good indicator

Example Pi Monitor

The PD trigger works without software, but the Pi can monitor PGOOD before it turns on a downstream load.

from gpiozero import DigitalInputDevice, DigitalOutputDevice
from time import sleep

pd_enable = DigitalOutputDevice(23, active_high=True, initial_value=True)
pd_good = DigitalInputDevice(24, pull_up=False)

while not pd_good.value:
print("Waiting for USB-PD negotiation...")
sleep(0.1)

print("Requested USB-PD voltage is ready")

Bring-Up and Test Procedure

  1. Leave the HAT disconnected from the Raspberry Pi and set the selector to 5V.
  2. Connect a current-limited USB-C PD charger and verify that the status LED turns on.
  3. Measure J2 with a multimeter and confirm the expected voltage and polarity.
  4. Move through the 9V, 12V, 15V, and 20V settings with no load attached.
  5. Add a small dummy load, then re-check voltage droop and component temperature.
  6. Only connect a Raspberry Pi or downstream device after the selected voltage is known to be safe for that load.

Safety Notes

USB-PD can expose 20V on a connector that physically resembles a 5V USB port. Clearly label the terminal block, use capacitors with enough voltage headroom, and do not connect the negotiated rail directly to the Raspberry Pi 5V header unless the selected profile is 5V and the power path has been reviewed.