Building a USB Power Delivery Trigger HAT
Overview
This tutorial will walk you through building a USB Power Delivery (PD) trigger HAT for Raspberry Pi. The HAT uses a CH224K controller to negotiate voltage from USB-C PD power supplies, providing configurable 5V to 20V output.
Objectives
A USB PD trigger HAT demonstrates advanced power electronics concepts:
- USB Power Delivery Protocol - Understanding PD negotiation
- Voltage Selection - Configuring output voltage via pins
- Power Distribution - Safe delivery of higher voltages
- HAT Design - Raspberry Pi expansion board conventions
Use Cases
- High Power Projects - Power motors, heaters, or high-brightness LEDs
- Battery Charging - Build chargers for various battery chemistries
- Lab Power Supply - Portable voltage source from USB-C chargers
- Raspberry Pi Clusters - Efficient power for multiple Pis
Bill of Materials
| Component | Value | Footprint | Purpose |
|---|---|---|---|
| USB-C Connector | - | 16-pin | PD power input |
| CH224K | - | ESSOP-10 | PD controller |
| LED1 | Green | 0603 | Power good indicator |
| R1 | 1kΩ | 0402 | LED current limit |
| C1 | 10µF | 0805 | Output filtering |
| C2 | 100nF | 0402 | High-freq filtering |
| J2 | 2-pin | 5.08mm | Terminal block output |
| J3 | 40-pin | 2.54mm | Raspberry Pi header |
Understanding USB Power Delivery
USB PD allows negotiation of higher voltages and currents:
| Profile | Voltage | Max Current | Max Power |
|---|---|---|---|
| 5V | 5V | 3A | 15W |
| 9V | 9V | 3A | 27W |
| 12V | 12V | 3A | 36W |
| 15V | 15V | 3A | 45W |
| 20V | 20V | 5A | 100W |
The CH224K handles all PD communication automatically.
Circuit Design
Step 1: CH224K Voltage Configuration
The CH224K selects output voltage based on CFG pin connections:
| CFG3 | CFG2 | CFG1 | Output Voltage |
|---|---|---|---|
| Float | Float | Float | 5V |
| Float | Float | GND | 9V |
| Float | GND | Float | 12V |
| Float | GND | GND | 15V |
| GND | Float | Float | 20V |
Step 2: USB-C Connection
Connect the USB-C CC pins to the controller for PD communication:
Step 3: Output Filtering
Output capacitors ensure stable voltage delivery:
Step 4: Power Good LED
The PG pin indicates successful voltage negotiation:
Complete Schematic
Testing the HAT
- Visual Inspection - Check solder joints and component orientation
- Continuity Test - Verify no shorts between VOUT and GND
- Power Test - Connect to a USB-C PD charger
- LED Check - Green LED should illuminate when voltage is negotiated
- Voltage Verify - Measure output with a multimeter
Safety Considerations
- Always verify voltage before connecting loads
- Use appropriate gauge wires for high current
- Include reverse polarity protection for sensitive loads
- Consider adding a fuse for overcurrent protection
Ordering the PCB
Export the fabrication files and upload to JLCPCB. See Ordering Prototypes for detailed instructions.