Being able to communicate between Arduino devices and Android via audio cable.
The idea is simple (and not mine): modulate a carrier wave using frequency changes in correspondence of binary data changes. It is called Frequency Shift Keying.
Obviously, transmission data rates are not suitable for media streaming, but enough for trasmitting small amount of information like commands, data from sensors connected to Arduino board, etc....
There is a similar project, called Androino. Another working example, this time on Apple hardware, is IR-Remote.
I think it was a university project but I think it has been abandoned. Source code is available but I wasn't able to make it work.
Hardware
On the hardware side, all I bought is:
- Arduino Nano 3.0 board
- FSK SoftModem module from Sparkfun's site
- Audio 4 pin cable 1m
- My phone
Software
Talking about the software, the Arduino code is ready and available as serial interface. It has been developed by ARMS22 (authors of the board too). It is available on this website. They focused their attention on iPhone, but I want to make it work on Android.
An Android client existed too, but it has been removed from the website. For receiving data on Android, the main idea is to use the Audio API to record chunks of audio, perform a zero crossing algorithm on it to store the "distance" between crossings. Then perform an RLE to translate it into valid byte values.
This will be packed into a threaded library offering an input and an output queue as interface for reading incoming data.
For sending data, some code in Javascript is available and it should not be too difficult to implement it in Java.
The issue can be the battery consumption, since we are continuously recording&processing Audio, having no interrupt on Android side.
I am sure an ADK board is the best way to communicate with Android, but it wouldn't be cross-platform and cross-device.