USB-OTG cable for Arduino Uno

Wouldn’t it be nice if you could hook up your Arduino to your Android tablet and use it as a command/debugging interface like ArduinoCommander does? If you want a USB connection instead of bluetooth, however, you will need to find a USB-OTG cable. This is because Android devices usually come with cables that treat those devices as slaves in the USB master-slave model. If you want to connect an Arduino (or any other USB device), the cable must somehow tell both devices who is host and who is slave. It turns out that all you need to do is short the ID pin to ground on the host side and leave it unconnected on the slave side. For pinouts, see the Wikipedia page.

USB_cable1Vcc and ground are on opposite sides. Pin 4 and 5 had to be shorted in the small gap under the pins (the tiny solder blob), since this mini USB connector does not expose pin 4. USB_cable2The finished mini USB host connector. This side connects to the Android host.
USB_cable3This side connects to the Arduino Uno. USB_cable4The finished cable. Would be nice to add a shield against interference from other devices.