The HC-05 and HC-06 Bluetooth modules have become one of the most popular solutions for adding wireless connectivity to Arduino projects. Thanks to their versatility and affordable price , these devices allow for wireless communication with computers, smartphones, and other Bluetooth-enabled devices.
If you're looking to integrate these modules into your projects, it's essential to understand their differences , how to configure them , and how to connect them correctly to Arduino. In this article, we'll explore everything you need to know to get the most out of them.
What are the HC-05 and HC-06 Bluetooth modules?
The HC-05 and HC-06 Bluetooth modules are small electronic devices that enable wireless communication via the Bluetooth 2.0 protocol. They are widely used in robotics , home automation , and other microcontroller-based systems.
Both modules offer similar functionalities, but they have one key difference :
- HC-06: It only works in slave mode, which means it cannot initiate a connection, only respond to requests from master devices.
- HC-05: It can operate in master mode o slave mode, allowing you to both initiate and receive Bluetooth connections.
No products found.
Technical characteristics
- Operating voltage: 3.3V - 5V.
- Transmission frequency: 2.45 GHz.
- communication speed: Configurable between 1200 and 1382400 baud.
- Reach distance: Approximately 10 meters without obstacles.
- Compatible with standard Bluetooth devices (PC, mobile phones, etc.).
Differences between HC-05 and HC-06

Although both modules look similar, they have important functional differences :
| Feature | HC-05 | HC-06 |
|---|---|---|
| Operation mode | Master and slave | Only slave |
| Configuration | More options using AT commands | limited options |
| Settings button | Yes | No |
Connecting the Bluetooth module to Arduino
To use these modules with Arduino, it is essential to make the correct pin connections:
- VCC: Connects to 5V in most cases. Some models operate on 3.3V only.
- GND: Connects to GND on Arduino.
- TX: Connects to the Arduino RX pin.
- RX: Connects to the TX pin of Arduino. In some cases, it is recommended to place a voltage divider to prevent damage from voltage levels.
How to configure the Bluetooth module with AT commands
To modify parameters such as the module name , password , or transmission speed , we must use AT commands . The procedure varies depending on the module:
AT mode in HC-06
The HC-06 automatically enters AT mode when not paired with another device. Once connected to the Arduino, we can send commands from the serial monitor.
AT mode in HC-05
The HC-05 requires you to hold down its built-in button when powering on the module to enter AT mode. In this state, the LED blinks slowly instead of rapidly.
Most used AT commands
- AT: Check if the module is responding.
- AT+NAME=name: Changes the visible name of the module.
- AT+PSWD=key: : Change the pairing key (default is 1234).
- AT+UART=9600,0,0: Set the transmission speed.
- AT+ROLE=0: Configures the module as a slave (HC-05 only).
- AT+ROLE=1: Sets the module as master (HC-05 only).
Code example for Arduino
This basic code allows you to receive and send data between Arduino and a Bluetooth device.
#include SoftwareSerialBT(10, 11); // RX, TX void setup() { Serial.begin(9600); BT.begin(9600); } void loop() { if (BT.available()) { Serial.write(BT.read()); } if (Serial.available()) { BT.write(Serial.read()); } }
With this code, any data sent from a mobile phone or PC will reach the Arduino and be displayed on the serial monitor. Similarly, any data entered on the serial monitor will be sent to the Bluetooth device.
Communication tests with PC and smartphone
To verify that the module is working correctly, we can pair it with a PC or a smartphone. On Windows, we can use programs like HyperTerminal or PuTTY , while on Android there are apps like BlueTerm that allow communication via Bluetooth.
Configuring the module as Master or Slave
If we are using an HC-05 and want it to automatically pair with another Bluetooth module, we must configure it in Master mode . To do this, we can use these commands:
- AT+ROLE=1 → Activate Master mode.
- AT+CMODE=0 → Set up connection with a specific device.
- AT+BIND=xx:xx:xx:xx:xx:xx → Specifies the address of the slave device.
On the other hand, a slave module (HC-06 or HC-05 in slave mode) simply waits for a master connection .
This article provides a detailed overview of all aspects necessary for using and configuring the HC-05 and HC-06 Bluetooth modules with Arduino. From their technical differences to how to establish communication with other devices, understanding these features will allow you to take full advantage of these modules' capabilities in various electronics projects.