#0009: Brief guide to creating a USB OTG cable
What is a USB OTG cable?
USB “OTG” stands for USB “On The Go”. USB On-The-Go is a specification of the USB protocol that allows traditionally slave devices such as smart phones, to act as master devices or host systems (e.g. personal computers) when connected to either other slave devices such as digital cameras and printers; or peripherals such: USB storage disks or human interface devices (e.g. keyboard and mouse).
USB plug classifications.
There are a myriad different types and generations of USB cables available on the market today. However most obey the convention of having two different plug-socket configuration in each class specification. A type-A plug and socket for connecting with the host system (a.k.a. “A” device), and a type-B plug and socket for connecting with the slave (or “B”) device. A standard USB cable will have one male type-A plug and one male type-B plug. A USB OTG cable differs from a standard USB cable in only one significant way. The standard USB type-A plug is replaced with either a USB Mini type-A or USB Micro type-A variant. That’s it.
For example to connect a generic modern printer to a smart phone with a USB Micro type-AB socket. One would need a male USB Micro type-A to male USB type-B cable. The replacement of the USB type-A with a USB Micro type-A is what makes it an “On The Go” configuration. This means you don’t need a traditional PC to use the printer. You can connect directly with and use the mobile device to send the files to the printer in it’s stead.
Limitations of the USB OTG specification.
A device with OTG enabled capabilities unfortunately can not act as a general purposes host system with the same peripheral compatibilities as a personal computer. Instead they are given a Targeted Peripheral List (TPL) from their manufacturers. This is a rather limited list of general peripherals designed to work with the particular device for it’s expected use cases. This is because these devices will have limitations on them such as power output or limited supported protocols.
Unfortunately, as I see it; with the innumerable amounts of devices (smart phones, tablets, etcetera) and peripherals (with various protocols and power draws) on the market today: the best way to find out whether or not a peripheral is compatible with your particular device – is to just plug it in and see. This is also true for finding out whether or not your device supports the USB OTG functionality in general. Some might not.
I tested a couple of smart phones I had on hand, and of the four I had, only one actually supported OTG functionality. The other three simply didn’t register the peripherals (including a basic USB thumb stick) plugged into them. These were: (2011) Samsung GT-I5500, (2012) HTC Chacha, (2015) Huawei GRA-L09, and (2018) Blackview A30. Of them only the Huawei GRA-L09 worked with my OTG cable. It performed perfectly with the wireless USB keyboard-mouse combo, and the thumb drive I tested with. The Huawei even allowed connections to the other smartphones (using a Micro type-A to Micro type-B cable). It could charge the other devices, register on their end as connected to a host, but not allow access to their filesystem like a PC would allow. This last thing could be a software limitation, that will require some further tinkering to work; or possibly using some kind of third-party file browser or peripheral manager. Long story short, when it comes to compatibility: your mileage may vary.
Creating a USB Micro OTG cable.
The USB OTG specification was originally created for use with mobile devices that utilised the USB Mini standard, and later updated to include the USB Micro standard. We will create an OTG cable by modifying a Micro type-B plug to a Micro type-A plug. Then using it to create a male USB Micro type-A to USB (full size) type-A socket. This is to connect basic low power USB peripherals such as storage drives or a wireless mouse and keyboard combo. Which is my particular use case. However it should be stated that the same modifications can be made to a USB Mini type-B plug to turn it into an OTG enabled Mini type-A plug.
To create a basic USB Micro OTG cable is actually rather simple. All you essentially need to do is short the ID pin (pin 4) on the USB Micro type-B plug to ground (pin 5). This procedure effectively (i.e. electrically) turns the Micro type-B plug into a Micro type-A plug.
Unfortunately in my case, my kit USB Micro plugs only came with 4 soldering pads (for the power and data lines). It was missing a solder pad for the ID pin. This meant I couldn’t just run a small jumper from the ID pad to the ground pad. I instead had to access the ID pin directly. On one hand this makes creating the OTG cables that require some resistance value between the ID and the ground pin significantly harder. Due to no room for the resistor. However if you intend to just create a basic cable, then this method of just bridging the ID and ground pin can be useful for salvaged USB Micro plugs who in all likelihood won’t have an ID solder pad.
With this in mind, I disassembled a kit USB Micro type-B plug. Next I scraped the covering plastic on pin 4 and 5, then soldered a bridge across them. I removed the plastic to create space and headroom for the solder bridge. Otherwise, I may be unable to slide the plug head (with it’s plastic inner lining) back on. Space constraints need to be paid attention to. Reassembled the plug. Then tested for continuity using a multimeter and a USB Micro type-B socket breakout board. Id est making sure that pin 4 is grounded, and that the solder bridge wasn’t coming off.
Please note, there are other methods for creating OTG cables that involve running a specific resistor across the ID and ground pins for certain devices to work, or to enable the host and/or peripheral device to draw power from an external power source. However I am omitting them, for brevity. This is a quick guide to build a basic DIY OTG cable.
I decided to make the pictured OTG cable modular using breadboard jumper cables. The reason for this is because I intend to mix and match various plug and socket ends to create different types of cables. However, I would recommend making a more fixed and permanent cable for actual real-world use.
Modular OTG cable example
Tooling and material example
Disassembly and modification of a USB Micro type-B plug
Modular male Micro type-A to female USB type-A OTG cable in use
Modular male Micro type-A to male Micro type-B OTG cable in use
References / Sources / Further Reading:
- https://en.wikibooks.org/wiki/Serial_Programming/USB#What_is_USB?
- https://en.wikipedia.org/wiki/USBhttps://en.wikipedia.org/wiki/USB_hardware
- https://en.wikipedia.org/wiki/USB_On-The-Go
- https://en.wikipedia.org/wiki/USB_(Communications)#Signaling_state