Hello Every body , This is my first artical on Instructable.com , I’m so happy for that , and I will start by How to connect arduino with bluetooth , I suffered a lot of problems when I try to connect it as the website and instructable artical did , So i decided To share my experience with YouThe bluetooth module I will use today is HC-05 which is so familiar and cheap ,
Most tutorial on The website Connect the bluetooth with default Rx and Tx on the arduino Board , I faced a lot of problem and bluetooth didn’t work will .
But arduino support something Called Software Serial , which allow You to change any arduino board pin to serial pin
http://arduino.cc/en/Reference/SoftwareSerial
so After reading this article you will be able to:
1) Connect arduino Board with PC By Bluetooth , to send and receive data .
2)Connect arduino Board with Any android device .
so you can send your information , Like Sensors reading , from arduino to PC Or android device , and you can build your Home automation system by bluetooth , and controlling your robot wirelessly
you need to do this experiment :
1) Arduino Board ” I used Arduino Uno “.
2) Bluetooth module HC-05.
3)Solderless jumper.
4)Bread Board .
5)Battery 9V “Optional”.
The connction between Arduino and bluetooth is like the schematic above
We now want to send or receive Data between arduino and computer , first we need to make a Communication link to Definition arduino Board to the computer .
We will need a software called Tera Term to show the data received or what we want to send through it .
You can download Tera Term or any terminal emulator software , you can download Tera term from this link :
http://hp.vector.co.jp/authors/VA002416/ttermv14.zip
To make a link between your Arduino and bluetooth , do the following :
1) Go to the bluetooth icon , right click and select Add a Device
2) Search for new device , Our bluetooth module will appear as HC-05 , and add it
3) The pairing code will be 1234 .
4)after make a pairing , we can now program the arduino and upload a sketch to send or receive data from Computer.
As I mentioned before , I will use software serial library to make pin D10 & D11 As Tx & Rx instead of using the default Rx and tx ” D0 &D1 On most arduino Board ” .
this program below allow us to control LED connected to D13 To blink on/off , by press # 1 from PC Keyboard the LED blink on , and if we press 0 LED blink off !
To send the Control commands from Computer to arduino , Go to the tera term , Run it , and choose Serial , and select the bluetooth Serial from the list as Shown on the picture .
The code below :
After uploading This sketch go to tera term and press 0 or 1 and see the results
This Video show the results of this code.
after we finished from connecting arduino with PC By bluetooth , let’s move to how we can connect arduino To android device .
at first you need a terminal emulator on your andriod device to send or receive data to arduino .
You can download this app from Google play .
after that , you can use the same arduino Sketch and control LED Blinking on or Off from android device .
just type and t send #1 to make LED Blink on , or 0 to blink off .
this video below show how to control arduino I/O from android tablet
The last Arduino Sketch that i wrote , used to send commands from PC Or android device to android , Now in this program i will use arduino to Calculate the time since the start of the program in second , and send it Via bluetooth to any pairing device .
the code below
Hope my first artical here is useful to you , thank you for your time