Interfacing android and arduino through an audio connection.

Friday, 5 August 2011

System Architecture

This project aims to build an Arduino-powered interface to get data from any real-world, analog sensor into a smartphone (Android device) using the audio port as the communication channel between both platforms.

Sensor: obtain some values we want to know, they can be temperature, pressure, humidity, amount of light... These values are related to a voltage, a continuous value that is measured in certain periods of time.

We can measure current temperature of the environment using a simple temperature sensor LM335 and an Arduino with the help of a small circuit and a simple Arduino code.


Arduino: the values generated from the sensor are modulated by the microcontroller, using ADC. Using an Arduino library called SoftModem, I am able to configure the microcontroller in order to obtain a FSK modulation of the values. Wherein data bits are communicated by modulation and demodulation — basically encoding data in specific audio tones sent over an audio channel. Some of you oldsters might remember the weird sounds emanating from the early telephone modems? That was FSK

With this what we obtain is an analog signal related to the value from the sensor, this is the modulation part.

Now we want to work with this signal in our mobile device, as we already decided and commented here, this is going to be done through the audio port. That's why we need and are going to use the Softmodem board, which allows us to connect the arduino board and our mobile device with an audio jack cable.


Five terminals to connect to the Arduino (FSKOUT · GND · VCC · FSKIN · AIN) has been equipped with a pin jack plug into the 3.5mm plug 4 poles for connecting to a cellular phone.

Using compatible FSK libraries on both the Arduino side and the Android side, we can actually accomplish bi-directional communication between our sensor rig and our mobile device. The Arduino gives us the onboard computing power to be able to both write and read data using FSK. As a first example, we’ll try to establish a unidirectional connection, sending data from the sensor to de Android device only. Still, we need to do FSK on both the Arduino side (modulation, or encoding the sensor data as audio) and the Android side (Application) (demodulation, or decoding the audio as data). So, all the raw materials are here for a bi-directional connection.

We need to decide in which frequencies we are going to encode:

This library is setup to encode data in shifts between audio frequencies 4000Hz (LOW) and 8000Hz (HIGH).

First, you need the sensor, Arduino and supporting circuitry for gathering data. For this we connect the sensor which will feed the Arduino.

You will also need to build some simple circuitry and load some code onto the Arduino.





Final objective: Android device <- (softmodem)->Arduino<-(rs232) are communicating said configuration->PC.

Friday, 15 July 2011

Great Alliance

These days, the Campus Party, is taking place in Valencia, the biggest computing fans meeting . In these event usually carries out some important presentations about the most actual technological developments. This year, one of them has been the one which I present here:

Arduino and Telefonica alliance: "Is easy to connect to the world, any object. [Blodic.us]"





El internet de las cosas crece. [El País]
Arduino y Telefónica fácil conectar al mundo cualquier objeto. [Xataka]

Break time for 'Gadgeting'


After a time looking for a lot of useful info on the web, now I have in my hands a Chumby. It's the first time I heard about this gadget, so I decided to find out the different possibilities it offers.

The Chumby is an ambient consumer electronics product made by Chumby Industries, Inc. It's an embedded computer which provides Internet and Lan access via a wifi connection. Through this connection, the Chumby runs various software widgets. Roughly resembling a small clock radio, it consists of a small touch-screen with a leather and plastic exterior. It uses AC power and turns off if unplugged and moved.

The design has evolved over time, as well as its initial technical specifications, but without losing the essence of the first model.













At first sight, when I started to discover its performance, I thought, this is a modern clock/alarm clock, but later I found out more interesting options. Chumby can acts as:
  • Digital Photo Frame/web, where you can see your Facebook/Flickr photos.
  • RSS Feed/News Reader: You can be informed about the news around the world.
  • Gaming device: several basic games, Sudoku, sliding puzzles...
  • iPod speaker, thank to the speaker it has behind. (the only thing I didn't like, is that i couldn't connect my iPhone...)
Once I discovered all the performance it offers, I wondered, why isn't it developed with Android? It's important to take into account that this device came out into the market at the end of 2007, in those days Android didn't have such a big importance as nowadays. But this question made me find this new device:













It's called Webby and it's an evolution of the Chumby developed by Avantis. As I said, the main difference is the implementation of Android over a Linux kernel.

But this device was not the only one which came from the Chumby, Sony also decided to join this race with his SONY Dash, defined as "Your Personal Internet Viewer".

So, after knowing how this market was, I concluded that this sort of devices was a good alternative to the newest tablets that we can find such as iPad, Samsung Tablets... Chumby was original designed for a home use, that's why the device here commented can't be really compared to the ultimate tablets.

How can I connect Arduino to a smartphone (Android)?

One of the reasons I decided to develop this project was the needed to research about implementing two actual and strong technologies that are taking more and more importance nowadays.
Android is one of the most important open source OS related to mobile devices, is a platform that is growing by leaps and bounds, allowing to create many applications systems in order to interact with real world.
Arduino is, also an Open microcontroller platform which allows to interact with a bunch of sensors, so these devices can be easily implemented.

Now I'm going to present different options that I found on several blogs to implement the connection:

1.- Audio Port:
2.- USB Port:
3.- Bluetooth/WiFi

So, I decided to perform the connection through the audio port, because it's an universal port that exist on all the different devices that support Android, so this would allow phones to form the basis for many health and communications applications turning the mobile phone into a scientific data collector data or an environmental tool by connecting low-power sensors.

Tuesday, 5 July 2011

Twitter Account

Hello,

I've created a Twitter account for this blog: @Tec_Androino, I think is a good way to share my work with everybody.

Hi everyone!!

Hi everyone,

After a time spent taking my last exams in college, I will have plenty time to develop this project as my Final Project.

First of all, I would like to introduce myself:

I'm Alberto Pascual, Telecommunications Engineering. I studied at the University of Navarra (TECNUN), in San Sebastián, and I also spent a period of six months in Sweden at Linköping Universitet this academic year. That's why I'll try to do my best writing this project in English.

I would like to annotate that I'm really excited with the project I chose, because I think that is a great opportunity to learn about some technologies that are taking a great impact nowadays.

I hope you enjoy this project as much as I do.

See you around here.