usb wiring connection

USB – How it Works

The easiest way to connect computer peripherals is through a Universal Serial Bus. The USB is a plug-and-play interface between the PC and the peripherals.
The main advantage of USB is that the device can be plugged in or plugged out without the need of restarting the PC 🙂

USB is the short form of Universal Serial Bus, a standard port that helps to connect computer peripherals like scanner, printer, digital camera, flash drive and more to the Computer. The USB standard supports the data transfer at the rate of 12 Mbps.

Related Products: Connectors | Connector Other Connector Audio and Video Connector Power 

usb flash drive

USB Specification

Two important aspects are its support capability and total bandwidth. It is capable of supporting 127 devices and has a total bandwidth of 12 Mbit per second which is equal to 1.5 MB per second. Working of a 12 Mbit (full speed device) or a 1.5 Mbit (low speed devices) depends on the total bandwidth of the USB.

USB 2.0 has a maximum signaling rate of 480 Mbit/s and USB 3.0 has a usable data rate of up to 4 Gbit/s (500 MB/s). Who knows what the future reserves?

USB Connections

Each USB device uses the standard A type connector to the USB host or Hub through A type receptacle. The other end of the cable has series B connector which is used to plug into the B type receptacle.

usb AB connectors

A connector is used for the upstream connection towards the host and B connector for the downward stream to the USB device. When the device is connected to the PC, it activates the host to recognize it. The PC detects the device and manages a control flow between the device and computer.

PC also manages the data transfer between the device and PC. Once detected, the PC sends data to the USB system software to recognize it which then identify the device and assign an address. This address is used to detect the particular USB device. The software controls the input and output data between the PC and device. If the software fails to assign the address, PC will not detect the device.

usb receptacles

USB A, B 2.0 and 3.0 Cable Pinout

The USB cable provides four pathways- two power conductors and two twisted signal conductors. The USB device that uses full speed bandwidth devices must have a twisted pair D+ and D- conductors. The data is transferred through the D+ and D- connectors while Vbus and Gnd connectors provide power to the USB device.

usb pinout

usb A&B male & female pinout

usb 3 pinout

usb 3 female pinout

USB A Wiring Connection

The USB cable has typically four wires to connect the A type connector

Pin 1 Red +5V
Pin 2 White D-
Pin 3 Green D+
Pin 4 Black GND

usb wiring connection


The USB Hub is used to connect many devices to the PC using a single USB connector. The hub can detect the attachment or detachment of devices in each port of the Hub. It also distributes power to all the devices connected to it and also detects low speed and full speed devices.

usb hub

It has two components – A Hub controller and a Hub repeater. The controller enables the Hub to communicate with the PC for configuration and control of devices attached to it. The repeater has hardware support for reset, suspend and resume signals.

I recommend you to use a hub with an external power supply if you want to connect more than 2 or 3 devices because they will absorb a large amount of current and the USB port cannot provide it by itself.

USB Flash Drive

The most commonly used USB device is the Flash drive the commonly called Pen drive. It is a mass storage device capable of functioning like a hard disk of computer.

inside usb flash drive

article updated and edited by P. Marian on Oct 15, 2014


Join the conversation!

Error! Please fill all fields.
  • Aziz

    I would like to know a PCB design with components for a flash disk which have USB & OTG ports option.


    Thanks for the wiring info! I found mistakes in text books where for argument sake they had the resistor colouring codes mixed up! I did make the correction in the book and told the librarian as this confuse the beginners. So we are just human but before criticising

  • P. Marian

    I have updated the article with the female USB pinout and USB 3 also and wrote under each image what it represents, maybe you’ll understand now.

  • DanAdamKOF

    Your USB wire/color image is INCORRECT! D+ and D- should be reversed. Note that this image is one of the first to appear when you Google Image Search for USB pinout!!!

    • P. Marian

      Please accept my apologies, I didn’t read your comment carefully the first time, afterwards saw your comment with the picture (it was pending for approval). I just updated the article with a picture of an USB cable and its (probably) correct wiring connection.

      D Mohankumar, the author of this article, is not an active member of this website because he made many mistakes.

    • FrankCastleAZ

      Wow. Let me get this straight.

      People come and give you the correct answer in comments so you don’t mislead your readers and anyone else who sees your photo high up in a Google Image search. You tell them they are wrong without doing research to see they are actually correct. They correct you again. You fix the problem and then tell them not to come back any more.
      Doesn’t seem like you have much professionalism on the journalism side.

      How about a response of “Thanks for clearing that up guys, I appreciate your input!”

      Bottom line. I’m glad to have informed you to make the change and potentially helped others make the same mistake I made years ago.

    • P. Marian

      If the information is wrong please visit other websites and don’t come here again, ok?

    • FrankCastleAZ

      What? LOL are you kidding me?!?! How do you run a website like this with this lack of knowledge. I dare you to find ANY PCB with any USB cable that would work correctly if you followed your colors correctly. Male or Female connectors mean nothing when it comes to the Green and White data lines.
      Go ahead, google search USB colors and what the D+ and D- lines are on every website in the world besides yours.

    • P. Marian

      Probably you do not know that there 2 types: female and male USBs (like any other connector), that is why you think this is wrong. The one presented in the picture is the male cable (you can see the cable clearly) and the pinout is correct.

  • FrankCastleAZ

    Your USB colors have been wrong for years. Just spoke with a buddy who followed your site and he soldered cables on wrong. I bring up Google image search occasionally to see usb colors for green and white and every time I see your image I know to do opposite.
    change it. I can’t imagine how many people have screwed up cables because of this image.

  • Pedro

    Hello Dr.Mohankumar:
    I know USB is patented and you need to pay even if u want to experiment with the USB port even if having educational/non-profit applications. But I was wondering , which is completely legal, I had heard about using USB port with Linux to a pheripheral which can be controlled with those ATMEL USB interface chips (I don’t know the exact family).I’m not sure if they come with a driver, I guess so, but I read (don’t remember where, sorry) that the code registred that appears in ur PC is the atmel chip one. HAve you heat about that??

    On the other hand, doing a USB to RS232 interface could be the other way to doing a project of making my own peripheral. But, does it implies driver problems?? How can I now control the USB port here???

    Many Thanks