124
\$\begingroup\$

What is the extra, 5th, pin on micro usb 2.0 adapters for?


Here is an image with the different connectors. Most of them have 5 pins, but the A-type host only has four.

USB Connectors
(source: wikimedia.org)

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Type B connector only has 4 pins, too. A and B were the original type before OTG was invented. \$\endgroup\$
    – endolith
    Aug 1, 2016 at 18:55

7 Answers 7

111
\$\begingroup\$

It's for On-The-Go, to select which device is the host or slave:

The OTG cable has a micro-A plug on one side, and a micro-B plug on the other (it cannot have two plugs of the same type). OTG adds a fifth pin to the standard USB connector, called the ID-pin; the micro-A plug has the ID pin grounded, while the ID in the micro-B plug is floating. The device that has a micro-A plugged in becomes an OTG A-device, and the one that has micro-B plugged becomes a B-device. The type of the plug inserted is detected by the state of the pin ID .

OTG ID

\$\endgroup\$
7
  • 8
    \$\begingroup\$ And since a Type-A connector is nearly always host it doesn't need to have a 5th pin? \$\endgroup\$
    – Sponge Bob
    Jul 10, 2012 at 22:42
  • 10
    \$\begingroup\$ If you mean a standard 4-pin Type-A plug, this would be used for a permanent host - you wouldn't use this in an OTG device. The ID pin is only used if the device can change between host and slave. For standard USB the ID pin is just left disconnected in the device. \$\endgroup\$
    – Oli Glaser
    Jul 10, 2012 at 23:28
  • 2
    \$\begingroup\$ @SpongeBob Also, OTG didn't exist when the Type-A connector was created. \$\endgroup\$
    – endolith
    Aug 1, 2016 at 18:54
  • 6
    \$\begingroup\$ It might be helpful to "restate the obvious": before the cable is attached, both devices in the illustrated scenario are eligible to be a host or slave device. It is when the cable is connected that the device attached to the A-end of the cable becomes the host, and the device attached to the B-end of the cable becomes the slave. In situations where a device is always intended to be a host device, the mini-A and micro-A connectors exist that will only accept the A-end of the OTG cable. In such situations, the device is explicitly a host device. \$\endgroup\$
    – Toybuilder
    Oct 7, 2018 at 5:16
  • 2
    \$\begingroup\$ Also should be mentioned that Micro-A connectors essentially don't exist. Manufacturers ignored the spec and used Micro-B for both ends. electronics.stackexchange.com/a/242575/142 \$\endgroup\$
    – endolith
    Aug 13, 2020 at 13:15
39
\$\begingroup\$

To complete Oli Glaser's answer, 5 pins USB respects the On-The-Go standard (OTG). The additional pin added to the conventional USB port is the ID pin added to the 4th electrical pin, and allow to recognize the device. Here is the resulting electrical setup of the pins:

  1. VDD (+5V)
  2. D- (Data-)
  3. D+ (Data+)
  4. ID (ID)
  5. GND (Ground)

As compared to other 4-pins USB devices, where there is no ID pin, the advantage is to be able to distinguish the host device from slave devices.

  • Host: ID connected to GND
  • Slave: ID not connected (floating)

Host-Slave Schematics

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You probably also need to clarify which side is driving VBUS. \$\endgroup\$
    – 0andriy
    Mar 18, 2021 at 17:53
  • 2
    \$\begingroup\$ It is always the Host Device that is providing the voltage for the VBUS. \$\endgroup\$ Mar 20, 2021 at 21:27
  • \$\begingroup\$ Yes, but it’s not clear from your answer. \$\endgroup\$
    – 0andriy
    Mar 21, 2021 at 10:09
  • \$\begingroup\$ This is more of an electrical standard and not a USB Standard. My answer does not specify which device is actually connected to the ground neither, if this is a floating ground, etc. \$\endgroup\$ Mar 25, 2021 at 15:21
6
\$\begingroup\$

There is no info carried by the 4th pin. When connected to the ground (5th pin) it serves to notify the host that it is connected to a dumb-client device instead of a smart-client device. This is confusing at best because some client devices only act as dumb-clients and some client devices can be either smart-client, another peer-host, or a pass-through repeater. You will probably only ever see OTG actually used in case of a keyboard being plugged into the micro or mini connector on a tablet computer. Other client devices usually have enough inherent software capability to notify the host that they are a client using the normal 4-wire USB connection.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ There is information carried here, just not "data" -- the information comes in the form of whether or not the ID pin is shorted to ground. This can be used by devices which can serve either as clients or (OTG) hosts. It may not be used for transmitting data from one side of the cable to the other, but it does provide information. Pedantic, perhaps, but in situations like this, it seems to me that such distinctions matter. \$\endgroup\$
    – lindes
    Jan 29, 2021 at 19:48
5
\$\begingroup\$

It's for host:client negotiation.

Permits distinction of host connection from slave connection

host: connected to Signal ground

slave: not connected

source

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I'm a real newbie when it comes to serial connection. I've only just started using RS232... Can you please explain a little more? \$\endgroup\$
    – Sponge Bob
    Jul 10, 2012 at 22:35
3
\$\begingroup\$

Before USB OTG was popular, the 5th pin was an auxiliary pin to allow the USB port on portable devices to be used for other purposes via passive components/circuits. A resistor array in the cable would indicate the function of the cable to circuitry in the device. Sometimes this could be a composite TV out, but it was mostly used for audio. Manufactures HTC and Motorolla did this audio out on many phones, with different pinout schemes.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ I don't think that the spec was ever defined for that, any use of the 5th pin is probably out of spec eh? @Alichen? \$\endgroup\$
    – Voltage Spike
    Sep 23, 2016 at 20:05
2
\$\begingroup\$

As shown here the original type A and B connectors use four connections, D+ and D-, which are differential data signals, along with ground and +5v. The newer mini and micro connections add an ID signal.

\$\endgroup\$
1
  • 5
    \$\begingroup\$ Ok, so what info does the ID signal carry? When does it use the ID pin? \$\endgroup\$
    – Sponge Bob
    Jul 10, 2012 at 22:37
1
\$\begingroup\$

None of the answers are quite correct/complete.

From Microchip FAQ on the subject:

Below is a general guide for connecting the USBID pin from a microcontroller:

USB HOST role
    The USBID pin (microcontroller): unconnected
    ID pin (USB connector): connected to ground
USB OTG role
    The USBID pin from microcontroller: connected to ID pin (USB connector)
USB DEVICE role
    USBID pin (microcontroller): connected to ID pin (USB connector)
    or
    USBID pin (microcontroller): unconnected and ID pin (USB connector): unconnected

So you should NOT leave the ID-pin floating if you've got OTG functionality in mind for your tablet or whatever. In that case connect it to the ID pin on the Micro-B (*) connector. The OTG cable grounds the ID pin unlike a regular USB cable so your tablet knows to expect that USB stick on the other end of the cable which requires power etc.

Basically if the ID signal going to processor signal is grounded, that device wants to supply power to the USB and initially behaves as the host. The roles can then be reversed by negotiation over the USB but that's off your hands as the hardware designer unless you dapple in firmware as well.

Presumably the ID pin should have a pull-up either internally or externally on the OTG device but the datasheets are vague on the subject.

(*) According to the standard it should be really be a Micro-AB connector which can take both A and B plugs and A-connector should indicate OTG usage. In reality you're probably dealing with a Micro-B plug to USB-A socket cable.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.