Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a new project in which we are gonna do Arduino Bluetooth communication. The Bluetooth module I have used for this project is HC-05, which is a serial Bluetooth module. We can quite easily perform the Bluetooth communication with this module using Arduino board. I have worked on many projects in which I have to send the data from sensors to my computer via Bluetooth. So, in such projects I normally use this Bluetooth module which is connected with the sensors and then Arduino gets the data from these sensors and then send this data to computer via Bluetooth module. In this project, I have used Arduino board but you can use PIC Microcontroller or 8051 Micrcontroller as well. Because they both have the Serial pins on them.
Before reading any further, I think you must have a look at the below post from where you can download the Bluetooth Library for Proteus, using this library you can easily simulate HC-05 or , HC-06 in Proteus software:
I have also done Bluetooth communication with Android mobiles. In these projects I have sent the data from this Bluetooth module to Android mobiles but in such projects I have also designed Bluetooth app on which this data is received. Anyways, that’s a topic of another tutorial. Today, I am gonna connect this Bluetooth module with Arduino board and then will send some data to my computer using Bluetooth. So, let’s get started with Arduino Bluetooth communication using HC-05 module.
Arduino Bluetooth Communication using HC-05
- First of all, what you need to do is to buy the Arduino board. I have designed this project using Arduino UNO board but you can buy any of the Arduino Microcontroller board.
- Next thing you are gonna need is Bluetooth module which is HC-05. But this tutorial will also work for HC-06 or HC-07.
- Now if you have seen HC-05 then the pins are written on it so connect them with your Arduino board as shown below:
- This pin configuration is also shown in the below figure:
- Now that you have connected your Arduino board with the Bluetooth module HC-05 so you are ready to do the Arduino Bluetooth communication.
- Now upload the below code in your Arduino board:
SoftwareSerial mySerial(2, 3);
- Its a simple software serial code in which we are sending data from our Serial terminal to Bluetooth means whatever you write in your serial terminal will be sent over to Bluetooth and whatever you receive on your Bluetooth will be shown in serial terminal.
- Now, download this Serial monitor software, I have designed this software and its quite simple one. You can use any other serial monitor like Virtual Terminal in Proteus or Hyper Terminal in Windows XP.
- We are gonna use this software to get the data on our computer via Bluetooth and you computer must have the Bluetooth in your computer. 😛
- So, download this software by clicking the below button and you can read more about it Microsoft Visual Basic 2010 – Com Port Tutorial.
- Now turn on your Arduino and search for the Bluetooth device in your Bluetooth settings and paired with it as shown in below figure.
- The default pin code for HC-05 is 1234.
- Now you can see I have paired the HC-05 device.
- Now, open this software and connect with the COM port of your Bluetooth device.
- The Bluetooth device generates two COM ports in my case it generated COM11 and COM12 but COM11 worked.
- So, I connected with COM11 and then whatever I entered in my software is shown on the serial monitor of my Arduino and whatever I entered in the Serial monitor of Arduino is shown in the serial terminal software.
- Its quite simple and you can do it quite easily.
So, that’s all for today and I hope you are gonna make it work in the single attempt. If still having problems then ask in comments and I will resolve them. So, today we have done Arduino Bluetooth communication using HC-05 module.