How to wire a USB male port ? How to solder a USB male plug?

This photo explains it all. If the direction in which you plug it in is away from you, then the pins are positive (VCC 5+V), Data-, Data+, and negative (ground).

The red wire (by tradition) is positive. It connects to the left-most pin. The negative or the ground (black) wire goes to the last pin. I did not use data pins as my project deals only with voltage, not data.

If you get this right, then you can figure our how an USB female port is connected. If the direction in which the female USB accepts the male USB plug is towards you then, the left-most pin is ground (negative) and the right-most or last pin is positive.

How to wire a male USB port

How to wire a male USB port