Android devices are inexpensive and offer high performance, but lack serial ports.


The problem: Top Hat running on Android does not support RS232 data connections to loggers, except via bluetooth. So, it can't connect to most soaring varios, loggers or Flarms without bluetooth radios.

Additionally, in a sailplane, you usually need an external power supply for your Android device (i.e. a cable) for long flights. It would be optimal if a single cable can power the Android and connect it directly to your loggers, Flarms and varios.

The solution: Top Hat supports RS232 on Android via an IOIO connector board. This page describes how to connect your Top Hat or XCSoar Android device to your serial logger(s).

More recently, the IOIO OTG box was released which is compatible with more devices.

Updated 1/20/2012: The IOIO has two outputs, one at 5v and one at 3.3v. The diagrams below use the IOIO's 5v output to the Max3232 board. This was mistakenly labled 3.3v.

2/22/2012: Please feel free to register and post photos and descriptions of your devices that demonstrate improved or changed ways to do this. Does anyone have an example of a two-port box? How about a four-port box?

3/9/2012: Should I use Max232 or Max3232? Answer: either. The Max3232 is a newer version of the Max232. see
http://en.wikipedia.org/wiki/MAX232

4/30/2012: If I have a logger (Colibri2) which puts out a ttl level serial signal from a mini-USB connector, and an android device (Nook Simple Touch) which takes in a TTL level serial channel through its micro-USB port, couldn't I just make a crossover cable, where I tied tx to rx, and +5v to both sides and ground to both sides?
A: With a Colibri2, LX Nano or other logger that outputs ttl level serial signal, you still need the IOIO box, but you will not need the Max3232 chip. You can connect the ttl cable directly to the IOIO pins 3 and 4.

7/3/2013: the Nook Simple Touch EInk reader works with the IOIO OTG board. It does not work with the older IOIO V1 boards. Click here for more information on the Nook.


Q: Should I use the older "IOIO V1" board or the newer "IOIO OTG" board?
A: Unless you're using a Nook, we recommend using the IOIO V1 board instead of the IOIO OTG because it generates less RF interference on aircraft radio frequencies. Most Android phones can use either IOIO board. The Nook can only use the IOIO OTG. Click here to learn how to build an IOIO OTG box with no RF interference for the Nook.

Parts required:

Item--------------------------------------------------
Cost-------
Where to buy---------------------------
IOIO V1 board (or IOIO OTG board for Nook users)
(See page about IOIO OTG board power supply).
$40
https://www.sparkfun.com/products/11343
Max3232 RS232 (Serial) to TTL (USB) converter board
$5
http://shop.ebay.com/i.html?_nkw=max232+converter&_sacat=0&_odkw=max232+usb+serial
Plastic enclosure box
$5
http://www.mouser.com/Search/ProductDetail.aspx?R=PC-11476virtualkey56310000virtualkey563-PC-11476
or:
slightly smaller black box
2 amp inline fuse
$3
http://www.radioshack.com/product/index.jsp?productId=2102784
1 strain relief fitting
$0.15
http://www.allelectronics.com/index.php?page=search&search_query=sr-80&x=0&y=0
6 wires, a soldering gun and a drill and file to cut holes in the plastic box
...

Top Hat (or XCSoar 6.3+)
free

Total
$63.15
and a few hours of time
Note about mixing up tx and rx pins:
I can't guarantee you won't break your device, IOIO board or your Max3232 board if you wire it wrong. However, you generally won't damage anything by switching the tx and rx data pins. For the box below, I used a standard crossover serial cable to connect the box to my Cambridge 302. Don't ever mis-connect the power leads and always use fuses.

Finished product (less 2 amp fuse on 12V in)


IOIOBoxOpen.JPGOpen the box. Two boards inside. The IOIO and the MAX3232 serial converter



Note: the image above shows only one MAX3232 board connected to the IOIO. But, you can wire a second MAX3232 board to the IOIO board. Use the same power wires but connect the second MAX3232 board to data pins 5 and 6. This would allow for a Flarm and a vario to both be connected to XCSoar 6.2 via serial cables.

IOIO Board and wiring
Additional Max3232s can optionally be connected to pins 5-6, 10-11, 12-13

Max3232 board and wiring

Notes on RX and TX reversibility: it seems some MAX(3)232 manufacturers label their RX and TX pins with the opposite labeling as that in the diagrams above. So, for some MAX(3)232 boards, the IOIO pin 3 would go to the MAX(3)232 RX and IOIO pin 4 to the MAX(3)232 TX (see example of one of these boards below).Different Max232 board that uses reversed RX/TX! Box: BUD Industries HP-3652-B


Below is the setup screen for Tophat. The port configuration will show the IOIO ports if running on an Android device

Top Hat device: Use "IOIO Uart 0" and select your Logger and baud rate


There are four Uarts supported, so you can attach a logger and a flarm.

Variations of this design:
There are many variations possible to the configuration shown above. Notably, instead of 12V input power to the IOIO, it is possible to use 5V input to power the IOIO. Please refer to the IOIO wiki about using 5V power to the IOIO board: https://github.com/ytai/ioio/wiki/Power-Supply and https://github.com/ytai/ioio/wiki/Power-Supply-OTG. Especially if you are using an IOIO OTG, please use 5V input because unlike the IOIO V1, the newer IOIO OTG generates RF interference with aircraft radios unless you power it with 5V.


Links to other glider IOIO boxes pictures:
https://picasaweb.google.com/baer.bernie/IOIOForCAI302?authkey=Gv1sRgCKic-4mGxZHVgAE#
Note the text that indicates using the CAI 302's 5V power supply into the IOIO did not work well, and he switched to 12V plane power supply to power the IOIO.