How to Interface HC-05 Bluetooth Module With Arduino Uno 

20.03.23 12:25 PM By AKB

How to Interface HC-05 Bluetooth Module With Arduino Uno

In this blog, you will get to know how to interface the HC-05 Bluetooth module with Arduino UNO. Upon completing the project you will be able to send messages to Arduino and can receive a message back from Arduino. Through this, you are able to establish a communication platform between the Arduino and your Smartphone. 

As the used Internet of Things(IoT) is increasing due to rapid research and development which is unlocking the huge potential of connected devices. The Internet of Things (IoT) describes the network of physical objects i.e “things” that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the internet. And the HC-05 Bluetooth module is the basic low-distance communication device through which we can even build industrial projects.

Before going to build this project let us see the applications we can build with HC-05 Bluetooth Module:

  1. Wireless speakers and headphones

  2. Wireless mouse and keyboard

  3. Car or Home stereo system

  4. Smart door locks

  5. Smart home automation

  6. Swarm robots and robotics

  7. And various IoT based projects

Let’s now understand what is Bluetooth technology and the HC-05 Bluetooth module:

Bluetooth is a short-range wireless technology standard that is used for the transfer of data between fixed devices over short distances and personal area networks. Bluetooth is a communication protocol that provides cheaper communication in PAN (Personal Area Network). It provides a maximum data rate of 1Mb/S, working in a nominal range of 100 meters with 2.4 GHz frequency.


HC-05 Bluetooth module:

How to Interface HC-05 Bluetooth Module With Arduino Uno

HC-05 is a class-2 Bluetooth module with Serial Port, which can configure as either Master or slave. a Drop-in replacement for wired serial connections, and transparent usage. We can use it simply for a serial port replacement for connection between MCU, PC to your embedded project and etc.


HC-05 Bluetooth module Specification:

  • Bluetooth protocol: Bluetooth Specification v2.0+EDR

  • Frequency: 2.4GHz ISM band

  • Modulation: GFSK(Gaussian Frequency Shift Keying)

  • Emission power: ≤4dBm, Class 2

  • Sensitivity: ≤-84dBm at 0.1% BER

  • Speed: Asynchronous: 2.1Mbps(Max) / 160 kbps, Synchronous: 1Mbps/1Mbps

  • Security: Authentication and encryption

  • Profiles: Bluetooth serial port

  • Power supply: +3.3VDC 50mA

  • Working temperature: -20 ~ +75 Centigrade

  • Dimension: 26.9mm x 13mm x 2.2 mm

Due to these features, the Bluetooth HC-05 module is majorly used all the way from IoT-grade projects to industrial ones.

Click here to check HC-05 module Details

What is Arduino UNO?

                                                                                                                              How to Interface HC-05 Bluetooth Module With Arduino Uno

Arduino UNO is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins, 6 can be used as PWM outputs, 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller for IoT projects with Arduino IDE code editor.


· The operating voltage is 5V

· The recommended input voltage will range from 7v to 12V

· The input voltage ranges from 6v to 20V

· Digital input/output pins are 14

· Analog i/p pins are 6

· DC Current for each input/output pin is 40 mA

· DC Current for 3.3V Pin is 50 mA

· Flash Memory is 32 KB

· SRAM is 2 KB

· EEPROM is 1 KB

· CLK Speed is 16 MHz

Let’s now begin to build our project, where we will interface HC-05 Bluetooth Module With 

Arduino Uno:

Requirements:

HC-05 Bluetooth module, Arduino UNO, Jumper wires, 1K and 2K single resistors, Arduino IDE

Interfacing Diagram  of HC-05 with Arduino:

                                                                                           How to Interface HC-05 Bluetooth Module With Arduino Uno

After the successful connection of Arduino UNO and HC-05 Bluetooth module as shown in the above image, we will upload the firmware to the Arduino UNO.

In this project, we will send data from our Smartphone via Bluetooth to the Arduino Uno and display it on the Serial Monitor of the PC.

Let's start Coding:

Open your Arduino IDE software on your PC and connect Arduino to your USB port. After connecting the Arduino UNO board to the PC select an appropriate port and copy/paste the following code into the Arduino IDE editor.


#include<SoftwareSerial.h>


/* Create object named bt of the class SoftwareSerial */ 

SoftwareSerial bt(2,3); /* (Rx,Tx) */


voidsetup(){

 bt.begin(9600);/* Define baud rate for software serial communication */

 Serial.begin(9600);/* Define baud rate for serial communication */

}


voidloop(){

 

 if (bt.available())/* If data is available on serial port */

 {

 Serial.write(bt.read());/* Print character received on to the serial monitor */

 }

}

After writing, upload the code to the Arduino UNO Board.

For test Purpose download and install the app Bluetooth Terminal which is available on Playstore. We will use this app to connect our smartphone to the HC-05 Bluetooth module.

                                                                                                                                                How to Interface HC-05 Bluetooth Module With Arduino Uno

Conclusion:

Using the above process you can use the HC-05 Bluetooth module for communication purposes as per your requirements.

Once you successfully complete this project using Arduino UNO board, then you can easily try with other microcontrollers like ArduinoMega,UNO,NANO,Atmega328p,Arduino uno R3 as per your need. At Campus Component we are also providing Arduino cable and Arduino shield as per your project requirements

We can make different projects using the HC-05 Bluetooth module and Arduino UNO, eg. in smart agriculture, smart homes, smart sound systems and many applications related to large industries.

If you are looking for electronic components and different microcontrollers, reach out Campus Component today!

Added to cart
- There was an error adding to cart. Please try again.
Quantity updated
- An error occurred. Please try again later.
Deleted from cart
- Can't delete this product from the cart at the moment. Please try again later.