loading

With this project you can send bytes from android to arduino using only an audio jack connector.

How it works?

Basicly ,android sends a "morse" audio signal to arduino.Arduino in the other hand decode the morse code to a byte.That simple.

Parts you need:

1 Arduino uno R3

1 phone with android os

1k resistor

1 old earplugs (without mic is better because its easy to find the wire for gnd )

some wires (better if you use a breadboard with some jumpers)

Step 1: Hook Up Schematic

You need to connect analog pin A1 to gnd with a resistor.(pulldown).Cut the earplugs so you have only the audio jack with 10 cm wires.After you find the gnd wire of audio jack ,connect it with arduino gnd.The other wire of audio jack connect it with analog pin A1.The electronic part of the project is finished

Now lets go to the software part.

Step 2: Setting Up and Running

First, download and install the small apk i made .(the apk is not signed so you need to enable Unknown sources in settings)..

Second upload the arduino sketch(android.ino) to your arduino.

Open the android application (adr).Now connect the audio jack to android.Increase the phone volume to maximum.

Press the reset button on arduino(do this step every time audio jack is reconnected or every time you reopen the apk)

Now to check that everything is ok, touch the green screen on android" Push to send 125". If arduinos led on pin 13 turn on, than everything is good to go.

You can send numbers from 1 to 256 to arduino.The number 125 is for the led but you can change that in arduino.ino

For sending other numbers just write the number on the textbox and click on update.You will see that the green screen changed.Now click on the green screen to send it.

Connect arduino with pc and open Serial monitor .The numbers you send will appear on screen.

Step 3: Applications and Other Projects

You can send 256 numbers to arduino, which mean 256 instruction(every number can be assigned to a specified instruction).In simple words , you can controll electronic stuff with an android phone.

But this project has a lot of other application.

It doesnt matter where the sound comes from in the audio jack, if the signal is the same arduino will recognise it.For example: If you remove audio jack and push the green screen , you will hear a noise signal.If you record that signal in your pc , phone or other devices, and you play it to arduino audio jack, arduino will still decode that signal.

What does that mean?

Well ,one exaple: imagine two phones , one is the sending part with the audio to play(phone A), and the other is connected to arduino with the audio jack(phone B).Phone A calls phone B.Now phone A is speaking with phone B.Everything in the microphone of phone A goes to phone B audio jack, which goes to arduino.Now you can send commands to arduino through phone communication.

For the source code of apk:

Download adr.rar, unzip and open it in Android Studio

I hope this helps you in your future projects :)

<p>so inspirational! Thanks.<br>Do you mind to teach us about reverse transmitting data from Arduino to Android? :)</p>
<p>looking for the same .. did u found anything? </p>
<p>it doesn't work for me! :/</p>
Great tutorial bro!<br>Im having problem about arduino code .
Please post the android code, thanks!
<p>just posted :)</p>
Can I ask for the android code ?i know its been long for you to dig <br><br>Greatly apreciated :)
<p>You're the king! Thanks! :)</p>
<p>Well, I've done it: I put all things together and... it doesn't work.</p><p>Than I tried to explore the source code and realized that Android speaks a language and Arduino understand another language...</p><p> From the Arduino point of view, it is expecting a signal where every bit has the same duration (5 cycles for each bit);</p><p>From the Android point of view, it is encoding the value with a &quot;short white noise&quot; for a ZERO value and a &quot;long white noise&quot; for a ONE. They are &quot;speaking&quot; two different protocols a &quot;constant duration protocol&quot; vs &quot;variable duration protocol&quot;.</p><p>Ivi, how can they understand one another?</p><p>Another question for Ivi: why is there a game inside the apk, beside to the needed classes? I was surprised of 15mb apk, so I opened it and found a lot of garbages...</p>
<p>Hi , have you made it work ? please can you explain me how to make it work ? Im very interested in this project. Thank you Alessandro</p>
<p>Hi, nice project! I want to use this to add a touchscreen of an old phone to a attiny85 project (in reality add the phone to the project) as button/input interface. Really neat and cheap solution. I just want to test the app first but cannot run on Android 2.3, can you compile it with earlier SDK (i believe it is 9)? Also another great idea is to make a browser version (html+javascript) of it so it can run on any browser on any system. I'm curious how many milliseconds one command takes, how fast can you repeat or switch to another button? </p>
<p>First of all thanks for posting the code.</p><p>Sorry but my English is not very good.</p><p>specific question:</p><p>Because there is a limitation to send numbers from 1 to 256?</p><p>ave track to modify the code and extend you up to 5 digits?</p><p>Thank you very much.</p>
<p>Hello ivi, Thanks for ur post it is a simple and cheap way to communicate with android. Can u please send Android source code using ecllipse. </p>
<p>Maybe you know how to transfer data via audio jack from arduino to android? Can you show schema connection all parts together please?</p>
<p>Can I get the Android Source code please as well?</p>
<p>This is a neat capability. Thank you for sharing!</p>

About This Instructable

6,154views

46favorites

License:

More by ivi_h:Transmitting data from Android to Arduino through audio jack 
Add instructable to: