close-circle
Close
0%
0%

PD Buddy Sink

Smart power jack for USB Power Delivery

Similar projects worth following
close
USB Power Delivery is a cool standard for getting lots of power—up to 100 W—from a USB Type-C port. Being an open standard for supplying enough power to charge phones, laptops, and just about anything else under the sun, USB PD is poised to greatly reduce the amount of e-waste produced worldwide from obsolete proprietary chargers. Unfortunately, like all USB standards, it's quite complex, putting it out of reach of the average electronics hobbyist.

PD Buddy Sink solves this problem, letting any hacker or maker use USB PD in their projects. Think of it as a smart power jack. To use it, first configure a voltage and current via the USB configuration interface. Then whenever the Sink is plugged in to a USB PD power supply, it negotiates the power your project needs and provides it on the output connector.

The Idea

One day I was digging through a box of wall warts, trying to find one that would work for my latest project. I needed one with 12-16 V output at no less than 0.5 A, and with a reasonable output connector. Untangling cords and checking labels was taking a while, and I started thinking. "If I could use USB Power Delivery, I wouldn't ever have to do this again." Since USB PD power supplies can provide a multitude of voltages at sizable currents, all you'd need is a little circuit board that takes the place of a power jack and tells the power supply what your project needs.

I searched the web, and to my surprise, no such device was available! I realized that I would have to create it myself, so I started figuring out the device's requirements. It would be a small circuit board with a USB Type-C connector on one side and a screw terminal block for power output on the other. When plugged in, an on-board microcontroller would negotiate the power for your project. For simplicity and flexibility, the configuration should be done by USB. To avoid drawing excessive power, the output would have to be controlled by a MOSFET so as to only turn on once negotiation is complete.

A couple days later, I had a hardware design. A couple weeks later, I built a prototype, and the first PD Buddy Sink was born.

PD Buddy Sink

PD Buddy Sink is a smart power jack for USB Power Delivery. Configure it with the voltage and current your project needs, then plug it into any USB PD power supply with a high enough power capability. It negotiates with the power supply and turns on its output, giving your project up to 3 A at 5, 9, or 15 V, and up to 5 A at 20 V.

PD Buddy Sink is simple to configure. Just plug it into a computer while holding the setup button, and connect to the USB CDC console interface. Alternatively, use the (still experimental) configuration GUI.

Project Status

Done

I developed the first PCB prototypes (v0.1) in early February 2017, and built them mid February. This design had a few errors, which were fixed in v0.2.  The next revision (v0.3) was a complete redesign for automated assembly.  This got a few more optimizations for the first stable release, v1.0, released in mid-July 2017.

The PD Buddy Sink's firmware is stable, with a few more features planned. It provides a USB serial console interface for editing and saving configuration, and is able to negotiate with power supplies to request fixed voltages and currents. An option for GiveBack is available, which allows the power supply to reduce power temporarily if another device needs more. The firmware allows users to control PD negotiations and show the power supply's capabilities while in Setup mode. In support of these features, I designed a splitter board which allows users to connect the Sink to their computer and an external USB power supply simultaneously.  To the best of my knowledge, the PD Buddy Sink is compliant with the USB Power Delivery Specification, Revision 2.0, Version 1.3.

Documentation for the configuration API is available, allowing developers to produce libraries and applications for configuring the PD Buddy Sink. I have written a small Python library for this purpose, providing both direct and abstracted access to the serial configuration API. A basic configuration GUI has been implemented using this library and GTK+, allowing users to edit and save configuration, control the Sink's output, and view the power supply's capabilities in an easier way than the console interface. It also displays a list of all connected PD Buddy devices, in case several are plugged in to the computer at once.

In Progress

I'm a bit busy with other stuff currently, but I'm working on adding support for USB PD programmable power supplies.  This is a new feature in USB PD 3.0 that allows the Sink to request any voltage out of a wide range (up to 3-21 V).  It'll be a considerable amount of work, mostly due to the protocol changes in PD 3.0, but I don't expect...

Read more »

pd-buddy-sink_grb_drl_1.0.zip

PD Buddy Sink PCB gerbers and drills, version 1.0

Zip Archive - 61.75 kB - 10/08/2017 at 23:02

download-circle
Download

pd-buddy-sink_sch_1.0.pdf

PD Buddy Sink schematic, version 1.0

Adobe Portable Document Format - 152.70 kB - 10/08/2017 at 22:59

eye
Preview
download-circle
Download

  • 1 × PD Buddy Sink v1.0 PCB 1.6 mm thick, 1 oz copper all layers
  • 1 × 1 μF 0603 25V C1
  • 1 × 2.2 μF 0603 C2
  • 8 × 0.1 μF 0402 C3, C4, C5, C6, C7, C8, C10, C11
  • 2 × 1 μF 0402 C9, C12

View all 22 components

  • New Configuration for Firmware 1.2.0

    Clayton G. Hobbs10/06/2017 at 16:57 0 comments

    With support for programmable power supplies planned in firmware version 1.2.0, I realize that new configuration will be required.  First of all, this is because USB PD programmable power supplies allow voltages to be requested at 20 mV increments, while fixed PDOs can only be at 50 mV increments.  To support both of these, I'll have to change the configuration to hold voltages at some common denominator: probably either 10 mV or 1 mV.  This means upgrading to firmware 1.2.0 will break your configuration, and there's not a lot I can do about that short of an extra backwards-compatibility code path that in the long term won't see much use.  I'm not crazy about that idea, and the documentation never said the configuration would persist through firmware updates, so I'll probably just warn users about the change when I make the release.

    Next, something will have to be done to allow the Sink to get power at less-desired voltages.  For instance, maybe you'd really like to run your project at 13.8 V, but anything from 11-16 V would work as well.  It would suck if setting the Sink for 13.8 V meant it absolutely can't work with older supplies that only offer the standard fixed voltages.  My idea then is to let users set a preferred voltage, and an optional range of acceptable voltages.  If the preferred voltage is not available, the Sink will try to make a request for some arbitrary acceptable voltage instead.

    EDIT: The arbitrary selection would almost certainly either favor lower or higher voltages, and I can imagine situations where either of these would be preferred.  Accordingly, I should probably let the user choose between the two.

    This raises the question of how much current to request.  It's easy to just set a single current when only a single voltage can be requested, but with a whole range available I can think of several modes that would make sense.  One would just be to request a constant current at all voltages in the range.  Another would be to request a constant power, so that higher voltages come with lower current.  A third would be resistive load mode, where the user sets a resistance and the Sink requests the current required at whatever voltage, so that higher voltages come with higher current.

    That about sums up my plans for the new configuration for programmable supplies.  I'd like to hear feedback on this, so if you have any comments please let me know.  In particular, I want to make sure there aren't any use cases I've missed, e.g. modes other than constant current/power/resistance, or maybe something to do with voltages.  Once I feel confident the ideas are all in place, I'll design the new configuration API.

  • Sinks for Sale

    Clayton G. Hobbs09/23/2017 at 15:53 0 comments

    Yes, the latest batch of PD Buddy Sinks just arrived from @MacroFab!  There are twenty in this batch, and they've all been listed on Tindie.  Will this be a repeat of last time?  The STM32F072C8U6 still has shaky availability (what the heck, ST?), so part of me hopes it won't be.  The rest of me hopes it will be, because that might mean I have a hit product on my hands.
    I sell on Tindie

  • USB PD Programmable Power Supply: How to obtain?

    Clayton G. Hobbs09/07/2017 at 15:22 0 comments

    In my quest to make the PD Buddy Sink the best possible device for getting power from USB PD chargers, the next step is to add support for more types of PDO.  I still don't know any chargers that advertise variable or battery PDOs, but I just found evidence of one that supports the very exciting Programmable Power Supply PDO from USB PD 3.0: https://www.diodes.com/assets/Evaluation-Boards/QC4-27W-Class-A-Reference-Design-User-Guide-Release-1.0.pdf

    Now the question is, "how the heck do I get one?"  I haven't found any evidence that these exist beyond the linked PDF and some Chinese articles that don't seem helpful.  If anyone out there can tell me how I could get my hands on one of these evaluation boards, I'd really appreciate it!

  • Easily view a charger's capabilities with PD Buddy Sink+Wye

    Clayton G. Hobbs09/04/2017 at 20:48 0 comments

    Since firmware version 1.1, it's been possible to view the capabilities of a USB Power Delivery source using the PD Buddy Sink.  And since the PD Buddy Wye was released, it's been possible to view a standalone charger's capabilities by running the Sink in setup mode while connected to the charger.  But the way the GUI showed the capabilities was lacking: they were presented exactly the same as the console gives them!  Obviously this couldn't be the best way to show capabilities in a GUI, so I got to work on a new design.

    Read more »

  • PD Buddy Wye available on Tindie!

    Clayton G. Hobbs08/29/2017 at 17:45 0 comments

    The PD Buddy Wye power/data splitter is now available on Tindie!  If you have a PD Buddy Sink and want to make full use of the new features in firmware version 1.1, I encourage you to check it out!

    I sell on Tindie

  • PD Buddy Sink v1.0 was briefly in stock

    Clayton G. Hobbs08/07/2017 at 21:28 0 comments

    A few hours ago, a batch of ten PD Buddy Sink boards arrived from @MacroFab.  They're all beautiful, and I photographed them and listed nine on Tindie promptly.  As I was preparing to write a post about them over here on Hackaday.io, I saw that three had already sold.  When I finished packing those, four more had sold.  When I finished packing those, the last two had sold!  Running out of inventory quickly isn't a bad problem to have, all things considered.

    I've ordered another batch, so they'll probably be back in stock in three to four weeks [Edit: the microcontrollers used aren't available currently, so it'll be longer than that].  Here's hoping they'll continue to sell this well, so I can keep ordering even larger batches in the future!

  • Power/Data Splitter Not Needed

    Clayton G. Hobbs07/27/2017 at 19:39 0 comments

    I started looking at ways to make the power/data splitter described in the last post, and the situation didn't look good.  I didn't want the side that plugs into the PD Buddy Sink to have a female connector because I don't know how e-marked cables would like being chained together.  However, all the male connectors I found either had to be reflowed, which I'm not capable of doing at home, or require 0.8 mm PCBs, which I can't find a way to get for under $50 in under 3 weeks.  I really don't want to spend that much or wait that long, so I had to think of another way.  I thought about hacking apart two USB cables, but again, I'm not sure how e-markers would like that.  What to do?

    Well, I have two v0.1 PCBs lying around unused.  They've already been hacked on quite a bit to fix the schematic errors in that version, so a bit more ugliness wouldn't hurt anyone.  I decided to cut the USB D+/- traces and solder a USB cable's GND, D+, and D- wires to the board to have separate data and power connections.  After some tricky fine-pitch soldering, the ugly board came to life!


    After some testing, I've concluded that the problem I observed yesterday was in fact the fault of the Asus USB 3.1 UPD Panel, not the PD Buddy Sink.  This is welcome news, since it means I don't have a weird bug to track down and fix.  Now I get to go back to developing new features instead of quietly worrying!

    I still might design a power/data splitter board, since it could be useful to people other than myself.  But since I personally have no urgent need for one, I'll probably only make it if someone out there asks me to.

  • Working on Firmware 1.1, Power/Data Splitter Needed

    Clayton G. Hobbs07/26/2017 at 20:27 0 comments

    I'm currently working on the big new feature of firmware version 1.1, Power Delivery communications in Setup mode.  It's working partially, but not fully as planned yet.  The saved configuration is negotiated on boot in Setup mode, and any time the configuration is written to flash, a new contract is negotiated for the new power.  There's no way to control the output from the command shell yet, and I'd like the shell to be able to print information like the power supply's advertised PDOs, but what I've done so far is working well.

    Er, it's mostly working well, that is.  I'm testing simultaneous Power Delivery and USB data with an Asus USB 3.1 UPD Panel, a device which has a few quirks.  It uses the old USB Power Delivery voltages of 5, 12, and 20 V instead of the newer 5, 9, 15, and 20 V.  It also only offers 1.5 A at 5 V.  However, it offers a full 5 A at 20 V if the cable can carry that much current, so it's not a bad tool to have on hand.

    But there's one thing I've run into that I'm not sure whether to blame on the UPD Panel or the PD Buddy Sink's firmware.  When I reconfigure the Sink for 12 V and 20 V repeatedly, it happily gets those voltages as expected.  But sometimes when I configure it for 5 V, or configure it for something else when it was already configured for 5 V, power is lost entirely.  It seems unlikely that the PD Buddy Sink is at fault, since I'm not aware of anything in the USB PD spec that should cause the source to completely remove power until the sink is physically reconnected.  However, I'm not 100% sure I'm right about that, and I don't want to read all the way through a >500 page technical document to find the answer.  The easy way to test this would be to plug the PD Buddy Sink into a different power supply to see if the problem disappears, but I don't have another power supply that lets me communicate with the Sink via USB at the same time.

    The solution I've imagined is a USB Type-C power/data splitter.  It could be a funny Y-shaped cable, or a small PCB with 3 USB connectors.  One connector would be male, with power, ground, the configuration channels, and the USB 2.0 D+/- lines connected.  These would split off so that one female connector would have power, ground, and the configuration channels, and the other would have ground and the D+/- lines.  This device would allow me to plug the PD Buddy Sink into any power supply, including standalone ones, while communicating with it from a computer.

    I don't know if a device like this already exists, but I could design one easily enough.  If you know of anything like this, please let me know in the comments!  Otherwise, I'll be designing and ordering a PCB for one in a day or so.

  • PD Buddy Sink v1.0 Released!

    Clayton G. Hobbs07/19/2017 at 19:01 0 comments

    Get it while it's hot!

    The first PCB release considered stable! Very similar to v0.3, this release is optimized for lower cost while retaining all functionality of the previous release.

    • D1, Q1, Q2, and SW2 have all been changed to reduce the board's cost
    • Many reference designators have been moved closer to their components
    • The board's dimensions remain the same, including positions of the parts on the bottom

    Due to the last point, the programming jig did not require any changes in this release. I'll be placing an order for a medium quantity of these soon, and I expect to have them in stock on Tindie in 3-4 weeks. I'll hopefully be able to write firmware version 1.1 by then, which will allow the device to do Power Delivery negotiations in setup mode.

  • PD Buddy Sink v0.3 Now Available

    Clayton G. Hobbs07/06/2017 at 01:29 0 comments

    PD Buddy Sink v0.3 group shot

    The v0.3 prototype boards just arrived from @MacroFab, and boy am I pleased with the work they did! I programmed them with the programming jig that arrived from @oshpark a couple weeks ago, and they all work perfectly. There are still a couple minor changes I'll probably make before v1.0, but with this revision the PD Buddy Sink hardware is in essentially a finished state.

    You may notice that I didn't have MacroFab install an output connector. That's because I wanted to give people more connector options than before. The new boards can be purchased with no output connector, the screw terminals used before, or male header pins on the bottom or top of the PCB. I really like the header pins on the bottom, because they can be used to power a breadboard, as seen below.

    Two of the three v0.3 prototype boards are available on Tindie. If you miss out on these, don't worry: I'll be putting the finishing touches on v1.0 soon, so there will be even more PD Buddy Sinks available before long.

    PD Buddy Sink v0.3 with header pins (bottom), powering a breadboard

View all 23 project logs

  • 1
    Get a PD Buddy Sink

    This can be done by buying one on my Tindie store, or building one from parts.  Building a PD Buddy Sink involves standard surface mount assembly techniques (pick-and-place, reflow soldering).  Because of the USB connector, it's impossible to hand-solder the whole board, so buying one is the better option for most people.

  • 2
    Configure the Sink

    First, put the PD Buddy Sink into configuration mode by holding the "Setup" button while plugging it into your computer.  In this mode, the Sink runs a command shell on a virtual serial port, allowing configuration of the device and real-time interaction with a power supply.  Documentation for the command shell can be found here.

  • 3
    Use the Sink

    Once the Sink is configured, using it is as simple as plugging it into a charger!  The "Status" LED blinks quickly to show that Power Delivery communications are going on.  If the charger can provide the configured power, the Sink makes it available on its output connector and blinks the LED slowly three times to indicate success.  If the charger doesn't offer the power you wanted, the Sink provides no power to your device to prevent damage, and turns the LED on solid to indicate failure.

View all 3 instructions

Enjoy this project?

Share

Discussions

patrick wrote 11/04/2017 at 14:32 point

Hi Clayton,

just ordered one!

Been looking for a project like this for some while now in order to reduce the number of chargers/cables and accessories while traveling.

question, do you plan on enabling to switch/set the voltage on the fly without using the pc? Also is it possible to use the files to set the voltage on windows?

thanks!

Patrick

  Are you sure? yes | no

Clayton G. Hobbs wrote 11/07/2017 at 22:48 point

I don't plan on allowing the voltage to be changed without using a PC on the PD Buddy Sink, but once I make a development board based on the Sink (I'll probably start working on that mid-December) it would be easy to make it work that way.

I haven't tested the configuration GUI outside of Linux, but the serial configuration shell should certainly be usable from any OS.

Also, out of curiosity, where did you order one?  My Tindie store is in vacation mode right now, so it couldn't have been from me.  Are you going to build it yourself?

  Are you sure? yes | no

patrick wrote 11/08/2017 at 06:40 point

Thanks for the reply Clayton. Looking forwards to the next iteration! 

Ordered one a couple of weeks ago together with the Wye on your Tindie store....

  Are you sure? yes | no

Martin wrote 10/18/2017 at 09:11 point

Regarding the 20mV resolution vs. 50mV resolution: I would say for a PSU both is to fine. 100mV would be enough. Or stay with the 50mV and round it off to the next 20mV step. Thats a max. error of 10mV! I heavily doubt that the USB PSUs have such a precise reference anyway.

  Are you sure? yes | no

FloatingSpots wrote 09/15/2017 at 16:52 point

In one update that I read, I saw mention of the USB PD PPS and how to acquire one.

I ran across and Aukey product on Amazon that claims to conform to this standard.

 As usually happens, I cannot find the actual product on Aukey's site yet.

On Amazon, it is listed as AUKEY PA-Y10.

Says it supports PPS from 3-16 Vdc at 3 Amps.

Edit: Found a second AUKEY part that supports PPS. Listed as PA-Y8, but only supports 3-11 Vdc.

  Are you sure? yes | no

Clayton G. Hobbs wrote 09/17/2017 at 03:56 point

Holy moley, thanks for the tip!  I just ordered the PA-Y10 (more power is better, right? 😉), and it should arrive on Wednesday.  Then I get to work on adding support for Power Delivery 3.0, which may or may not be a huge amount of work.

EDIT: It will not be the huge amount of work I was afraid it could be.  While full support for PD 3.0 requires supporting chunked extended messages, the standard says, "If a PD Device or Cable Marker has no requirement to handle any message requiring more than one Chunk of any Extended Message, it May omit the Chunking Layer."  The only messages that require more than one chunk are for PD-based firmware updates, country-specific information, and authentication, none of which this device requires.  No chunking layer it is!

  Are you sure? yes | no

Glytch wrote 08/23/2017 at 21:22 point

Absolutely outstanding job. I've been looking for something *just* like this, as I have not the patience to dig into the USB PD standard at present. I see that they're out of stock and you're waiting for microcontrollers, but just to let you know, I have money set aside to order at least one, maybe two when you get more, and definitely more in the future. Very interested in switching to USB C for a lot of what I do, as its very applicable to my workflow and projects. From what I've seen, there's no other product or project even similar to this, so you certainly have my interest.

Keep up the great work!

  Are you sure? yes | no

Clayton G. Hobbs wrote 08/23/2017 at 23:23 point

Thank you very much for the kind words!  I may start working on a development board based on the Sink soon, and prototypes of it could actually be available before the Sink itself is.

  Are you sure? yes | no

Glytch wrote 08/23/2017 at 23:31 point

Awesome stuff! Would be neat to be able to connect an OLED or LCD and some buttons or encoders and setup a mode select or variable voltage system. That particularly fits my interests.

  Are you sure? yes | no

oshpark wrote 04/18/2017 at 01:45 point

Very interesting project!

  Are you sure? yes | no

Andrew Bolin wrote 03/21/2017 at 04:25 point

Hey, I had almost the same idea recently, but you've actually built it!
If you stick it in a box with one of those cheap DPS3005 type regulator modules you could probably take some money from me ;)

  Are you sure? yes | no

Clayton G. Hobbs wrote 03/21/2017 at 14:28 point

That would be a pretty cool idea. It would be better to use one of the buck-boost versions, like a DPH3205, so it's not limited by the 20 V maximum voltage of USB PD.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates