My power output board had a USB-A socket because the first thing I wanted to automate was charging a Pixel 3a phone. It is not my primary phone, so it usually sits and slowly drains its battery until I remember to charge it up again. Draining a battery to empty isn’t good for longevity but I also don’t want to leave it on the charger all the time either. (The latter is liable to accelerate battery problems like swelling.) So I want to use Home Assistant+ESPHome and automate charging the phone for a few hours a day.
The initial test using an USB-A socket wired directly to the +5V plane of the board that also fed the on-board ESP32. Using a USB-A to USB-C adapter cable, I could charge the phone slowly at the baseline 2.5W (5V at 500mA) of USB power. A good start! But I didn’t want to use a bulky USB-A socket and tie up a perfectly good USB-A to USB-C cable for this purpose. I thought I could use one of my retired USB-C cables. Its insulation has hardened with age and broken up right at the plug due to insufficient strain relief.
We can see the outer protective sheath is broken, exposing the wires within. I no longer trust this cable for tasks like data transfer or USB-C high power delivery, but I thought maybe it can still be used for low power USB charging if I wired it up like it was a USB-A to USB-C cable. Since this is a USB2 cable with type C connectors, I had expected to find the usual wires of an USB2 cable: red for +5V, black for GND, green for D+ and white for D-. I cut it open and this is what I found instead:
Wrapped inside the outer metal mesh and foil I found:
- Wires without insulation, presumably GND.
- Not one but FOUR red wires. Two of them a slightly thicker gauge than the other two.
- Green and white wires as expected for D+/D-
- Yellow wire for…?
On the Wikipedia page for USB-C I found this color-coded chart. It does show four pins for Vbus which probably corresponds to the four red wires. Uninsulated wires are likely GND. Green and white are probably D+/D- as originally anticipated. And it shows yellow as the recommended color for Vconn, power supply for powered cables.
This is a cheap USB2 cable with Type-C ends, so I doubted it was a powered cable. Elsewhere on the same page was this chart describing what’s expected for USB-C cables in USB2 mode. It didn’t list anything that would explain the yellow cable. There’s an option for CC (configuration channel) but that’s supposed to be blue. Perhaps this yellow wire is CC? I need a way to probe the pins on my Type-C connector to know exactly what the yellow wire is connected to, but I don’t have a breakout board for that purpose on hand. Perhaps something like this item? (*) I’ll put that on my shopping list.
In the meantime I’m going to leave those wires alone and do the basic USB2 thing: tie all red wires together and put +5V on them, with all the uninsulated at ground. This was enough for basic USB power on my USB tester, an older USB-C phone (Moto X4), and an ESP32 camera board with USB-C. But it didn’t work for the Pixel 3a. What else is that phone expecting?
On the page for USB Power Delivery, I saw a section that said a dedicated charging port should have a resistance not exceeding 200Ω across the D+/D- line. I soldered a resistor across green and white wires and… still no response from the Pixel 3a.
In hindsight that was a risk: what if the green and white wires weren’t D+/D-? I had no way to verify that assumption and I could have destroyed my phone trying to cheap out on a cable. So I stopped my experimentation until I have a better handle on type C connectors. Experiments like adding termination resistors or following pinout guides will have to wait. Maybe in the future I can determine why a Pixel 3a is unsatisfied with simple red +5V/black GND scheme, but at least I know M5Stack’s ESP32Cam was fine with it.
[UPDATE: I bought the USB-C breakout board linked above for the next round of experiments. Includes more information about how 5V power over USB-C is managed by a pair of voltage dividing resistors. I can now control Pixel 3a charging rate between 0.5A and 1.5A.]
(*) Disclosure: As an Amazon Associate I earn from qualifying purchases.