4
4
In this tutorial, I will explain about Interfacing HC-05 Bluetooth Module with Arduino Uno. HC-05
uses bluetooth classic and can be configured in master or slave modes. It can be interfaced with
a microcontroller using UART.
Components Required
Arduino Uno
LED
Jumper Wires
Bread Board
Software Required
Arduino IDE
Pin Out
STATE : State pin indicates whether the module is connected or paired with a device. When
the module is not connected, this pin will be in LOW state and the on-board LED will be
flashing fast. But when the module is paired or connected to a device, the state pin will be in
HIGH state and the on-board LED will be flashing with a delay.
RXD : This is UART RX pin. This pin is used to send AT command when the module is in
command mode. And it is used to send data to the connected device when the module is in
data mode.
TXD : This is UART TX pin. This pin is used push out responses to AT command when the
module is in command mode. And it is used push out data send by the connected device
when the module is in data mode.
EN/KEY : This input is used to switch between command and data mode. If this pin is set
HIGH, the module will be in command mode. Similarly if this pin is set LOW, the module will
be in data mode.
Circuit Diagram
Interfacing HC-05
Bluetooth Module with Arduino Uno
Description
Hope you installed this app from Google Play Store. This app will act as a Bluetooth remote
controller for Arduino. It is very easy to use this app. Open the app and connect to the HC-05 device.
Then select the option as switch mode. Now you can control the LED using the app.
Program
void setup()
Serial.begin(9600); //Sets the data rate in bits per second (baud) for serial data transmission
void loop()
data = Serial.read(); //Read the incoming data and store it into variable data
Description
Initialize the serial port (UART) with the default baudrate of HC-05 Bluetooth module.
In the loop() we keep checking any data is available to read from the serial port.
If the data read is ‘1’ then the LED is turned ON, else LED will be turned OFF.