
We recently did a little demo to send data to an Arduino with a TCP/IP Shield (using ATC-1000M) from an Android device via Wifi.
The Android phone in this demo uses Android Scripting Environment (ASE). It is available on Android Market for free.
Videos and source code after the break.
Here is a short video demonstration of blinking the Arduino LED using Android.
// By 7
// Version 00.08.01
#include <SoftwareSerial.h>
#define rxPin 0
#define txPin 1
#define ledPin 13
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup()
{
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
mySerial.begin(9600);
}
void loop()
{
char c = mySerial.read();
if(c=='A')
digitalWrite(ledPin, HIGH);
if(c=='B')
digitalWrite(ledPin, LOW);
}
Arduino Simple Source Code
'''
This is used to send a
character to the Arduino
via Wifi
By 7
'''
import android, socket
droid = android.Android()
STR_SEND_A='positive'
STR_SEND_B='negative'
STR_EXIT='neutral'
def test_alert_dialog_with_buttons():
title = 'Alert'
message = ('What do yo want to Send?')
droid.dialogCreateAlert(title, message)
droid.dialogSetPositiveButtonText('A')
droid.dialogSetNegativeButtonText('B')
droid.dialogSetNeutralButtonText('Exit')
droid.dialogShow()
response = droid.dialogGetResponse().result
return response['which']
#Change this depending on the IP and Port of the ATC-1000M
HOST='192.168.7.3'
PORT=23
boolExit=False
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
try:
s.connect((HOST,PORT))
while(boolExit==False):
res=test_alert_dialog_with_buttons()
if(res==STR_SEND_A):
s.send('A')
if(res==STR_SEND_B):
s.send('B')
if(res==STR_EXIT):
boolExit=True
finally:
s.close()
print 'Done! Thank You!'
Python for Android Source Code

Would have been impressive if the WIFI hardware was connected to and controlled by the microcontroller.
^^ actually, that would be next (hopefully)
seven! seven! seven!
I have one question, why did you use a software serial instead of the hardware UART which is available for pin 0 and 1?
Can you sell for me Android sourcecode “Android phone controls Arduino over wifi “.
Thanks.
Link died.
Can you upload again or sell for me android code wifi.
Thanks a lots.
the link is deleted but the code is still posted above.
Nice! Have you seen anything like this using the iPhone?
i like your idea much.. dear plz can you send me android code for this project. asaleemj@gmail.com is my id i will be so much thankfull you..:)
Hi.
Can you send me too your android code on e-mail: uso567@list.ru.
Cheers,
Ufo
Can you please send me the source code. I would appreciate that. My email is mirza.ramicic@hotmail.com . Thank you in advance!
this is what i was looking for..i want to do an application with 4 bottons that controls 2 dc motors connected to an arduino mega via wifi..can u send me the android source code please. Mrad.13@hotmail.com
thank u in advance :)
Good day!
Can you also share with the android source code. dude_jhun15@yahoo.com
Thanks a lot…
how to transfer data from arduino to android?
can u email to me the android source code.. im really appreciated your helps.. im developing arduino project now.. tq
Can you send me too your android code on e-mail:avionica1@yahoo.com.mx
Thanks a lot.
nice work ! can u send me the full android program coz this is what i’am looking for .. tenk you in advance :D e-mail: momo20.js@gmail.com
it ‘s a nice job ,please could you send me your android code thank you
my mail: marwabenmassoud123@gmail.com
Pl. share me the schematic diagram and source code to implement for my final year project
(Android phone controls the micro controller through WIFI)
Very nice your idea.. I am a student system engineering and I am interested in learning how to control android and arduino using wifi , plz can you send me android code for this project. my email is jhonmc120@gmail.com I will be so much thankfull you..:)
I am a student MCA and I am interested in learning how to control android and arduino using wifi , plz can you send me android code for this project. my email is mehul.vekariya001@gmail.com I will be so much thankful you..:)
This is what i was looking for… :) can i control any UART wifi module by my android phone? i haven’t arduino… reply me soon plz…
Hey :)
that is exactly what i am looking for.. I also try to program a project for my School education and i need 3 Buttons to control an LED Matrix to show the time. Please can you send me the arduino and android code please
Email: huteralexander@gmail.com
Thank you
superv…can u send “Android phone controls Arduino over wifi ” code to vijayece102@gmail.com
Can you sell for me Android sourcecode “Android phone controls Arduino over wifi “.
Thanks
Can you send me Android sourcecode “Android phone controls Arduino over wifi “.
mehaknarmeen17@gmail.com
Thanks
Can you send me Android sourcecode “Android phone controls Arduino over wifi “.
koos0109@gmail.com
did anyone received Android source code “Android phone controls Arduino over wifi “? I hope so because I too am interested at how you code it so please, send it to me :s afy-dee@outlook.kr
Can you send me Android sourcecode “Android phone controls Arduino over wifi “. zendi014@gmail.com
thanks before
Can you send me Android sourcecode “Android phone controls Arduino over wifi “.
Can you send me Android sourcecode “Android phone controls Arduino over wifi “
dream.elvis@gmail.com
Can you send me Android sourcecode “Android phone controls Arduino over wifi “.
What do i win if i too copy and paste this sentence into my comment:
Can you send me Android sourcecode “Android phone controls Arduino over wifi “.
Do i get bonus points for paying attention to correctly copy&pasting the white-space between the word wifi and the quote mark?
can you send me the android code? pls thank you