How to interface HC-06 Bluetooth Module with Arduino

This blog features a tutorial in which you will learn how to interface HC-06 Bluetooth Module with Arduino UNO R3.

Components Required

  • Arduino UNO R3
  • HC-06 Bluetooth Module
  • Breadboard
  • 1k ohm Resistor

Background Information

In this tutorial, I will interface HC-06 Bluetooth Module with Arduino UNO R3. You will learn about the HC-06 Bluetooth Module, how to interface it with Arduino.

HC-06 Bluetooth Module

HC-06 is a widely used Bluetooth module which can be used as small range wireless communication with the other devices. It only works in the range of < 100m. It has the following features

  • Bluetooth Version: HC-06 uses Bluetooth 2.0 version
  • Interface: It uses UART (Universal Asynchronous Receiver Transmitter) to communicate with other devices, that makes it to use with all types of microprocessors and microcontrollers.
  • Operating Voltage: It operates at 3.3V to 6V. It consumes very small amount of power.
  • Operating Modes: It can be operate in both Master/Slave modes. In Master Mode, it can initiate connections with other Bluetooth Enabled Devices and in Slave Mode, it can be paired Smartphones, Computers, mobiles etc.

Pinout of HC-06 Bluetooth Module

A typical HC-06 Bluetooth Module have 6 Pins but in most cases and in this tutorial we will be using 4 Pins.

Pinout of HC-06 Bluetooth Module
  • VCC: +5V Power Supply needs to power up the Bluetooth module.
  • GND: Ground
  • TXD: Data Transmit Pin (Serial Data is transmitted over this pin)
  • RXD: Data Receive Pin (Serial Data is received over this pin)
  • EN: Power Control Enable Pin
  • KEY/STATE: Status Indicator or Mode Selection Pin

Connecting HC-06 Bluetooth Module with Arduino UNO R3

To connect Arduino board with HC-06 Bluetooth Module, the wiring diagram is as follow.

Interfacing HC-06 Bluetooth Module with Arduino
  • VCC -> 5V
  • GND -> GND
  • TXD -> RXD
  • RXD -> TXD
#include <SoftwareSerial.h>
SoftwareSerial BTSerial (2,3);
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Enter AT Commands");
  BTSerial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if(BTSerial.available()){
    Serial.write(BTSerial.read());
  }
  if(Serial.available()){
    BTSerial.write(Serial.read());
  }
}

Testing of HC-06 with Arduino UNO

After compiling and uploading this code on Arduino UNO board connected with HC-06 Bluetooth module we can test the connection using Android phone. Install Bluetooth Terminal app on the PlayStore and Turn the Bluetooth ON in your phone. Open the app and you will see a device named HC-06. Pair your phone with this device.

After that open the serial monitor of the Arduino and select the 9600 baud rate. After that type anything in the Serial monitor. If you are seeing that data on Bluetooth Terminal app on your phone, it means that the connection is successful.

Scroll to Top