12
\$\begingroup\$

I want to power my DIY stuff with a MacBook Pro USB C charger. The label on a charger says that it can provide three different power profiles: USB-C charger specs

  1. 20.2V - 4.3A
  2. 9V - 3A
  3. 5.2V - 2.4A

There is a ton of information about what USB-C power distribution is capable of, but I can't find any examples of how exactly to do it.

Is there an easy way or workaround to request one of those power profiles without using a microcontroller?

For example, I got apple MacBook Pro charger, apple USB-C cable, and a breakout board like this one: USB-C simple breakout board

\$\endgroup\$
1
  • 3
    \$\begingroup\$ An easy workaround is to use a USB PD trigger module. Go for a few dollars on the usual import friendly and reseller sites, ebay, Ali, amazon etc. \$\endgroup\$
    – Passerby
    Dec 2, 2018 at 3:33

6 Answers 6

14
\$\begingroup\$

In a word, no. You need to implement the USB Power Delivery protocol through the CC line of the Type-C connector and that's a two way communication at 300kbps complete with preamble, CRC and so on that is pretty much impossible to do without a microcontroller.

The PD message format looks like this:

enter image description here

For full details you'll need the USB Power Delivery specification, but there's a useful introduction here which is where the diagram above came from.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ +1. This is only the physical format of communication packet. There are several more layers of logical protocols one needs to obey before the charger outputs 20 V. \$\endgroup\$ Mar 13, 2018 at 16:30
  • \$\begingroup\$ @AliChen I added this purely to show the level of complexity that needs to be implemented and illustrate the point that without a microcontroller it's a non-starter. \$\endgroup\$
    – Finbarr
    Mar 13, 2018 at 17:17
  • 1
    \$\begingroup\$ Woah, does this mean that the cheap $4 USB-C charger I bought, which claims that it can output 5V/9V/12V, has some sort of a small computer and software to handle all this communication? I underestimated it. \$\endgroup\$ Oct 21, 2020 at 13:04
  • 1
    \$\begingroup\$ @DamnVegetables That's exactly what it means. Though "computer" is being generous, it's probably a single custom chip that handles the whole thing. Simple microcontrollers can be bought for less than 10 cents each. \$\endgroup\$
    – Finbarr
    Oct 21, 2020 at 19:23
4
\$\begingroup\$

It's complicated but doable. There's someone who has implemented exactly that and offers the PD buddy sink on tindie:

https://www.tindie.com/products/clayghobbs/pd-buddy-sink/

Code:

https://git.clayhobbs.com/pd-buddy/pd-buddy-firmware/src/branch/master/docs/console_config.md

Hackaday project site:

https://hackaday.io/project/20424-pd-buddy-sink/details

\$\endgroup\$
3
  • \$\begingroup\$ amazing, i will try this \$\endgroup\$
    – George
    Dec 3, 2018 at 13:30
  • \$\begingroup\$ I've used "Clara Hobbs' PD Buddy Sink" - works perfectly.. best option out there.. and programmable via an serial interface terminal with a few easy lines of code.. Don't be scared.. usbc for your project is fine \$\endgroup\$ Jan 9, 2019 at 19:27
  • \$\begingroup\$ Of course it is doable. Why do you think many silicon manufacturers offer ICs that do PD communication? So someone who knows what he is doing did this board, with 5 ICs including 32-bit microcontroller, and sells for $30 apiece. \$\endgroup\$ Apr 29, 2019 at 17:18
3
\$\begingroup\$

As Finbarr noted, you need to implement Power Delivery communication protocol to negotiate the 20 V output profile. The PD specification was designed by a community of more than 300 fine engineers from top semiconductor and software companies. It took 3 major revisions and about 5 years of work to come up with current functional standard. Trying to implement the protocol from scratch (as Finbarr seems to suggest) is an obviously losing proposition.

However, there is a solution at DIY level. Due to horrible protocol complexity, several semiconductor companies offer a set of ICs that embed the PD protocol, a turnkey solution. To start, look at overview of PD solutions at TI, and select proper cluster.

You already have the functional PD source. So you need to select "Device UFP" and "Sink". You will have about 5 variants of ICs performing the function of PD controllers, something like TUSB422 or TPS65981. Unfortunately, the IC will need some control over I2C interface to perform the actual negotiation, so you will need some microprocessor with some software support for PD. They should offer development kits with full examples how to do this.

So, good luck.

EDIT: Other companies as NXP, Maxim, Linear, Cypress, ON Semi, STMicro, might offer controllers with pin straps (with no microcontrollers), but you need to search for this.

\$\endgroup\$
3
\$\begingroup\$

I've just completed a board based on STUSB4500 which is super easy to use requiring only a few passive externals (no custom firmware needed). Will be open sourcing the design soon as well.

You only need an Arduino to flash the chip once with your voltage/current requirement and it will negotiate with the charger automatically.

EDIT: The new version of the board can be configured via web browser.

\$\endgroup\$
1
  • \$\begingroup\$ Wow, that looks neat. \$\endgroup\$
    – George
    Sep 30, 2020 at 13:30
0
\$\begingroup\$

Is there an easy way or workaround to request one of those power profiles without using a microcontroller?

In theory: yes, you could make a circuit using standard logic chips to emulate the protocol and "fool" the charger to output more than 5 V. This will be a very complex circuit though and will require some reverse engineering and detailed study of the protocol. Since this is an Apple product, it might not strictly adhere to the public standards either.

In practice: no as a microcontroller will offer much more flexibility than a bunch of logic chips. Also precise timing will be much easier to achieve.

But for both cases: I do not think it is worth the effort to do this in the first place. It will be much cheaper and much less effort to buy a power adapter which will output the voltage you require.

Also, there is the risk that you somehow break or damage the adapter. Then you have no way of charging your MacBook until you buy a new adapter. Since this is an Apple product, that might not be cheap. So why risk that?

\$\endgroup\$
0
\$\begingroup\$

Now in 2024 you can buy usb power monitor..brand is FNIRST model FNB58. This provides PD protocol communication and can be used as a "go between" usb port and device to request higher voltages. Simply plug module into your PD enabled USB port, select QC2, or QC3 etc, list of voltages will appear. Select the one you want. You can return to voltage / current display while leaving the new higher voltage on the output. Plug in your device or make your connection, and away you go. You can buy USB A to alligator clip leads from Ali Express or make your own if you need to use it to power circuits.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.