Serial Communication Between Android and Arduino Through Laptop Bluetooth

by bhaskar4n in Circuits > Arduino

7934 Views, 28 Favorites, 0 Comments

Serial Communication Between Android and Arduino Through Laptop Bluetooth

Arduino_Uno_-_R3.jpg
DSC_0002.jpg

About:

This instructable is about serial communication between android and arduino through laptop built-in Bluetooth. i do not have separate Bluetooth module. so i have decided to use my laptop built-in Bluetooth for serial communication.

Block Diagram:

aa.PNG

How it works:

1.first, the python file receives the command from the android application through Bluetooth

2.next the python file send the received command to arduino through cable.

3.finally,the command(1 or 0 or 2) turn on the pin-13. and confirmation is send back to android application.

commands:

1 - turn on pin-13

0 - turn off pin-13

2 - close socket

Software Needed:

python-2.7

Python Package Needed:

pyserial - for arduino serial communication

pybluez - for bluetooth serial port communication

Links:

pyserial - https://pypi.python.org/pypi/pyserial

pybluez - https://pypi.python.org/pypi/PyBluez

Simple Arduino Sketch to Turn on PIN-13:

arduino.PNG

step1: upload the blink.ino file to your arduino uno board

Downloads

Python File: Androidtoarduino.py

androidtoarduino.PNG

Before run this file, turn on laptop bluetooth

step2: next run this python file from your computer.

download link:

https://github.com/bhaskar4n/arduino/blob/master/A...

note: before run the android application you need to run this python file. it act as a server and the android application act as client. .

Android Application:

Screenshot_2015-02-23-07-29-06.png
Screenshot_2015-02-23-08-27-51.png
Screenshot_2015-02-23-07-25-56.png
Screenshot_2015-02-23-07-26-28.png
Screenshot_2015-02-23-07-27-09.png

before run this app, pair your android device with pc

commands used to turn on PIN-13

1 - turn on

0 - turn off

2 - close socket

application download link:

https://drive.google.com/file/d/0B8dBW1QGzJmrRW1GT...

Corresponding Python Output:

output.PNG