All About USB-C: Power Delivery

USB-C eliminates proprietary barrel plug chargers that we’ve been using for laptops and myriads of other devices. It fights proprietary phone charger standards by explicitly making them non-compliant, bullying companies into making their devices work with widely available chargers. As a hobbyist, you no longer need to push 3 A through tiny MicroUSB connectors and underspecced cables to power a current-hungry Pi 4. Today, all you need is a USB-C socket with two resistors – or a somewhat special chip in case the resistors don’t quite get you where you want to be.

You get way more bang for your buck with USB-C. This applies to power too; after all, not all devices will subsist on 15 W – some will want more. If 15 W isn’t enough for your device, let’s see how we can get you beyond.

Reaching Higher

USB-C power supplies always support 5 V and some are limited to that, but support for higher voltages is where it’s at. The usual voltage steps of USB-C are 5 V, 9 V, 15 V and 20 V ; 12V support is optional and is more of a convention. These steps are referred to as SPR, and EPR adds 28 V, 36 V and 48 V steps into the mix – for up to 240 W; necessitating new cables, but being fully backwards and forwards compatible, and fully safe to use due to cable and device checks that USB-C lets you perform.

A charger has to support all steps below its highest step, which means that 20 V-capable chargers also have to support 5 V, 9 V, and 15 V as well – in practice, most of them indeed do, and only some might skip a step or two. You can also get voltages in-between, down to 3.3 V, even, using a PD standard called PPS (or the AVS standard for EPR-range chargers) – it’s not a requirement, but you’ll find that quite a few USB-C PSUs will oblige, and PPS support is usually written on the label. Continue reading “All About USB-C: Power Delivery”

All About USB-C: Resistors And Emarkers

If you’ve been following along our USB-C saga, you know that the CC wire in the USB-C cables is used for communications and polarity detection. However, what’s not as widely known is that there are two protocols used in USB-C for communications – an analog one and a digital one. Today, let’s look at the analog signalling used in USB-C – in part, learn more about the fabled 5.1 kΩ resistors and how they work. We’ll also learn about emarkers and the mysterious entity that is VCONN!

USB-C power supply expects to sense a certain value pulldown on the CC line before it provides 5 V on VBUS, and any higher voltages have to be negotiated digitally. The PSU, be it your laptop’s port or a charger, can detect the pulldown (known as Rd) because it keeps a pullup (known as Rp) on the CC line – it then checks if a voltage divider has formed on CC, and whether the resulting voltage is within acceptable range.

If you plug a device that doesn’t make a pulldown accessible through the CC wire in the cable, your device will never get power from a USB-C port, and would only work with a USB-A to USB-C cable. Even the smarter devices that can talk the digital part of USB-C are expected to have pulldowns, it’s just that those pulldowns are internal to the USB-C communication IC used. A USB-C port that wants to receive power needs to have a pulldown.

This part is well-known by now, but we’ve seen lack-of-resistor failures in cheap devices aplenty, and the colloquial advice is “add 5.1 kΩ resistors”. You might be afraid to think it’s so simple, but you’d be surprised. Continue reading “All About USB-C: Resistors And Emarkers”

Showing a USB-C tester running the DingoCharge script, charging a battery pack at 7V. To the right is a battery pack being charged, and a USB-C charger doing the charging.

Use USB-C Chargers To Top Up Li-Ion Packs With This Hack

In USB-C Power Delivery (PD) standard, the PPS (Programmable Power Supply) mode is an optional mode that lets you request a non-standard voltage from a charger, with the ability to set a current limit of your choice, too. Having learned this, [Jason] from [Rip It Apart] decided to investigate — could this feature be used for charging Li-Ion battery packs, which need the voltage and current to vary in a specific way throughout the charging process? Turns out, the answer is a resounding “yes”, and thanks to a USB-C tester that’s programmable using Lua scripts, [Jason] shows us how we can use a PPS-capable USB-C charger for topping up our Li-Ion battery packs, in a project named DingoCharge.

The wonderful write-up answers every question you have, starting with a safety disclaimer, and going through everything you might want to know. The GitHub repo hosts not only code but also full installation and usage instructions.

DingoCharge handles more than just Li-Ion batteries — this ought to work with LiFePO4 and lithium titanate batteries, too.  [Jason] has been working on Ni-MH and lead-acid support. You can even connect an analog output thermal sensor and have the tester limit the charge process depending on the temperature, showing just how fully-featured a solution the DingoCharge project is.

The amount of effort put into polishing this project is impressive, and now it’s out there for us to take advantage of; all you need is a PPS-capable PSU and a supported USB-C tester. If your charger’s PPS is limited by 11V, as many are, you’ll only be able to fully charge 2S packs with it – that said, this is a marked improvement over many Li-Ion solutions we’ve seen. Don’t have a Li-Ion pack? Build one out of smartphone cells! Make sure your pack has a balancing circuit, of course, since this charger can’t provide any, and all will be good. Still looking to get into Li-Ion batteries? We have a three-part guide, from basics to mechanics and electronics!

Showing the same thumbdrive plugged into the same USB-C port in two different orientations, enumerating as two different USB ports

Dirty USB-C Tricks: One Port For The Price Of Two

[RichardG] has noticed a weird discrepancy – his Ryzen mainboard ought to have had fourteen USB3 ports, but somehow, only exposed thirteen of them. Unlike other mainboards in this lineup, it also happens to have a USB-C port among these thirteen ports. These two things wouldn’t be related in any way, would they? Turns out, they are, and [RichardG] shows us a dirty USB-C trick that manufacturers pull on us for an unknown reason.

On a USB-C port using USB3, the USB3 TX and RX signals have to be routed to two different pin groups, depending on the plugged-in cable orientation. In a proper design, you would have a multiplexer chip detecting cable orientation, and routing the pins to one or the other. Turns out, quite a few manufacturers are choosing to wire up two separate ports to the USB-C connector instead.

In the extensive writeup on this problem, [Richard] explains how the USB-C port ought to be wired, how it’s wired instead, shows telltale signs of such a trick, and how to check if a USB-C port on your PC is miswired in the same way. He also ponders on whether this is compliant with the USB-C specification, but can’t quite find an answer. There’s a surprising amount of products and adapters doing this exact thing, too, all of them desktop PC accessories – perhaps, you bought a device with such a USB-C port and don’t know it.

As a conclusion, he debates making an adapter to break the stolen USB3 port out. This wouldn’t be the first time we’re cheated when it comes to USB ports – the USB2 devices with blue connectors come to mind.

All About USB-C: Introduction For Hackers

We’ve now had at least five years of USB-C ports in our devices. It’s a standard that many manufacturers and hackers can get behind. Initially, there was plenty of confusion about what we’d actually encounter out there, and manufacturer-induced aberrations have put some people off. However, USB-C is here to stay, and I’d like to show you how USB-C actually gets used out there, what you can expect out of it as a power user, and what you can get out of it as a hobbyist.

Modern devices have a set of common needs – they need a power input, or a power output, sometimes both, typically a USB2 connection, and often some higher-speed connectivity like a display output/input or USB 3. USB-C is an interface that aims to be able to take care of all of those. Everything aforementioned is optional, which is a blessing and a curse, but you can quickly learn to distinguish what to expect out of a device based on how it looks; if ever in doubt, I’d like to show you how to check.

Continue reading “All About USB-C: Introduction For Hackers”

On the left, four through-hole USB-C connectors laid out on a purple cutting mat. On the right, a teardown picture shows that there's neither resistors nor CC connections inside such a connector, resulting in consequences described in the article.

The USB-C Connectors You Never Knew You Wanted To Avoid

On Tech Twitter, some people are known for Their Thing – for example, [A13 (@sad_electronics)], (when they’re not busy designing electronics), searches the net to find outstanding parts to marvel at. A good portion of the parts that they find are outstanding for all the wrong reasons. Today, that’s a through-hole two-pin USB Type-C socket. Observing the cheap tech we get from China (or the UK!), you might conclude that two 5.1K pulldown resistors are very hard to add to a product – this socket makes it literally impossible.

We’ve seen two-pin THT MicroUSB sockets before, sometimes used for hobbyist kits. This one, however, goes against the main requirement of Type-C connectors – sink (Type-C-powered) devices having pulldowns on CC pins, and source devices (PSUs and host ports) having pull up resistors to VBUS. As disassembly shows, this connector has neither of these nor the capability for you to add anything, as the CC pins are physically not present. If you use this port to make a USB-C-powered device, a Type-C-compliant PSU will not give it power. If you try to make a Type-C PSU with it, a compliant device shall (rightfully!) refuse to charge from it. The only thing this port is good for is when a device using it is bundled with a USB-A to USB-C cable – actively setting back whatever progress Type-C connectors managed to make.

As much as USB Type-C basics are straightforward, manufacturers get it wrong on the regular – back in 2016, a wrong cable could kill your $1.5k MacBook. Nowadays, we might only need to mod a device with a pair of 5.1K resistors every now and then. We can only hope that the new EU laws will force devices to get it right and stop ruining the convenience for everyone, so we can finally enjoy what was promised to us. Hackers have been making more and more devices with USB-C ports, and even retrofitting iPhones here and there. If you wanted to get into mischief territory and abuse the extended capabilities of new tech, you could even make a device that enumerates in different ways if you flip the cable, or make a “BGA on an FPC” dongle that is fully hidden inside a Type-C cable end!

It’s Super Easy To Build Yourself A USB-C Variable Power Supply These Days

Once upon a time, building yourself a power supply required sourcing all manner of components, from transformers to transistors, knobs, and indicators. These days, everything’s a bit more integrated which helps if you’re trying to whip something up in a hurry. This build from [Ricardo] shows just how straightforward building a power supply can be.

The build is a simple mashup, starting with a ZY12PDN USB Power Delivery board. This board talks to a USB-C supply that is compatible with the Power Delivery standard, and tells it to deliver a certain voltage and current output. This is then used to supply power to a pre-built power supply module that handles current limiting, variable voltage output, and all that fancy stuff. It even comes with a screen built-in! Simply slap the two together in a 3D printed case with a couple of banana plugs, and you’re almost done.

All you need then is a USB-C power supply – [Ricardo] uses a portable power bank which allows him to use the power supply on the go. It’s a great alternative to a traditional heavy bench supply, and more than enough for a lot of hobby uses.

We’ve seen a lot of interest in USB Power Delivery recently, and its likely hackers will continue to enjoy the standard for some time to come. If you’ve got your own USB PD hack, be sure to let us know!