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:
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.
The module usually has four main pins:
A voltage divider using 1kΩ and 2kΩ resistors reduces 5V to approximately 3.3V, making the connection safe.
SoftwareSerial BTserial(10, 11);
BTserial.begin(9600);
Both serial ports run at the same baud rate.
This simple setup is the foundation for many wireless Arduino projects.
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
Pin Function
VCC Power supply (3.6 - 6V)
GND Ground
TXD Transmits data
RXD Receives data
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 5VGND GND
TXD RX
RXD TX
Open the Serial Monitor and set:
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.
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)
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
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
Testing with Your Smartphone
- Install a Bluetooth terminal app.
- Power the Arduino.
- Pair your phone with the module (PIN: 1234).
- Open the app and connect.
- Send text from the phone → appears in Serial Monitor.
- Send text from Serial Monitor → appears on phone.
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.




Comments
Post a Comment