Chapter 16. USB

USB seems to be well know but Android devices have some additional USB features. The original USB connector has 4 pins and has a clear direction host to slave devices. Originally Android devices acted as slave devices. USB connector are relatively simple and therefore robust and are almost the only connector on a android device beside the headset connector. Having a tabled device rises the issue, that sometimes it should act as a host (when connection a memory device and sometimes acting as a slave when connection to a PC. A solution would have to be adding two USB connectors for that. But an other implementation OTG (on the go) allows acting on demand as slave or host. Mini and micro USB connectors have an additional pin and have therefore 5 pins. The device that has set this pin to ground acts as host.


It is not clear how a cable having a standard USB 4 pin connector on one side and a mini or micro connector on the other side is wired. Some have the fifth pin connected to ground others have it unconnected. Such cables not having the fifth pin connected to ground can not be used to charge a modern OTG device, since the device might act as host.

An other problem is that android devices are usually not rooted. This means no changes to the kernel and no additions of device drives can be added. On a PC attaching a USB device as a DVB-T USB receiver requires a driver to be installed, but this is not allowed not having root permission. Additionally the Android device might be a USB slave and the device driver is written for a USB host. To have a solution android has the Accessory Mode. The Android device kernel supports this and acts therefore as a link to the applications. On the USB level the Android device acts still as slave, and therefore the peripheral device connected to the android device needs to act as USB host. Additionally the peripheral device needs to have the accessory mode protocol implemented. This sounds complicated an is probably. However there are solutions available as the FT311D chip from FTDI that acts as Android accessory device and allows to attach electronic components without any need of doing programming on the peripheral device.

The fifth pin of the micro USB plug can have more functionalities by having a resistor toward ground, it can identify additional states. An interesting state is an android device might enter accessory mode acting as USB slave but still supply power to the accessory.

Some other standards make use of the USB Plug to use it as audio, video or headset output.

Linurs Servernest startpage