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.
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.
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).
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.