Tuesday 28 August 2012

Softmodem communication on Android

One of the projects I would like to proceed but I am a little stuck due to limited amount of time...
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:

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.




No comments: