Interfacing Arduino with HC-05

Hello friends, i hope you all are fine and enjoying. Today i am going to share a new tutorial which is Interfacing Arduino with HC05 Bluetooth module. First of all lets have a little introduction about HC-05 Bluetooth module. HC-05 is a bluetooth module, which was designed for wireless data communication. This little module is capable of both sending and receiving data but it performs only one thing at a time, which means at a particular time it can only send or receive data but can't do the both tasks.

In order to send or to receive data, you have to make one module as a master and the other module as a slave. If both the modules are acting as master then, data will not transmit and if both the modules are acting as a slave then, again data will not transmit or receive. The hardware of Bluetooth module contains a large no of features. For example it is much sensitive and it is sensitive up to -80dBm and it catches a Bluetooth signal even from far away. If you wish to transmit data through it then, it also have much power to transmit data to a wider range. You can image its transmitting power from the digits that it has transmitting power of +4dBm. This module operates on a low voltages, that's why the power rating of this module is very low. The hardware of the module comes with a integrated antenna and also its hardware contains edged pins. These edged pins gives us the ease that it becomes very easy to plug in or plug out the wires. and also if you are going to use it within a circuit then, it becomes very easy to connect the cable with module. Above was a little introduction about Bluetooth module and its features. now lets move to the basic theme of our project, which is to do interfacing between arduino and HC-05.

Note:

  • If you have HC-06 or any other module in HC series then you don't need to get worried as they all work quite same. So you can also follow this tutorial for other HC series bluetooth modules.

Pin Configuration of HC-05

HC-05 Bluetooth module has total 6 pins. A simple HC-05  Bluetooth module is shown in the image given below and you can also see its pin configuration from this image. The pin configuration and the purpose of each pin is listed below as:

  1. They pin#1 is abbreviated a KEY pin. The function of this key is to show paired devices. In HC-05 module this pin is used to perform the module in AT mode.
  2. Pin#2 of HC-05  module is named as VCC pin. This module requires 3.3 volts to operate. If you will connect it directly with 5 volts then, this module will burn out.
  3. Pin#3 of this module is named as GND. At this pin the common ground of the circuit is provided.
  4. pin#4 is named as TXD. This pin is used when you have to transmit data to some external device. Asynchronous data transfer is performed by this module.
  5. pin#5 is named as RXD. This pin is used when the module have to receive wireless data from some external source. Asynchronous data is received through this module.
  6. The last pin of the module which is in fact pin#6 of the module and it is named as STATUS pin. The basic function of this pin is to check the status of the Bluetooth module. If the module is connected to some other device then, output of the system becomes HIGH and if the connection of Bluetooth drops then, this module generates a output pulse.

Interfacing with Arduino

So, now let's start with interfacing Arduino with HC05 bluetooth module. Its quite easy to interface as it works on Serial protocol. As mentioned above it has two pins named as TX and RX through which we can send or receive the data. Moreover, it works exactly the same as any mobile's bluetooth, you can connect your mobile with any device and can share data between these devices, similarly you can share the data with this device as well.
  • First of all, connect your HC05 bluetooth module with Arduino as shown in the below figure.
  • In the above figure, the connections are quite easy , we have provided power to the bluetooth module from Arduino and also connected TX pin of bluetooth module with RX pin of Arduino and RX pin of bluetooth module with TX of Arduino.
  • Now we are done with the connections so next part is to upload the code into Arduino.

Code for interfacing HC-05 with Arduino

Now upload the below code into your Arduino and you are ready to get the first data from your Bluetooth module.

Applications of HC-05 Module

  • The biggest application is that it is used to transmit or receive data wirelessly.
  • You can play your favorite sound tracks through bluetooth in your car using this module.
  • The modern Android phones contains a wireless GPS option. IN fact this module is being used in that phones and it works to seek the bluetooth location.
  • This module makes you able to chat with some android phone using Bluetooth.
Alright friends, that all for today. If you have any question, fell free to ask. Till next tutorial Take Care!!! :)

HC-05 Bluetooth Module Pinout, Datasheet, Features & Applications

Hello friends, I hope you all are doing great. Today, we will discuss HC-05 Bluetooth Module in detail. We will also study HC-05 Pinout, Datasheet, Features & Projects. HC05 is a Bluetooth module, that works on Serial Protocol ( RX/TX ) for sending and receiving data. We have also designed Bluetooth Library for Proteus, which will help you in simulating this Bluetooth Module in Proteus software.

HC05 Bluetooth Module consists of CSR Bluecore 04 outer single-chip Bluetooth system having CMOS (complementary metal-oxide-semiconductor) technology. This module also fulfils the Bluetooth V2.0+EDR technology. So let's get started with Introduction to HC-05.

Where To Buy?
No.ComponentsDistributorLink To Buy
1HC-05AmazonBuy Now

HC-05 Bluetooth Module

  • HC-05 Bluetooth Module is a low-cost, easy-to-operate & small-sized module used for wireless communication in the Bluetooth spectrum.
  • It supports Serial Port Protocol (SPP), which helps in sending/receiving data to/from a microcontroller (i.e. Arduino UNO).
  • Its default baud rate is 9600 for data communication and 38400 for command mode communication.
  • HC05 can operate in master/slave mode and thus multiple slave nodes can be controlled using a single master node (called mesh networking).
  • HC-05 supports "AT commands", controlled by TX (transmission) and RX (receiver) pinouts.
  • You should also have a look at Arduino Bluetooth Communication using HC05.

HC-05 Pinout

  • HC-05 Pinouts are used for powering up the module and sending/receiving data via Serial Port.
  • So, let's have a look at HC-05 Pinout, shown in below table:
HC-05 Pinout
Pin# Pin Name Working
Pin#1 Enable Pin  The purpose of this pinout is to set data value at a high and low level.
Pin#2 Vcc At this pinout, the input supply is provided to the module. Its operating voltage is plus five volts.
Pin#3 GND Ground (0V)
Pin#4 TX Serial Transmitting Pin.
Pin#5 RX Serial Receiving Pin
Pin#6 State This Pin is connected to an LED, shows the operating state of the HC-05 Bluetooth module.
  • Here's the image, where I have labelled HC-05 Pinout:
  • In the above figure, I have labelled 7. LED, which tells about different states of Bluetooth module:
    • If it's blinking once in two seconds, it has received a command.
    • If it's blinking continuously, means the module is waiting for input data.
    • If it's blinking twice in one second, means it's connected properly.

HC-05 Datasheet

  • You can download the HC-05 datasheet by clicking the below button:

HC-05 Features

  • HC05 follows the "Bluetooth V2.0+EDR" protocol (EDR stands for Enhanced Data Rate).
  • Its operating frequency is 2.4 GHz ISM Band.
  • HC05 uses CSR Bluecore 04-External single-chip Bluetooth system with CMOS technology.
  • This module follows the IEEE (Institute of Electrical and Electronics Engineers) 802.15.1 standard protocol.
  • Dimensions of HC-05 are 12.7mmx27mm.
  • Its operating voltage is 5V.
  • It sends and receives data by UART, which is also used for setting the baud rate.
  • it has -80dBm sensitivity.
  • This module also uses (FHSS), a technique by which a radio signal is sent at different frequency levels.
  • This module has the ability to work as a master/slave mode.
  • This module can be easily connected with a laptop or mobile phone via Bluetooth.

HC-05 Working

  • HC-05 is normally used in embedded projects, where data needs to be transmitted wirelessly over a small distance.
  • We can transmit data between two HC-05 modules and can also send data from HC-05 to any Bluetooth appliance i.e. mobile phone, laptop etc.
  • In order to do so, first of all, we need to power up our HC-05 module, as shown in below figure:
  • As we push the button connected to Key Pin, it will get LOW & HC-05 will start blinking.
  • Now, if you check on your mobile phone or laptop, you will be able to find a new Bluetooth device named HC-05.
  • Once you connected with this device, you will be able to send and receive data in a serial stream manner.
  • This stream is then processed by a microcontroller (i.e. Arduino UNO) attached with HC-05.
  • However, do not expect this module to transfer multimedia like photos or songs; you might have to look into the CSR8645 module for that.

HC-05 Arduino Interfacing

  • HC-05 has 2 working modes:
    • Data Mode: HC05 sends and receives data via Bluetooth spectrum and then further processes it to Serial Pins.
    • Command Mode: HC-05 waits for AT (ATtention) commands, acts accordingly & then sends the response in return.
  • This module uses SPP (Serial Port Protocol) for the transmission of data so it can be easily interfaced with any microcontroller.
  •  For HC-05 Arduino Interfacing:
    • 5V to Vcc Pin.
    • 0V to GND Pin.
    • RX (receiver) pin of HC-05 with the TX (transmitter) pin of UNO.
    • TX pin of the HC-05 with the RX pin of UNO.

HC-05 Applications

Now, let's have a look at HC-05 Applications, it can be used in various ways, here I have mentioned few of them:
  • HC-05 Bluetooth Module is normally used for wireless data transmission among multiple microcontrollers.
  • It can also be used to communicate between electronic devices like mobile, laptop, computers for data transmission.
  • It also used in different information and data logging applications.
  • It's used in robotics for wireless control.
  • It's used in autonomous projects for collecting data.
So, that was all about the HC05 Bluetooth Module. I have tried my best to explain everything related to this module but if you have any question, ask in the comments. Thanks for reading. Have a good day. :)

Bluetooth Library for Proteus

Hello friends, hope you all are fine. Today, I am going to share a new Bluetooth Library for Proteus. Using this Library, now you can quite easily use Bluetooth modules in Proteus ISIS. I have designed two Bluetooth modules which are HC-05 and HC-06. We all know about these modules. We use these modules for sending data through Bluetooth. Till now, there's no such Bluetooth Library designed for Proteus and we are the first developers of this awesome Bluetooth Library for Proteus. I hope you guys are gonna like it. I have also posted a tutorial in which I have done Arduino Bluetooth Communication using HC05 in hardware. I hope that one will also be interesting to read, if you have planned to start working on Bluetooth Module.

Other bloggers are welcome to share this Bluetooth Library for Proteus on their blogs but do mention our link as a respect to our efforts. These Bluetooth modules are not gonna accept AT Commands rite now as we haven't added much functionality in it but we are gonna add more soon. I will also add more Bluetooth modules in this library and will update it with time. Rite now, it just has two Bluetooth modules in it, which are:

You can do serial communication with these modules quite easily. So, let's get started with Bluetooth Library for Proteus an see How to install it and how to use it in Proteus.

Note: Other Proteus Libraries are as follows:

Bluetooth Library for Proteus

  • So, first of all, download this Bluetooth Library for Proteus by clicking the below button:
Bluetooth Library for Proteus

  • In this rar file, you will find two files which are named as:
    • BluetoothTEP.IDX
    • BluetoothTEP.LIB
  • So, download these two files and place them in the library folder of your Proteus ISIS software.
Note:
  • Now open your Proteus software or restart it if its already open and search for Bluetooth and you will get something as shown in below figure:
  • Now select both of these modules and place them in your workspace and it will look like something as shown in below figure:
  • As, I told earlier, we have just used the basic TX and RX pins of these Bluetooth modules.
  • That's why you can see in the above figure that only TXD and RXD are working while all others are not working.
  • Let's have a look at it working, so let's design a simple circuit and do the communication between these two Bluetooth modules.
  • If you haven't worked on Virtual Terminals then you should read How to use Virtual Terminal in Proteus.
  • So, design a simple circuit as shown in below figure:
  • Now click any HC-05 module and you will get a pop up window.
  • In this window, select COM1 for first HC05 module and COM2 for second HC05 module.
  • Now your COM1 and COM2 should be virtually connected, I have shown how to connect the COM ports virtually in the below video.
  • Now, run your simulation and whatever you send in first terminal will show in second terminal and vice versa.
That's all for today, hope you have liked this post and are gonna enjoy it. Let me know about your remarks for this Bluetooth Library for Proteus. Have fun !!! :)

Arduino Bluetooth Communication using HC05

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 Microcontroller as well. Because they both have the Serial pins on them.

Note:

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:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() 
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
  • 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. :P
  • So, download this software by clicking the below button and you can read more about it Microsoft Visual Basic 2010 - Com Port Tutorial.

Download Serial Terminal

  • 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.

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir