Skip to main content

How to Connect HC-06 Bluetooth Module with Arduino (Step-by-Step Beginner Guide)

Bluetooth communication is one of the easiest ways to make Arduino projects wireless. Once you understand how to use a Bluetooth module, you can build robots, home automation systems, and smartphone-controlled devices.

In this tutorial, you will learn how to interface the HC-06 Bluetooth module with Arduino and send data wirelessly using your phone.
  

By the end of this guide, you will be able to:
  • Understand how the HC-06 Bluetooth module works
  • Configure the module using AT commands
  • Safely connect it to an Arduino
  • Send and receive serial data over Bluetooth
  • Build the foundation for wireless Arduino projects

Watch the Project Overview

What is the HC-06 Bluetooth Module?

The HC-06 is a Bluetooth-to-Serial module designed to add wireless communication to microcontrollers such as Arduino.

It uses Bluetooth 2.0 (SPP - Serial Port Protocol), which means it behaves like a wireless serial cable. Whatever is sent from the phone appears in Arduino’s Serial Monitor and vice versa.

Although Bluetooth 2.0 supports high air data rates, the HC-06 communicates with Arduino using UART serial communication, typically at 9600 - 115200 baud.

Key features

  • Bluetooth 2.0 communication
  • Serial UART interface
  • Default baud rate: 9600
  • Default pairing password: 1234 or 0000
  • Operating voltage: 3.3V logic

HC-06 Pinout


The module usually has four main pins:

Pin                                            Function                                

VCC                                        Power supply (3.6 - 6V)
GND                                        Ground
TXD                                        Transmits data
RXD                                        Receives data

Components Required

  • Arduino Uno (or any Arduino board)
  • HC-06 Bluetooth module
  • USB-to-TTL converter (for configuration)
  • Breadboard
  • Jumper wires
  • 1kΩ resistor
  • 2kΩ resistor

Configuring the HC-06 Using AT Commands

Before connecting the module to Arduino, it is useful to configure its settings such as name and baud rate.

Wiring to USB-TTL Converter

HC-06                                        USB-TTL

VCC                                            5V
GND                                            GND
TXD                                            RX
RXD                                            TX

Open the Serial Monitor and set:
  • Baud rate: 9600
  • Line ending: Both NL & CR

Basic AT Commands

Command                                        Function

AT                                                   Check connection
AT+NAME=MyBluetooth             Change device name
AT+PIN=1234                                Change password
AT+BAUD4                                   Set baud rate to 9600


If the module replies with OK, configuration is successful.

Connecting HC-06 to Arduino

Wiring

HC-06                                                Arduino

VCC                                                     5V
GND                                                     GND
TXD                                                     Pin 10
RXD                                                     Pin 11 (through voltage divider)

Why a Voltage Divider is Required

This step is very important.
  • Arduino TX pin outputs 5V logic
  • HC-06 RX pin accepts 3.3V logic
Connecting directly can damage the module.

A voltage divider using 1kΩ and 2kΩ resistors reduces 5V to approximately 3.3V, making the connection safe.

Arduino Code

Upload the following sketch to Arduino:

How the Code Works

SoftwareSerial Library

The HC-06 communicates using serial. Since Arduino already uses the hardware serial for USB communication, we create a software serial port.
 
SoftwareSerial BTserial(10, 11);

  • Pin 10 → Arduino receives from HC-06
  • Pin 11 → Arduino transmits to HC-06

Setup Function

Serial.begin(9600);
BTserial.begin(9600);


Both serial ports run at the same baud rate.

Loop Function

The Arduino continuously checks for incoming data:
  • If data comes from Bluetooth → send to Serial Monitor
  • If data comes from Serial Monitor → send to Bluetooth
This creates two-way communication.

Testing with Your Smartphone

  1. Install a Bluetooth terminal app.
  2. Power the Arduino.
  3. Pair your phone with the module (PIN: 1234).
  4. Open the app and connect.
  5. Send text from the phone → appears in Serial Monitor.
  6. Send text from Serial Monitor → appears on phone.
You now have wireless serial communication!
 

Common Problems and Fixes

Module not responding to AT commands

  • Ensure the module is not paired during configuration.
  • Confirm baud rate is 9600.

Cannot pair with phone

  • Try PIN 1234 or 0000.
  • Check LED blinking (fast blink = waiting to pair).

Random characters in Serial Monitor

  • Baud rate mismatch between Arduino and HC-06.

No data transmission

  • Check RX/TX cross connection.
  • Ensure voltage divider is used.

What You Can Build Next

Now that Bluetooth communication works, you can create:
  • Bluetooth controlled robot
  • Smartphone home automation system
  • Wireless sensor monitoring
  • Phone-controlled LEDs and motors

This simple setup is the foundation for many wireless Arduino projects.

Conclusion

You have successfully learned how to interface the HC-06 Bluetooth module with Arduino and establish wireless serial communication. This skill opens the door to building interactive and IoT-style projects controlled directly from your smartphone.

Frequently Asked Questions

Is HC-06 better than HC-05?

HC-06 works only as a slave device, while HC-05 can be master or slave.

What is the range of HC-06?

Typical range is 5–10 meters indoors.

Can I control Arduino with phone using HC-06?

Yes. Any Bluetooth terminal app can send commands to Arduino.

Comments

Popular posts from this blog

Arduino Serial Communication Beginner Guide (UART Explained)

Serial communication is the backbone of most Arduino projects. It allows your Arduino to talk to your computer, Bluetooth modules, Wi-Fi modules, sensors, and even other Arduinos. If you have ever used the Serial Monitor, you have already used serial communication - now you will understand how it really works. By the end of this guide, you will learn: What serial communication is What UART means How Arduino communicates with devices How to send and receive data How baud rate works Common mistakes beginners make What is Serial Communication? Serial communication is a method of sending data one bit at a time over a single wire. Instead of sending many bits simultaneously (parallel communication), serial sends bits sequentially: Example: The letter A in binary = 01000001 These bits are sent one after another very quickly. This method is: Simple Reliable Perfect for microcontrollers What is UART? UART stands for: Universal Asynchronous Receiver Transmitter It is the hardware ins...

How to Use SoftwareSerial on Arduino (Connect Multiple Serial Devices)

In the previous tutorial, you learned how Arduino uses hardware serial communication through pins 0 (RX) and 1 (TX). That built-in serial port is mainly used to communicate with your computer through the USB cable and Serial Monitor . But here is the problem beginners quickly face: Many popular modules use serial communication, such as: Bluetooth modules ( HC-05 / HC-06 ) GPS modules GSM modules Wi-Fi modules ( ESP8266 ) Arduino Uno has only one hardware serial port. So how can we connect these modules while still using the Serial Monitor? The solution is SoftwareSerial . In this tutorial you will learn how to create additional serial ports using normal digital pins. By the end, your Arduino will be able to talk to multiple serial devices. What is SoftwareSerial? SoftwareSerial is a special Arduino library that allows digital pins to behave like RX and TX pins. This means Arduino can create extra serial ports using software instead of hardware. Hardware Serial vs Software Seri...