How can a USB cable simultaneously charge a phone AND send data through it?


Edit: Thank you all for the answers!

In: Technology

A USB cable has multiple smaller wires in it, which connect to different pins within the connector and socket. Some of those wires send and receive data, and others are used to recharge the battery of the device. Some devices require more power than can be safely sent over USB, such as some models of external hard drive, which is why those devices have separate power cables.

Red color indicates the positive wire with 5 volts of DC power.
Black has always been the ground wire in almost all electronic devices.
White is the data as a “positive” wire, while
Green is also for the data , but as the negative wire.

That was taken from

The power and data simply use different wires

If you look at the plug of a the USB cable you’ll see it’s got 4 strips of metal.
Each of those strips plugs into a wire. The cord is actually 4 wires surrounded by a protector.
The left and right most strips carry power.
The middle two carry data.
There’s two for each because one is positive, the other is negative.

If you’re security conscious, you can slice open the protector.
The middle two (data) are connected to the white and green wire.
So if you cut those two, you can use the cable to charge from any random charger without worrying that someone is going to try installing things onto your phone via the wire.