diff --git a/docs/tutorials/pi-hats/usb-pd-trigger-hat.mdx b/docs/tutorials/pi-hats/usb-pd-trigger-hat.mdx new file mode 100644 index 00000000..65c43b13 --- /dev/null +++ b/docs/tutorials/pi-hats/usb-pd-trigger-hat.mdx @@ -0,0 +1,341 @@ +--- +title: Building a USB Power Delivery Trigger HAT +description: Learn how to build a USB Power Delivery trigger HAT for Raspberry Pi that negotiates 5V-20V from USB-C PD power supplies using tscircuit. +--- + +## 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. + +import TscircuitIframe from "@site/src/components/TscircuitIframe" +import CircuitPreview from "@site/src/components/CircuitPreview" + + ( + + {/* USB-C Connector */} + + + {/* CH224K USB PD Controller */} + + + {/* Status LED */} + + + + {/* Output Capacitors */} + + + + {/* Terminal Block Output */} + + + {/* Raspberry Pi GPIO Header */} + + + {/* Power traces */} + + + + + + + {/* Output connections */} + + + + {/* Capacitor connections */} + + + + + + {/* Status LED */} + + + + +) +`} /> + +## 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 | + + ( + + + + {/* Example: 12V configuration (CFG2 to GND) */} + + + +) +`} /> + +### 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 + +1. **Visual Inspection** - Check solder joints and component orientation +2. **Continuity Test** - Verify no shorts between VOUT and GND +3. **Power Test** - Connect to a USB-C PD charger +4. **LED Check** - Green LED should illuminate when voltage is negotiated +5. **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](/building-electronics/ordering-prototypes) for detailed instructions.