No, as much as it might be needed, this column doesn’t address how to deal with the numerous frenetic projects that we are tasked with handling every day or how this interrupt-driven life affects productivity and quality of life (not to mention the quality of our work). On-the-Go is an extension to the Universal Serial Bus (USB) standard,1 more commonly seen as USB OTG. We’ll forgo trying to determine who came up with a name like this and, instead, take a look at some of the fascinating things it allows us to do.
With the base USB standard, a device is classified as either a host or a peripheral device. Generally, the host, such as your PC, was the controller and the peripheral, such as a USB drive, responded to its commands. While a superficial examination of OTG behavior might suggest that this extension adds peer-to-peer capability to USB devices, this is not the case. The original host/peripheral model is maintained. What is new is the addition of a new class of devices that can function as either a host or peripheral and are referred to as dual-role devices. The function of a dual-role device, i.e. host or peripheral, can be swapped using the Host Negotiation Protocol (HNP).2
To enable an OTG connection, you must either use an OTG cable to connect the devices or, for directly connected devices, one of them must be physically configured to mimic the OTG cable connection. It might be clearer to think of the later configuration as two USB devices connected with a zero length OTG cable. You will frequently encounter this later configuration with dual interface USB memory drives. They typically have an OTG micro A-Type connector on one end and a standard USB A-Type connector on the other. When connected with an OTG cable, the initial host device is designated the A-Device, with the initial peripheral designated the B-Device.
To avoid potential conflicts regarding which device is host and which is peripheral, the assignment of which device is A or B is determined by the orientation of the OTG cable. This cable determines whether the signaling pin of the port it is plugged into is left floating or is pulled to ground. The device with the signaling pin pulled to ground is designated the A-Device, or default host, and the device with the floating signaling pin is designated the B-Device, or default peripheral. If this configuration is incorrect, such as a printer being designated as the A-Device and your smart phone being designated as the B-Device, you could either reverse the cable (if all of the connectors matched) or use the HNP protocol to swap configurations, since the drivers for the printing process are on the smart phone, thus, it must be the host. This swapping normally occurs transparently, and the user is never even aware of it.
USB ports on many, if not the majority, of smart phones and tablets sold today support OTG. The question now becomes ‘So what?’. In practical terms, what’s the big deal? The big deal is that, now, instead of your PC being the host and your phone being connected to it as a peripheral, you can make your phone the host and connect other USB peripherals to it. Tired of having to tap your screen and perform precision placement of the pointer with your finger? Plug in a USB mouse. Tired of entering information into your phone using its touch screen, even if it allows Swipe input? Plug in a USB keyboard. Now, you might be somewhat perplexed at first regarding how to connect multiple USB devices to a smart phone or tablet that only has one USB port, but it’s not hard. Instead of plugging your devices directly into the phone, you can connect a USB hub to the phone using a USB OTG cable, and plug your other devices into the hub.
There is an extremely diverse list of vendors manufacturing and selling USB OTG cables and adapters. Prices may range from less than a dollar to over $20 for a single cable/adapter. However, the quality of the devices from these vendors also is highly variable, and the correlation between quality and price is frequently not 1-to-1. A good example of some of the OTG cables available from well-known vendors is the USB On-The-Go (4-in-1) Kit from Cirago (Model: OTG4000, Cirago, $17.99). While this kit is not the cheapest out there, it provides a range of solid OTG connectivity options. These are as diverse as:
- Micro-USB A-Type Male to Micro SD Card Reader
- Samsung Galaxy 30-pin to UBS 2.0 Adapter (30 pin Male to USB Type A Female)
- Micro-USB to USB 2.0 Adapter (Micro-USB Type A Male to USB Type A Female)
- Micro-USB to USB 3.0 Adapter (Micro-USB 3.0 Type-A Male to USB Type A Female)
Now, while an un-powered USB hub connected in this fashion can draw enough power to support the use of a mouse, keyboard and even a USB memory stick, the USB OTG specification restricts the maximum amount of current the host device can provide to as little as 8 mA.3 That is insufficient to power the more power-hungry USB peripherals, such as a USB hard drive. Even if the port could supply sufficient power, you’ll quickly notice that these additional peripherals accelerate the drain on your already limited battery. However, there is no need to abandon hope as you pass through the gates of OTG. If you use a powered USB hub and plug your devices into the hub, it can power the devices, lessening the drain on your smart phone or tablet. A good example of this type of device is the MicroUSB OTG 3-Port Hub with Card Reader available from Brando Workshop (Product Code: UHUBS038800, Brando Workshop, $15), which features an integrated OTG cable.
The fact that you can’t charge your device when its USB port is otherwise occupied still limits the duration that you can work before you have to plug your charger into the device. Even here there is hope, as the USB Power Delivery (PD) v2.0 specification1 allows charging over the USB cable while other devices are being used. In principle, this means that you could charge your device through an appropriately designed powered USB hub, but the number of hubs that support this part of the specification are currently very limited. Also, keep in mind that the host mobile device that you would like to charge from the peripheral hub has to support this function as well.
Fortunately, while I have been unable to identify any actual manufacturer names, there are many vendors out there who have taken full advantage of this extension. It is easy to locate vendors selling OTG Y-cables that allow you to attach your device charger to the OTG cable, enabling you to charge your device while still accessing attached peripherals. Care should be taken when selecting one to purchase, though, as they are not all configured the same way. The reputable vendors will include a disclaimer if this power is only routed to the peripheral device and not to the host. Unfortunately, not all of the vendors are so honest. It may be that the reason many prominent manufacturers don’t produce their own Y-cable is because the cables are actually very simple.
You can find many tutorials on the Web describing how to create your own USB OTG cables from unused USB cables that you might have on hand. For those who enjoy figuring out how to do it on their own, it is possible to download just a schematic of the modifications.4 For those wishing a little more guidance, you can find full descriptions ranging from the general process5,6 to the step-by-step.7,8 Of course, the holy grail of this cable creation is to construct your own OTG charging Y-cable, and there are tutorials for that as well.9,10 It turns out that hacking your own Y-cable is not much more difficult than hacking a basic USB OTG cable. Please note, if you do attempt to make your own OTG cable, you are assuming all risks. X-acto knives are very sharp, and it is very easy to short conductors when soldering these small connectors. My best advice is to take your time and test your connections with a multimeter before performing any smoke tests.
Perhaps the most pressing question now becomes, does your device support USB OTG? There are a number of ways of determining this. The easiest place to start is flipping through the manual for your device. Unfortunately, this is not a definitive test, as some devices have been released claiming to support it, but have faulty implementations. Another way to tell is to look for the appropriate USB Implementers Forum approved logo, shown above. A more accurate way is to actually test your device using one of the various USB apps in the Google Play store, such as USB Host Diagnostics from Chainfire. Note that, to complete testing, you frequently must already have a USB OTG cable on hand. An additional caveat is that even if it supports OTG, your device may not include the drivers for a specific device. For example, some smart phones might be able to access a mouse and keyboard, but not an external USB hard drive. Also, even if the vanilla version of a device supports OTG, this might have been disabled by the network provider. Bottom line? Assume nothing, check everything.
There are times you may need to take your laptop along because of the requirement for specific programs, but even the lightest laptop gets to be a pain when traveling. In many circumstances, you can easily perform business and other tasks on a smart phone or tablet, you just need to bring along your OTG Y-cable and desired peripherals. This greatly reduces the weight you have to carry around, usually without giving up any functionality. I’ve written many a document this way and strongly recommend you give USB OTG a try. I believe you’ll find it is an exercise that will return many benefits.
1. USB.org – USB 3.1 Specification. USB.org. http://www.usb.org/developers/docs/ (accessed Dec 20, 2014).
2. USB On-the-Go Basics – Tutorial – Maxim. Maxim Integr. 2002; published online Dec 20. http://www.maximintegrated.com/en/app-notes/index.mvp/id/1822 (accessed Dec 13, 2014).
3. USB On-The-Go; A tutorial – NXP Semiconductors (75016113.pdf). http://www.nxp.com/documents/leaflet/75016113.pdf (accessed Dec 13, 2014).
4. OTG DIAGRAMS – 50N1C.3OOM.W0RLD. https://sites.google.com/site/sonicboomworld/my-projects/otg-diagrams (accessed Dec 21, 2014).
5. Hildenbrand J. Weekend project: DIY USB on-the-go from old cables | Android Central. Android Cent. 2012; published online Sept 9. http://www.androidcentral.com/weekend-project-diy-usb-go-old-cables (accessed Dec 21, 2014).
6. Smith C. What is USB OTG (On-The-Go): How to Make Your Own OTG USB Cable | Premium USB Blog. Prem. USB Blog. 2012; published online July 12. http://blog.premiumusb.com/2012/07/what-is-usb-otg-on-the-go/ (accessed Dec 13, 2014).
7. Out-of-the-box. Make a USB OTG host cable. The easy way! Instructables. http://www.instructables.com/id/Make-a-USB-OTG-host-cable-The-easy-way/ (accessed Dec 13, 2014).
8. Shannon T. Make Your Own USB On-The-Go (OTG) Cable | MAKE. Makezine. http://makezine.com/projects/usb-otg-cable/ (accessed July 22, 2014).
9. Pultar E. External Sensors + Charging w/ Android USB aka Micro USB Host OTG Y-Cable w/ Power. Instructables. http://www.instructables.com/id/External-Sensors-Charging-w-Android-USB-aka-Micro-/ (accessed Dec 13, 2014).
10. redoano. [GUIDE] How to make otg cable with external p… | HTC Sensation | XDA Forums. XDA. 2012; published online Aug 11. http://forum.xda-developers.com/showthread.php?t=1828032 (accessed Dec 22, 2014).
John Joyce is a laboratory informatics specialist based in Richmond, VA. He may be reached at editor@ScientificComputing.com.