Arduino + android -> Audio Port

Hi every one, I write here because i'm working on a porject where my idea is to connect an android mobile (LG.GT540) to an Arduino (Duemilanove), Here I write down the blog where the project is described and where you can comment what ever you want.

I Would like to know what do you think I should start working.

In order to work with the audio port from an Arduino device, i would like to know which are the libraries I should use.
How should I use the data?? I would like also to know about the schematic that I should build with the Arduino tablet.

Thank you very much, I hope to read all your suggestions.

Thak you all.

the audio port from an Arduino device

The arduino does not have an audio port.

It can generate tones and some waveforms. What do you want it to generate? How do you want this to be used by the android?

something like this,

I found this blog that would be quite similar to the idea I have,

But I would like to know who to implement it to an Android device, Why do i need FSK modulation, How do i have to work with the audio signals...

Thanks everyone

Why do i need FSK modulation

To encode data into an audio signal that you can send by phone.

But I would like to know who to implement it to an Android device

You need the android development kit.

not sure if you are aware of it, but there are several boards available which connect directly to android phones via the usb jack.

google modern device. they sell one.

also, there is amerino for doing bluetooth connections.

dont know what you aim on doing, but it might bake sense to take a look at what else is out there.

hello everyone,

after looking for more information, I found this web: http://bit.ly/pJFurJ where they connect an arduino with an smartphone using the audio port, and a little bit further down they make the same experiment that i'm trying, they mesure the temperature and they show it in a smartphone.

I would like to know what is what they are really reading and writting, from the thermistor we get a constant value, that is needed to be converted into a digital signal, that is what arduino is used for, and then converted into an analog signal with its fundamental frequency iqual to the value of the temperature, isn't it?? How can i do that??

Include <SoftModem.h>

Include <ctype.h>

SoftModem modem;

void setup ()
{
Serial.begin (57600);
delay (1000);
modem.begin ();
}

void loop ()
{
while (modem.available ())
{
int c = modem.read ();
Serial.write (c);
}
while (Serial.available ())
{
char c = Serial.read ();
modem.write (c);
}
}

Thank you very much

I would like to know what is what they are really reading and writting, from the thermistor we get a constant value, that is needed to be converted into a digital signal, that is what arduino is used for, and then converted into an analog signal with its fundamental frequency iqual to the value of the temperature, isn't it?? How can i do that??

Answer to your question in the SoftModem-004.zip file, you can download from the link.

Ok, More or less I understand the code, now the issue is to mix the codes about reading the temperature form the thermistor and the soft modem, does it have to be everything in the same code?? or one for reading the thermistor and another for sending data to the samrtphone??

Thak you for your help

Please, use # symbol on button bar (above smiles) whenever you post a code.
If you look into : void SoftModem::write(uint8_t data), prototype function has a deal with uint8_t, that is unsigned byte or just char. So if you need to send a temperature, there are two option:
send data, taken from ADC, as two (HIGH LOW) bytes to android, combine them back and do all mathematic formula calculation int-->float on android;
calculate on arduino, then split float T (32 - bits) in four bytes, send them individually to android and assembly float T back on android.
Search on the forum, there are millions thread how to do splitting/combining using atoi/atol/atof/strtol etc functions.

edited:
Just come across:

#include
 #include   

 SoftModem modem;
 int temperaturePin = 0;

 void setup ()
 {
 Serial . begin (9600);
 modem. begin ();
 Serial . println ("Start");
 }  

 void loop ()
 {
 float degree;
 float fahren;
 float temperature = getVoltage(temperaturePin);
 temperature = temperature * 100;
 degree=temperature-273;
 Serial.print(fahren);
 Serial.println(" F");
 Serial.println(degree);
 Serial.println(temperature);
 sending(degree);
 delay(2000);
 }

 float getVoltage(int pin)
 {
 return (analogRead(pin)* .004882814);
  }
 void sending(float temp)
 {
   int b10;
   int m1;
   int b1;
   int m01;
   int b01;
   int m001;
   int b001;
   int u;
    u=temp*100;
    b10=u/1000;
    m1=u%1000;
    b1=m1/100;
    m01=m1%100;
    b01=m01/10;
    m001=m01%10;
    b001=m001;
    modem.write(b10+48);
    modem.write(b1+48);
    modem.write(46);
    modem.write(b01+48);
    modem.write(b001+48);
    modem.write(67);
    modem.write(32);
    modem.write(32);
    delay(200);
 }

on http://sree.cc/iphone/iphone-as-temperature-detector
they use % modulo function to split float on 4 bytes, but there are many ways, it's up to you.

who can help me~
I try to Arduino--->android phone via audio jack (FSK),
but it not work,

and I look this http://side2.jp/2010/08/android-softmodem/

use his android code and arduino code,hardware is NexusOne , and use The cable with which gilding specification was shielded (???????????????????????????)

the ????Android->Arduino?is succeed,

but ?Arduino ->Android?alway Failure ----cellphone is nothing happen

who can tell me what error?

i see the website say:
????Arduino->Android?????????????????????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????

I do not know what mean

thanks~