Understanding USB Charging Cable Wiring
USB charging cables use four wires, typically colored red, black, white, and green. Red is VBUS — that's your 5-volt power line from the charger. Black is ground, the return path. White and green are the data lines, D+ and D-, and they're not actually needed for basic charging. If you just want something to charge, you can ignore those two entirely. That's one of the first things people figure out the hard way. The diagram itself is straightforward. At the USB-A end, you have the standard pinout: pin 1 is VBUS (red), pin 2 is D- (white), pin 3 is D+ (green), and pin 4 is ground (black). The USB-C side is different though, and that's where most people mess up. USB-C pins vary depending on which cable and which device you're working with, but the power delivery pins are consistently there. Pin 1 and pin 24 are VBUS on a full-size USB-C connector, and pins 20 and 21 are ground. The rest are signal and configuration pins that don't matter for a basic 5V charge. I spent three weeks troubleshooting a batch of custom charging cables for a prototype device back in 2022. The issue was that certain devices wouldn't charge past 0.5 amps even though the cable looked fine physically. Turns out the device was reading the CC (configuration channel) pins and refusing to draw more current without a proper handshake. Simple fix was adding 5.1k ohm pull-down resistors on the CC pins, but it took me tearing apart half a dozen cables before I realized the problem wasn't resistance or continuity — it was the protocol negotiation. If you're building a cable that needs to deliver more than slow charging, you can't just wire up power and ground and expect it to work on modern phones and laptops.
For basic charging at 5V and up to about 1.5 amps, wiring a USB cable is trivial. Strip the jacket, identify the four conductors by color, solder red to VBUS, black to ground, and you're done. But here's what most guides don't tell you: wire gauge matters more than people think. A typical USB charging cable uses 28 AWG for the power wires and 26 AWG for data. If you're running anything close to the 2.4 amp limit that many phone chargers push, 28 AWG will start heating up noticeably over lengths longer than 30 centimeters. That voltage drop is why your phone charges slower through a long extension cable. The math is basic Ohm's law, but people rarely check it before buying bulk cable by the spool. There's also a common mistake with the shielding. USB cables have a foil or braid shield around the twisted pairs, and it's usually connected to the USB metal shell at both ends. In theory this is fine for noise reduction. In practice, connecting it at both ends creates ground loops that can interfere with charging in environments with poor electrical grounding. I've seen this with DIY setups near welding equipment and fluorescent ballasts — the charge would stutter or reset repeatedly. The workaround is to connect the shield on only one end of the cable, usually the charger side, and leave it floating at the device end. You lose a bit of EMI protection but you eliminate the ground loop problem entirely. USB-C added another layer of complexity because the connector is reversible and the roles can flip. A USB-C to USB-C cable that supports Power Delivery will have resistors already embedded in the connector housing on the CC lines. These resistors tell the connected devices what the cable is capable of — whether it's handling 3 amps or 5 amps. If you're making a custom cable and skip these resistors, the devices will fall back to the most conservative charging profile, which is usually 1.5 amps or less. You might think you've wired everything correctly when the real issue is just a missing resistor. Checking the resistance between CC1 and ground with a multimeter before you finish the build saves a lot of headaches.
If you need a reference diagram, the USB-IF publishes official pinout documentation, but it's dense and written for engineers. For practical purposes, a simple schematic showing VBUS and GND on both ends with the data lines labeled but marked as optional for charging-only use covers 90 percent of what people actually need. Anything beyond that — fast charging, Power Delivery, alt modes for display output — requires reading the full spec or using a pre-certified cable. There's no shortcut around that part. The biggest bottleneck with DIY USB charging cables isn't the wiring. It's the connectors. Cheap USB-A plugs and USB-C housings from random suppliers on marketplaces have poor contact pressure and misaligned pins. I once spent two days trying to figure out why a cable failed intermittent charging tests when the problem was a $0.15 connector with a warped metal shell. Spend the extra money on connectors from distributors like Mouser, Digi-Key, or Samtec. The price difference is maybe fifty cents per unit but the reliability difference is the difference between a cable that works for a year and one that works until you bend it the wrong way. Below is a basic reference diagram for a standard USB-A to USB-C charging cable at 5V.
Get the Full Details

USB-A (Male) USB-C (Male)
Pin 1 VBUS (+5V) Red Pin 1 VBUS
Pin 4 GND Black Pin 20 GND
Pin 2 D- White Pin 19 CC1 (optional)
Pin 3 D+ Green Pin 18 CC2 (optional)
Note that the white and green wires are shown for completeness but can be left unconnected if the cable is charging-only. If you're working with USB-A to USB-A cables, the pinout is identical on both ends and data lines serve the same purpose. Micro-USB follows the same red-black-white-green convention but with five pins instead of four — the fifth pin is ID, which grounds when a cable is plugged in to tell the host it's a downstream port. That pin is also irrelevant for pure charging. One more thing nobody mentions: temperature. Lithium-ion batteries charge differently depending on how warm they are. If you're building a charging cable for something that operates in cold conditions, thicker wires and lower resistance connections matter more because the device may reduce charging current as a protective measure, and every bit of voltage drop from a high-resistance cable makes that problem worse. I learned this testing cables for outdoor equipment that sat in unheated enclosures. Upgrading from 28 AWG to 24 AWG for the power wires cut the voltage drop by roughly 60 percent and the devices accepted the charge without throttling. The cable is slightly less flexible but that's a fair tradeoff for something that needs to work reliably.