Notes on USB PD Triggers (And ZY12PDN Instructions)

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.

There are two “PD Trigger” devices that seem to be all over Amazon and ebay for easy purchase: the ZY12PDN, and the ZYPDS, both apparently from YZX Studio. Before I get into them, let’s look quickly at how a PD sink is even built.

A PD sink is made of 3 blocks at minimum: the upstream-facing USB-C port (the port plugs into a cable attached to some kind of host device), a USB PD PHY to talk to the other side and negotiate power, and a load.

Theoretically, to comply with the PD specification, the device is also supposed to have a high-side power MOSFET to disconnect the load until a suitable power contract has been negotiated. This is because VBUS will be at 5V when the device is first plugged in to power the PD PHY, and the load might be inclined to start up and draw too much power at this stage. Similarly, it’s conceivable that a faulty PD source is providing up to 20V already when the device is first plugged in, and the load may have to be protected from that. In practice, if the load BOTH 1) doesn’t draw too much power at 5V and 2) isn’t harmed by up to 20V, the device will pass the “smoke test” without the power switch.

Finally, it’s likely, though not strictly required, that there will need to be some kind of intelligent oversight to make decisions about power contracts, and only enable the downstream load if a suitable negotiation occurs and enough power is available at the desired voltage.

I mention all this as background to describe the design and operation of these two cheap triggers, as well as a third, more “professional” option called the PD Buddy Sink from Clara Hobbs, which better approximates the kind of solution you’d put into a production device (and also provides a good development platform to test such a PD sink design).

DeviceZYPDS
ZYPDS PD trigger image
ZY12PDN
ZY12PDN PD trigger image
PD Buddy Sink
PD Buddy Sink overview image
Blocks ImplementedPort, PHYPort, PHY, SupervisorPort, PHY, Supervisor, swtich

ZYPDS

The ZYPDS is basically the simplest possible option – it’s a total single-chip solution, built around a Chinese PD PHY called the IP2721 from Injoinic Technology. The datasheet’ s only in Chinese, but it’s easy enough to figure out what’s going on. This PHY will negotiate a contract for the highest power available at the voltage set by the SEL pin, or nothing at all or else the highest voltage contract the source does support (thanks to Brian down below in the comments for this correction!). It supports an external NMOS VBUS switch (presumably with gate driver charge pump built-in), but the ZYPDS doesn’t implement one. One variant of the chip lets you pick 20, 15, or 5V if SEL=High, High-Z, or GND respectively, and another variant offers selections of 12/9/5.

This might be a good chip to integrate into a cheap product with very simple requirements, but only if you can actually find it: you probably have to know someone in Shenzen, since I couldn’t find it on LCSC, Taobao, Alibaba, ebay, or any of the usual suspects.

ZY12PDN

ZY12PDN board image

(I bought mine from this listing on ebay)

This trigger uses a STM32F0, a PD PHY (Looks like a FUSB302 but I can’t figure out if the package markings actually line up – might just be a similar knockoff), a button, and a 2020 RGB LED to give you a complete range of PD functionality. It also includes a linear regulator for the LED and microcontroller. Note, it still doesn’t include a load switch. Your load will see 5V until a contract is negotiated, or perhaps more if there’s a fault upstream. If it’s true that the PHY IS, in fact, a FUSB302, this might well be a good development platform for testing your own PD sink design. It looks like SWIM pads are broken out on the bottom of the board for programming with an ST-Link, and framework options abound these days for the STM32, including Arduino, which also has FUSB302 libraries available.

The ZY12PDN offers a lot more functionality than the ZYPDS, but the instructions are tricky at best in their native “google translate.” A proper english version follows later on in this post.

PD Buddy Sink

The PD Buddy Sink is the most complete implementation of any mentioned here, and is probably the best jumping off point to start your own design exploration. It’s quite similar to the ZY12PDN in topology, but includes a load switch, all the reference design bells and whistles, and excellent documentation top to bottom.

In theory, the FUSB302 offers dual-role support, so you could use this board to make a PD Source as well if that’s what you’re after. In practice, I think this isn’t possible without rework, because switching the direction of current would be reverse-biasing the load switch and you might run into problems. At a minimum, it wouldn’t work correctly.

ZY12PDN Instructions (English)

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

Programming/Fixed Mode

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 🙁

28 Comments

  1. Ted Hancock
    July 26, 2020

    My first project with a ZY12PDN went pretty well overall. I’m charging a huge 42 cell 7S battery to 29.4v. The boost module has a current limiting trim pot which allows me to pull the full 20v 5A (100 watts) from my USB-C wall charger without exceeding its capacity. Unfortunately, none of my chargers will start at 20v 5A. Through trial and error, I determined that under 2A is some sort of standard. Therefore I had to replace the trim pot with a switch between two fixed resistors. I start at 1.5A which is also a nice car charger setting. I then flip the switch for 5A. You have to flip it fast though or YouTube PDN sees the event as a start up. My second project is stalled by an unexpected reaction, by the PDN, to a direct battery correction.

  2. Ted Hancock
    July 26, 2020

    Wow, these comments are posted without a Captcha or moderation? I haven’t seen that spirit since 1998! Anyway the ZY12PDN doesn’t like to be permanently connected to a 3S 12.6v battery (power bank for my wife). It just sits there blinking red and won’t respond to a source. For now, it’s on a switch, which is a terrible user experience. These are modem batteries so it’s impossible for them to draw more than 18w or so. A direct connection would have been so elegant. I’ve got some PDS on the way and I hope they don’t have this limitation. Also they need to switch from 15v to 20v on the fly. The same resistor swapping switch should be able to bridge and unbridge as well. That may be asking too much.

  3. July 26, 2020

    CAPTCHA: Don’t have much of a problem to be honest. Jetpack seems to keep the spam at bay.
    Trigger back-powering: I think the issue here is there’s no load disconnect MOSFET on any of these triggers. If you’ve got Trigger>Boost>Batteries with no means of disconnection, you’re PROBABLY back-feeding the cell voltage through the boost converter (which I bet has no power-off load isolation) to the trigger, and powering it up with VBUS=cell voltage minus a little. Plug that straight into a power bank which automatically sources 5V before negotiation, and you’re effectively shorting a 5V source to a (12.6 or 29.4V) load. It’s amazing the PD sources you’ve tried are robust enough that they haven’t let out the magic smoke 🙂

  4. Ted Hancock
    July 26, 2020

    The boost module is not technically isolated but the PDN can’t see the load until the booster hits minimum voltage which is about 8v. Likely the shift to 20v is not instantaneous so, for a moment, it’s trying to get to 100 watts on less than 20v. Likely a request for amps > 5 is unsupported and causes the power supply to shut down.

    As far as project 2, direct battery connection likely has too many failure scenarios. I’ll probably set the PDS to 15v with a buck charger to the 12v pack. Just running out of room in the power bank case.

    Thanks for your rapid and insightful reply.

    Ted

  5. Brian Lough
    September 9, 2020

    The behavior described for the ZYPDS is not right, it will accept the highest voltage the PSU supports that is equal or less than what is configured on the SEL pin.

    If I plug that module which is configured for 20V into a charger that only supports up to 12V, it will take 12V. I have tested this myself, but it is mentioned in the datasheet (LCSC have an english version)

    I had to source the IC off a PCBA company (Makerfabs)

  6. September 9, 2020

    @Brian Ahh, good catch! I just confirmed the same. I think what might have happened is that, previously, I may have been testing with a power bank that, it turns out, doesn’t properly identify its source capabilities. My ZYPDS wouldn’t negotiate higher than 5V with it, but all my other supplies were capable of the requested 20. I now have a 9V and 12V cell charger, and can confirm that the 20V configured ZYPDS will pick the highest option for whichever charger I plug it into.

  7. George
    October 1, 2020

    I connected the ZY12PDN to charge a 12V Li-ion battery pack. The LED is blinking in RED and i think it is not charging. Can anyone advice?

  8. October 1, 2020

    @george I’m not sure exactly what you mean by using the ZY12PDN to charge a 12V pack, but if you’re just connecting the output directly to the pack – definitely don’t do that. There needs to be a charge controller in the middle. Additionally, the ZY12PDN doesn’t have a way to disconnect the “Load” from the “source” so if you’re just connecting the pack straight to the “output,” you’ll actually just be connecting 12V to what will start out as 5V from whatever USB-C supply they ZY12PDN is plugged into. Sounds like a good way to destroy a laptop, or at least USB-C brick.

  9. George
    October 4, 2020

    @alex. I just want to make it clear. I want to charge a 12V Lithium Ion battery pack with a USB C PD charger. The Li-ion battery pack is integrated with a charge controller. Can I use a 1N4007 diode to limit the voltage from the load to the source?

  10. October 4, 2020

    @george Ok – definitely better. Assuming we’re talking about a 3S lipo pack, the NOMINAL voltage will be 11.1, but the FULL voltage will be 4.2*3=12.6. Using the 12V mode on the trigger, you’ll only be able to expect like 80% charge, so that’s one concern. You could use PPS mode (Programmable Power Supply, included in PD 3.0) to set 12.6 or 12.8V and then your charge controller would have headroom for full charge, BUT the ZY12PDN doesn’t support that out of the box (and not all supplies/power banks do either).

    As far as the ZY12PDN specifically, there’s still the question of how power is routed in your system. If what you’re hooking the ZY12PDN to is “input only” and doesn’t supply battery voltage, you should be fine. But if the ZY12PDN lights up at all when not plugged into USB-C, that’s not the case, and probably won’t work the way you expect.

  11. Alexander
    October 6, 2020

    Hi, could you please help me? I want to power a display which needs 12v with a powerbank (brand: charmast, says it can output 12v to the usb-c and normal USB A port). When I first plugged the ZY12PDN in, I couldn’t cycle through the modes, there was just a red light and after about 3 seconds the blue led started blinking. The same happens if I put in on fixed mode and the output is always about 5.13v. Do you know what the blue blinking light means or how I could fix it?

  12. October 7, 2020

    I don’t know, I’m sorry. The fact that it can put out 12V to the USB-A port means it must support something like QuickCharge 3.0, and it’s POSSIBLE but unlikely that it doesn’t support PD at all, and ONLY QC3.0 over both USB-C and USB-A? If so, then the ZY12PDN wouldn’t work. I can’t say what the blue LED blinking means, but I’ve never tried it on a non-PD USB-C port, so that seems totally plausible. But I just tested on my own ZY12PDN set to 20V. When I plug that into a non-PD port, it briefly flashes blue then continually flashes red. So not quite the same as yours.

  13. Pierre
    October 20, 2020

    I’m a newbie trying to figure out how to power a DIY project using USB-C PD.

    I’m building a project using about 120 RGB LEDS (consuming 60mA at 5V) and a Raspberry Pi 4 (max 3A at 5V). So I would expect a max load of 7.2A for the LEDs + 3A = 10.2A.

    I’d like to power both using the same USB-C port.

    I have a 60W USB-C PD charger which would provide me with 3A at 20V and I had the intention to use this as an input for a step-down DC-DC converter (XW-12-5-50W) that would output 10A at 5V.

    I do have a ZY12PDN USB-C PD module, would it deliver 20V 3A?

    Thanks for your help.

  14. October 20, 2020

    @pierre First, yes, your understanding is right, that should work out! Two things to consider: you’re at least getting pretty close to the load rating of the converter, and the converter itself is pretty close to the load rating of the supply rail. That said, I’d be surprised if the converter was much less than 80% efficient, so 50W out = 50/0.8 = 62.5W in. That’s dangerously close, but close enough I bet it’ll work fine. Ditto the load side: your calculation is 51W load vs 50W, but I’m betting the Pi 4 isn’t actually as bad as you’re allowing. At full load with no accessories or anything, the Pi 4 should be inside of 8 watts according to this: https://www.tomshardware.com/reviews/raspberry-pi-4#:~:text=Power%20and%20Heat%20on%20Raspberry,more%20than%20the%203%20B%2B.

    Long story short, your conservative estimate is flirting with the limits, but I think you’ll land inside them. I’d encourage you to wire it up and try it out, but measure the USB-C side with a USB-C power meter to make sure you’re not over-taxing the adapter, and measure the current output of the switching converter to make sure you’re not too close to THAT limit. Note: 10.1A is a lot of current at 5V. My preference would be to measure this with a current clamp for zero voltage drop (burden voltage), but you could also use a .010-ohm resistor, measure the voltage across that, and calculate. My bench meter has a half-ohm shunt resistor on the amps range, and my handheld has 60mOhm. Both will cause the pi to shut down while trying to measure 10 amps. The bench meter won’t even do it.

  15. Clement
    October 22, 2020

    Hi Alex,

    thanks for your article, I have a question : I’d like to use the ZY12PDN as a adapter for multiple products that usually use a DC power supply. The simplest way would be to use a ZY12PDN with a USB-A connector, and then use a USB-A to DC cable with various connectors corresponding to the different DC sizes. But I’m worried about the ability for the USB-A connector (and cable) to carry up to 60W. Do you have an idea if it should work ?
    Other point: do you think I could sink the board in epoxy to make it safer to handle/transport it ?

    Thanks !

  16. October 22, 2020

    Hey Clement – as far as epoxy, the only issue is that you won’t be able to use the button anymore to switch voltages. Just seems a little overkill. My preference would be for heat shrink tubing or something along those lines.

    As far as using a USB-A connector, I wouldn’t. You’d be better off with a DC barrel jack. 60W means 20V 3A, but nothing about the ZY12PDN actually limits you to 3A. It’ll negotiate the highest power contract for the selected voltage. At 20V, that could be 5A, if you supply supports it. The issue there is that USB-A ports are definitely NOT rated to 5A. Will it work? Yes. But it may well wear out, heat up, spark if you accidentally unplug it, and so on. I would be fine running 5A through a USB port under lab conditions, but not in real world use.

    But the better reason not to do that is to avoid the scenario when you (absentmindedly), or someone else who doesn’t know how your system works, plugs a cell phone into it and destroys it or starts a fire. The best argument against misusing connectors like that is that if you create the opportunity to mess up a simple connection, someone WILL eventually do it no matter how careful you are, for reasons you didn’t anticipate.

    The same argument applies to barrel jacks and plugs, but at least since those have never had any sort of electrical standard, everyone knows not to trust them unless it’s the adapter that came with the device. Repurposing an idiot-proof connector in such a way is just inviting failure.

  17. Clement
    October 25, 2020

    Hi Alex, good point for the usb-a, thanks for the detailed answer!
    Best Regards

  18. Pierre Thomain
    October 26, 2020

    Hi Alex, thanks for your reply.

    I’m actually looking into using more than 120 LEDs and capping in software the number of LEDs being powered at any one point to 120 or lower (they’re all individually addressable and I’m looking to animate them rather than have all of them lit up at once).

    I’m thinking of using a current limiter to prevent overloading the DC converter in case that capping fails for any reason. I was thinking of using either a polyfuse with an 8A trip current or a variable current limiter IC.

    Do you have any advice as to which would be best in that setup?

    Thanks,
    Pierre

  19. October 26, 2020

    The polyfuse method is easy and cheap but I’m not sure how precise they are, and they’re definitely less repeatable. If you’re not in a huge rush, maybe try the polyfuse first to see how it works in practice, then bother with the closed loop current limiting if the polyfuse behaves badly for you.

  20. Zakis
    October 31, 2020

    Hi,
    On edit mode (from googling) when you select the white mode , ZY12PDN returns to button cyclic voltage selection . (Default mode)
    To confirm the mode and exit edit you have to hold the button 🙂

    Now for my naive question :
    I have a device that wants 12 volt 2A to work . Can I use ZY12PDN from a usb-c port of my laptop ,or I have to use a brick wall charger ?
    Initially I was looking for a usb step up dc , but I don’t think the wattage will be enough ,so I found ZY12PDN and then this place here 🙂

  21. November 3, 2020

    @zakis There’s no guarantee the USB-C port on your laptop supports USB-PD, less USB-PD source, less USB-PD source at 12V specifically, less USB-PD Source at 12V 2A (24W). Indeed, there’s no guarantee even a given wall wart supports USB-PD, it’d just be unusual to put a USB-C port on a charger that didn’t.

    Anyway, on your laptop, here’s the list of supported features in decreasing order of likilihood
    USB 5gbps (almost guaranteed)
    USB PD Sink
    USB 10gbps (less likely, but likely)
    USB PD source 5V (5V 3A)
    USB PD source 9V2A/12V1.5A (18W profile)
    USB PD source >18W
    USB PD source >30w (extremely unlikely).

    Spot-checking my own laptop just now, it looks like my macbook pro only supports 5V 3A. I would not expect to be able to run such a power-hungry device from a laptop USB-C port,

  22. November 9, 2020

    Hi alex.
    I’m making a DIY project with a combined power draw of 5V 4.8 amps. To supply power, I have used the newly launched Realme Dart power bank with specs ranging (5v/2A & 5V6A) through USB type A single interface output. But when I connect it to my PCB (which also has a PD trigger module set to 5V) , it just starts blinking a blue light after 3 seconds, & the circuit cuts off on the command input. Can you guide me on why this problem occurs, & also see if you give a solution where I can extract 5V6A from the said power bank?

  23. November 9, 2020

    To start, I don’t think you’ve got a prayer of getting 5V/6A out in any useful way. 6A will produce a TON of voltage drop on even a very good, high-current cable, and with only 5V, that voltage drop doesn’t have a lot of wiggle room before your device shuts off. I’m willing to bet that’s the problem you’re running into – as soon as your project starts drawing anywhere near the 4.5A you speak of, it browns out due to voltage sag. This is the reason that USB-C devices generally don’t support anything above 3A at 5V – even at 3A, the voltage sag is still quite high under the most ideal of conditions.
    Second, I’d be willing to bet the 6A rating is totally fake. I’ve certainly never seen a USB-C connector rated for 6A, and I’d be willing to bet if you try to run 6A through one, it’ll get quite worryingly hot.

    Reading through this review further leads me to assume the specs are fake: https://www.techradar.com/reviews/realme-30w-dart-charge-power-bank

    That says “30w, but only from one port. If you use both, the overall limit is 25W” which right there means you can’t possibly get 6A out. If you could get 5V 6A out of one port, there’s no reason you couldn’t get 5V 3A out of both at once.

  24. Tyson
    November 20, 2020

    Hi friend.

    Great write up!

    Do you know what the red blinking light means?
    I was hoping to use this with 3 X 2s lipo packs in series and output various pd standards up to 20v 5A.

    I realise now this device may be completely wrong, but K can find other uses for it if only I knew what the blinking red light means!

    More info: it briefly flashes the colour I chose before blinking red.

    Thanks a tonne.

    Tyson (Australia)

  25. November 20, 2020

    @tyson This definitely won’t work for that, this is a PD SINK only, and can’t source. I’m pretty sure blinking red means “you’ve chosen a voltage I can’t get a contract for.” For instance, if you set (and saved) 12v, and plugged this into a 12V capable PD supply, the LED would flash red (5V) then go solid green once the 12V contract was active. If you then unplug it and power it by a different supply that doesn’t support 12V output, I THINK then it’d flash red.

  26. Tyson
    November 20, 2020

    After a little more trial I think you may be right on the flashing.

    Also, I think I simply need a pd buck for my other project?

    Have a good day.

  27. Riveronland
    November 26, 2020

    Hi ,Alex:
    I’m using FUSB302 to make a PD2.0 voltage source recently. But I cannot read or write the FIFOs in reg adress 0x43 , I can only get 0x00. Can you can help me?

Leave a Reply

Your email address will not be published. Required fields are marked *