How to Interface HC-06 to Arduino
Table of Contents
Electronics projects nowadays usually needs a wireless communication interface. Bluetooth device is one of the most commonly use for this purpose.
Today, I am going to show you on how to interface HC-06 bluetooth module to Arduino.
BILL OF MATERIALS
- HC-06 bluetooth module
- Arduino Uno board
- A couple of jumper wires
HARDWARE INSTRUCTION
- Connect the HC-06 VCC pin to +5V pin of Arduino Uno (please refer to the schematic below).
- Connect the HC-06 GND pin to GND pin of Arduino Uno.
- Connect the HC-06 TXD pin to pin 2 of Arduino Uno (functions as Rx).
- Connect the HC-06 RXD pin to pin 3 of Arduino Uno (fucntions as Tx).
- Connect the Arduino Uno to the computer.
- Run the Arduino IDE.
- Make sure Arduino Uno is selected under Tools > Board.
- Select the correct serial port under Tools > Port.
- Upload the sketch. Source code is provided below.
This basically echoes the serial data through HC-06 to hardware serial of Arduino Uno and vice-versa.
HC-06 Troubleshooting
- Connect a jumper wire between HC-06 RXD and TXD.
- Connect +5V supply to VCC.
- Connect the supply ground to GND pin.
- Using a mobile / smart phone connect through a bluetooth to HC-06.
- Enter pin code 1234.
This basically echoes whatever is received by the HC-06 to a bluetooth terminal.
CALL TO ACTION
If you find this lesson useful, please kindly support my blog and Youtube channel. Links provided below:CIRCUIT DIAGRAM

SOURCE CODE
#include <softwareserial.h>
SoftwareSerial hc06(2,3);
String cmd="";
void setup(){
//Initialize Serial Monitor
Serial.begin(9600);
//Initialize Bluetooth Serial Port
hc06.begin(9600);
Serial.print("Setup DONE.");
}
void loop(){
//Write data from HC06 to Serial Monitor
if (hc06.available()){
Serial.write(hc06.read());
}
//Write from Serial Monitor to HC06
if (Serial.available()){
hc06.write(Serial.read());
}
delay(100);
}
×