I am new to circuits and electronics. I was building a portable mobile charger(Battery Bank) an had to connect a USB port. The tutorial I was watching had 2 wires , Red for +ve and White for -ve. The USB connector I have has 4 wires , Green , Yellow , Blue and Black. Can you help tell me which one +ve and which one is -ve. It would be of great help ! Thanks !
-
\$\begingroup\$ Use a multimeter or continuity tester to identify to which pin of the USB connector ("plug") each wire belongs. Then you can identify what each pin is using this: en.wikipedia.org/wiki/USB#Pinouts \$\endgroup\$– 0x6d64Commented Jun 3, 2015 at 10:17
1 Answer
Beyond red and black (and even then not all the time - sometimes black is hot and not ground) there are no standards. If it's cheap USB cable you are not even guaranteed the same coding between batches - the machine that makes the cable doesn't care what colour is in spool #2.
If you are buying a USB cable and cutting the B end off, your options are limited to getting a multimeter and checking the continuity. Every time.
Electronics supply shops just might have breakout cables available - A-connector on one end, red and black tinned leads on the other, ready for assembly.
-
\$\begingroup\$ +1 for cheap cables not bothering with colours - I took one apart for a project way back and it used Red for GND, Green for +5V and Black/White for the D+/D- pair! \$\endgroup\$ Commented Jun 3, 2015 at 13:19