USB-PD is a pretty cool part of USB-C – tons of voltages and powers to choose from mean compatibility with a huge range of devices, and for supplies that support Programmable Power Supply (PPS) in PD3.0, there are big benefits for battery charging of devices like cell phones (charge your battery faster and with less heat, prolonging life!)
For the hobbyist, taking advantage of PD can be a bit of a challenge, since it requires both software and hardware technical knowhow in the form of PD negotiation with a dedicated PHY chip to handle supply switching. Luckily, a handful of dedicated, single-purpose “PD trigger” devices exist to take that piece out of the equation for some projects.
(I bought mine from this listing on ebay)
This trigger uses a STM32F0, a PD PHY, a button, and a 2020 RGB LED to give you a complete range of PD functionality, but the instructions are tricky at best in their native “google translate.” Here’s the proper english version:
Selectable Mode (Default)
By default, the unit ships in a mode where pressing the button cycles PD voltages. A red LED indicates selectable mode, and 5V present. Pressing the button advances to the next available PD voltage. The colors indicate:
- Red; Selectable mode, 5V present
- Yellow: 9V
- Green: 12V
- Ice/Teal: 15V
- Blue: 20V
To enter programming mode: With the device unplugged, press and hold the button while plugging in. When you do this, the LED will rapidly flash colors to indicate that you’re in programming mode. Once you let go, the LED will go Red, and 5V will be present on the output. Click the button to pick your preferred fixed mode. While you select, output will remain at 5V. Click repeatedly to select mode:
- Red: Selectable mode, 5V present
- Yellow: 9V
- Green: 12V
- Ice/Teal: 15V
- Blue: 20V
- Purple: Highest available. In this mode, the trigger will pick the highest power profile the charger advertises
- White: Auto-cycle. In this mode, the trigger will cycle through available profiles. It’s just as if you plugged the trigger in in selectable mode, and clicked the button once a second indefinitely. Useful for testing supplies, I guess, but probably mostly just dangerous.
NOTE: There IS NO 5V fixed mode. I suppose this makes sense – if you wanted 5V only, you should just use a dumb USB-C port and put a 5.1k resistor to ground on each of the two CC pins (5.1k Rd on the CC pin of a “Upstream Facing Port (UFP)” indicates “I’m a legacy sink”. This doesn’t guarantee you any particular current, but it WILL grant you 5V from any USB port.) Funny story, the Raspberry Pi 4 doesn’t do this correctly with two separate resistors, so if you use a PD charger and an e-marked (high-current) cable, you’ll get bupkis.
IMPORTANT GOTCHA NOTE!
This trigger always outputs 5V first, THEN whatever voltage it’s set to negotiate, in two steps.
USB-C is interesting in that, since you can attach a powered device in either direction, a downstream-facing-port that supplies power leaves VBUS at 0V to avoid a conflict fi you plug in something that’s already powered. When you DO plug in a device, though, it gets 5V even if it’s a PD device that needs to negotiate more power. It’s up to the device, in this case the trigger, to do with that what it may.
For many applications, this won’t be much of an issue. For my application, it may or may not be. I intend to use this device to power a TS100 soldering iron. In the default case, 5V then 20V, the iron should be fine. It’ll run on 5V after all, just very poorly. when Vin suddenly becomes 20, it shouldn’t care.
On the other hand, the iron behaves as a simple resistive device, meaning you get much more tip power with a higher input voltage. It’s rated at 65W at 24V and 2.7A. That implies ~8.8 ohm tip heater resistance. Therefore, supplied with 20V, it’ll be a 45W iron. 20W is a lot to miss out on, but I’d still like USB-C power, so why don’t I put a boost converter in line to boost [email protected] to [email protected]? (In fact, 3.25A is a bit too high for the super common 60W USB-C supplies, so I’ll tone it down a notch and boost [email protected] to [email protected], minus a little off the 23V to leave headroom for converter efficiency.)
With this boost converter in-line, imagine the scenario that the iron draws its 60W, but the input voltage is 5V, so the converter is trying to boost 5V to 23V at 60W. Bad things could happen there. This is probably rare in practice: at initial plug-in, the iron will only be drawing a few mA, so the converter should boost 5V to 23V no problem at that low power. Or it’s out of range and simply won’t turn on – also no problem. But in the edge case, the 5V-then-20V sequence could be an issue.
Don’t Buy This Crap Charger
Interestingly, in the process of trying out this trigger with a PD supply and a multimeter, I found out that my “Monoprice Obsidian Speed Plus USB Wall Charger” is totally hosed after a year and minimal use. I was wondering what was going on on the multimeter so I broke out the PD tester. Sure enough, the charger outputs mode:actual value of 5v:4v, 9v:7v, 12v:9v, 15v:11v, regardless of loading. So that thing’s unreliable, possibly dangerous, and definitely infuriating. Being >1y since purchase, it’s out of warranty and in my E-waste bin. Sad face 🙁