barrel and usb wires

In the featured image, the cable on the left has a barrel end and a cut end. On the cut end there previously was a USB A connection that was rusted and corroded. This cable is for charging a toy.

The cable on the right has a USB A connection and the cut end had a USB C connection.

Can I simply match the colors of the wires to fix the barrel ended wire to the USB A wire? I.e. white and red from the barrel wire to the white and red on the USB A wire (which also has a black and green)?

Update: I believe that I could use the method described here 2 to determine which wires I should use from the USB A cable, however I am not sure which would be the positive or negative on the barrel cable.

  • 1
    \$\begingroup\$ Probably white goes to black, but if in doubt get a multimeter and measure it. \$\endgroup\$ Aug 24, 2023 at 0:35
  • \$\begingroup\$ Hm yes, I need a multimeter! Is there a safe way to test without one? I recall DC is positive/negative specific (if that's the right way to say it) so I wouldn't want to damage it. \$\endgroup\$ Aug 24, 2023 at 0:46
  • \$\begingroup\$ just connect the wires so that the resulting cable is the same as the old cable \$\endgroup\$
    – jsotola
    Aug 24, 2023 at 0:56

1 Answer 1


The USB standard states that:

  • Red is VCC
  • White is D-
  • Green is D+
  • Black is GND.

So, assuming that your barrel jack is standard (meaning the plus on the pin and minus on the barrel) and that your device use a standard jack, then, you should connect barrel white to USB black and barrel red to USB red.

To be 100% safe, you might want to do a continuity test on your barrel jack. Otherwise you are pretty much good to go.

Note, I don't know what the previous PSU looked like, but it is important that you don't over drive your USB ports (on a computer). In case you didn't know!

EDIT: A USB2.0 port is rated for 500 mA. Due to the great popularity of USB device, many manufacturer used the popular and cheap USB connector even if they require more then 500 mA. You can find USB power supply of 1 A easily. Your PC is most likely compliant on the USB standard, so plugging this in your computer might damage your USB ports.

  • \$\begingroup\$ That worked! Thanks for your help. Can you explain overdrive? \$\endgroup\$ Aug 24, 2023 at 18:19
  • \$\begingroup\$ Sure, I added ity to my answeR! \$\endgroup\$
    – Julien
    Aug 24, 2023 at 18:24

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.