Instructables
loading
loading
Picture of Arduino AND Bluetooth HC-05 Connecting easily

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 You

The 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


 
 
Remove these adsRemove these ads by Signing Up

Step 1: Material and connection

Picture of Material and connection
Blue.jpg
Untitled.png
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 





1-40 of 52Next »
sunxing222 years ago
well done , thanks for this tutorial
please do not forget to post this tutorial in your blog in Arabic :)
kalsara01 made it!1 month ago

nicely explained. thanks dude

20150531_110442.jpg
edpratomo1 month ago

very instructive tutorial. i made it with the differences that i use nano and "bluetooth terminal" android application.

AjuK33KV5K1XRxDVf9VjHTLD-ATYvCitai1FjRv1paRl.jpg
akshitm made it!2 months ago

Thanks for this tutorial. Very easy and well explained.

IMG_20150410_021335506.jpg

This is perfect for a co-workers project!

Program over Bluetooth!

Excellent, gonna give it a try, thanks for posting!

aphexZero made it!3 months ago

Thank you very much Mohannad! This one was easy and works like a charm.

20150326_215833[1].jpg
Senken aphexZero3 months ago

This is amazing, would there be a way of communicating between a hc-05 with an arduino and a hc-05 with just a power source? i have very limited space and wondered if i would be possible to send a signal to turn a pin live on the arduino from a hc-05 without at arduino? i have ordered two and am awaiting postage. i have done this with 433mhz rf tx and rx but hey pick up to much interference. Basiclly hope to put a push switch on the hc-05 and have the ardino trip a relay.

AredaM3 months ago

nice project i do to ry

LawrenceC14 months ago

Hi Everyone,

For the third step, in which we upload the code to make the arduino run, do we upload it in an arduino sketch and then view it in the TeraTerm? It seems that when the teraterm and arduino are sharing the same com port, it gives the error ("Serial com port 4 is already in use") Is there anyway to fix it?

Thanks!

fhovin4 months ago

This works fine for me when I test it
through the serial monitor in the Arduino IDE. And I can connect and
pair both windows and my android phone to the device. However, I'm not
able to get any reaction in Tera Term or any other terminal emulator on
Windows, nor the Bluetooth Terminal Emulator I'm using in Android. No
echo return, and no on/off switching. In short, it works in the Serial
Monitor but not over bluetooth.

Any ideas?

lakkireddyuma4 months ago
Sir what u have provided lonk to download not found in google play say way to instal
mccreamark4 months ago

Hi ,

Thank you for a great instructable. I modified your code slightly to allow the use of hardware Serial1 , so I could connect my HC-05 to my Arduino Mega 1280. All I did was ctrl+ f to replace your software serial object with Serial1 so Genotronex.begin(9600); will become Serial1.begin(9600); I also used the Tx1 and Rx1 pins connected to my HC-05 RX and Tx respectively . I had to remove the USB connection from my PC (Win7)to my Arduino and power it from a 5v wall wart. As my Arduino will not connect properly with bluetooth when the USB serial is connected. I xctu to scan for the (Blue Tooth)serial ports and used Putty Tel to try each com port (10 , 11 ), I had read somewhere the lower number would work but in my case it was Com port 11. I have put my mod of your code below for anyone using a mega.

//SoftwareSerial Serial1(10, 11); // RX, TX

int ledpin=13; // led on D13 will show blink on / off

int BluetoothData; // the data given from Computer

void setup() {

// put your setup code here, to run once:

Serial1.begin(9600);

Serial1.println("Bluetooth On please press 1 or 0 blink LED ..");

pinMode(ledpin,OUTPUT);

}

void loop() {

// put your main code here, to run repeatedly:

if (Serial1.available()){

BluetoothData=Serial1.read();

if(BluetoothData=='1'){ // if number 1 pressed ....

digitalWrite(ledpin,1);

Serial1.println("LED On D13 ON ! ");

}

if (BluetoothData=='0'){// if number 0 pressed ....

digitalWrite(ledpin,0);

Serial1.println("LED On D13 Off ! ");

}

}

delay(100);// prepare for next data ...

}

returner5 months ago

Hi, i have a question and i hope you guys can help me with this. how does the arduino actually know actually know which data it is going to send or receive? in which part of the code does it do that? i want to make two arduinos one having a HC05 as a master sending data over to a HC06 slave on two different laptops. I hope you can answer me.

The library opens a serial port and between the devices and that is what is used to send and receive the data. Therefore the data is sent in the code via the Serial.println and is received in the code via the serial.read() statement. I suggest looking at some examples of the serial communications that come with the IDE to assist further

rfgsoftware4 months ago

Well done, nice article.

gft20124 months ago

Problem:

I can connect to AT commands using HC-05 it responds everything,. But when I use any application from an application to light led up. it doesn't light the led up. but hc 05 keeps blinking. I am using Ardudroid application for testing. My hc 05 is paired already and I'm connected to HC05 But it doesn't light the LED.

arduino code:

int ledPin = 13;

int state = 0;

int flag = 0;

void setup(){

pinMode(ledPin, OUTPUT);

digitalWrite(ledPin, LOW);

Serial.begin(38400);

}

void loop(){

if(Serial.available() > 0){

state = Serial.read();

flag = 0;

}

if(state == '0'){

digitalWrite(ledPin, LOW);

if(flag == 0){

Serial.println("LED: off");

flag = 1;

}

}

else if(state == '1'){

digitalWrite(ledPin, HIGH);

if(flag==0){

Serial.println("LED: ON");

flag = 1;

}

}

}

Any solution for this guys? What supposed to be the problem?

Thank you for your help guys

PaymaanJ5 months ago

RX/TX from HC-05 carrier board you use are only 3.3 volts (I only saw a carrier board with 3.3 to 5 volt level translator on a HC-09 board), so if you pass too much data, your HC-05's RX will finally burn. So put some kind of level translator between those 2 pins, or your bluetooth device will burn.

No such app exists(android app) please update your link

dilushan5 months ago

Since app mentioned author not existed i tried bluetooth terminal app. It's working without any issue. U need to pair the HC-05 before using application

https://play.google.com/store/apps/details?id=Qwer...

dilushan5 months ago

I had issue before and i fixed it. For anyone who having the same issue. My board is Mega 2560. I'm in windows 8.1 and COM15 was the outgoing port in my case. When I try to connect it using teraterm it always complained "can't connect to COM15". I supplied 5V to the HC-05 before. When i changed it 3.3V voltage suddenely it begin to work. After that i switched back to 5V and its also working. Still i don't have any idea what happen before

ayushi1236 months ago

after following this instructable, things went out so easily! thanku very much! I made it succesfully. :)

MonaE6 months ago

the application is no longer available on the play store page .. please , put it back , i neeeeeeed it urgently !

thebluesman007 made it!6 months ago

https://www.facebook.com/video.php?v=10152676596932585&l=7117698860085934036

DSC_0003.jpg
lavanyaes6 months ago

Hai,

I need to interface the arduino with smart phone instead of PC. Please suggest ways for mobile interface of arduino. Thank you

insanerish6 months ago
Anuj FALCON6 months ago

IT worked and its toooooooooooooooooooooooo simple

Tres bien

santan0071 year ago

Done the connections in exactly the same manner, also used the same sketch, still doesnt work for me. Neither with android nor TeraTerm.
Please help. What could be the possible problem?

kasisnu santan00711 months ago

Did you figure out what was wrong?

loulaw12 kasisnu10 months ago

I am having the same problem . Can't get any thing to show on the TeraTerm and the 1 or 0 command doesn't do anything

kasisnu loulaw127 months ago

Try following along with the tutorial by GreatSott! on Youtube. I found it extremely useful!

antixmehra7 months ago

Thank you SO MUCH for this tutorial. I am using a Mac, so the procedure was a bit different.

You don't need Tera Term

1. Simply pair your device using the bluetooth icon, the sensor is detected as HC-05, and the passcode is 1234 (note: the connection might or might now work, and sometimes takes many tries. Sorry, but I really have no idea why).

2. Make sure your arduino is NOT connected using the USB cable. Press upload, and it will give you the option of /dev/tty.HC-05-DevB (In my Mac, it shows 0-9, pick the lowest one). Your program will now be uploaded normally.

3. Open the Serial monitor and type 1 or 0 in the textbox next to send, right at the top. Sending 1 turns on the LED on pin 13, Sending 0 turns it off.

Once again, thank you very much for this instructive and coherent tutorial!

Cheers

Subha

cureinside8 months ago

Nice project. now i heave several question, hope you can help

1. will it work if i used atmega8525 instead of arduino kit|

2. do i need level converter module? or can i just use simple voltage divider to make it 3.3v for hc-05 vcc? because from what i read, it supplied with 3.3V vcc.

thanks :)

loulaw1210 months ago

Very nice tutorial. I set my Arduino and HC-05 up exactly as you described. I ran a simple sketch that writes numbers to the monitor via Serial write. It works just fine when I use the USB connection and the Arduino serial monitor, but when I try the Teraterm via the bluetooth the page stays blank. The HC-05 seems to connect just fine and the bluetooth com port listed is com 5. I also tried it on the Arduino IDE using com 5 to the serial monitor and nothing happens. Any suggestions of how to get the Tera Term to display the Arduino messages?

I tried your sketch also, but the same results

Thanks

tym3k10 months ago

Thank you very much! Now my bluetooth module finally works!

zx lee1 year ago

For HC05 there are 6 pins, state, Rx, Tx, GND, Vcc and EN. I just need to connect 4 (Rx, Tx, GND, Vcc) to interface with Arduino?

tym3k zx lee10 months ago

Yes, you need only those 4 pins.

Miykoll made it!11 months ago

Great tutorial. Followed some other tutorials, but didn't get the communication working. Thanks man, you made my day :D

photo128929287980034077.jpg
engereggae1 year ago

see my project with interface Serial arduino bluetooth android: https://www.youtube.com/watch?v=fUQlCDSy8KM

is it necessary to use a max 232 to interface it with atmega 16?

Is there any problem with linking the vcc to the microcontroller's vcc, generally 5V, any consideration for current if needed? I dont know y but 3 of modules that i used after a few use got dead?

ehmedat1 year ago

If allowed possible code transmitter via Bluetooth

1-40 of 52Next »