Making Arduino and Android talk

While Robert’s working on the LED controller board / signal processor / micro SC card holder / voltage reference board (yep, definitely multifunctional), it’s my job to see which cell phones will communicate with the Teensy-based Photosynq via the standard USB connection.

Answer: Not many.

Here’s the problem in a nutshell: For two things to talk with each other via USB, one must be a “host” and the other the “slave”. The host is the one in control of the conversation. For example, your PC is a host and your mouse is the the slave. So to connect a Teensy microcontroller to your phone, your phone has to be the host. Android operating system has allowed your phone to act as a host since version 3.1 using a special USB OTG (On The Go) cable, but many (dare I say most) equipment manufacturers are not creating phones which work with this standard. For example, a Nexus 4 does not communicate via Serial with our Teensy (at least not without a lot of fooling around), but a Toshiba Excite tablet does. There’s a big list here of what is and what is not USB host compatible.

I was impressed with the variety of Android Apps available for those devices which do work when you have the right device. I found 3 great apps which allow you to send and receive data via the Serial port to the Teensy (just like the standard Arduino IDE Serial Monitor): USB Serial Monitor Lite, UsbTerminal, Slick Labs (regular and pro). All worked very well with some minor differences and little glitches, but overall I was impressed – too bad so few devices are USB Host compatible.

In addition, only a portion of those OTG compatible devices actually supply the full 500mA power (as per USB 2.0 standards) to the USB device. This is a problem for us, considering we would like to have small bursts of potentially significant current to run the LEDs.

So, my dreams of a simple, universal, plug-and-play device appear shattered!

No matter – it’s time to look into Bluetooth and wireless options (like Eye-Fi and/or Sparkfun’s bluetooth module) and add a battery. Hope to get them in in the next few days and test them out. More updates then!

Yay! My Teensy said Hello to my Excite Tablet via the USB port. Too bad it couldn’t take to the Nexus, or 99% of other useful cell-based devices out there. Argh.
Nice data Serial output from the Teensy-based Photosynq

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.