

The HC-05 is a Bluetooth module that allows for wireless communication between devices. It operates in the 2.4 GHz frequency range and is commonly used in embedded systems for connecting microcontrollers to smartphones or other Bluetooth-enabled devices. The module supports both master and slave modes, making it versatile for a wide range of applications.








The HC-05 module is designed for ease of use and reliable communication. Below are its key technical details:
The HC-05 module typically has 6 pins. Below is the pinout and description:
| Pin | Name | Description |
|---|---|---|
| 1 | EN/KEY | Used to switch between command mode and data mode. Pull HIGH to enter command mode. |
| 2 | VCC | Power supply input (3.3V to 5V). |
| 3 | GND | Ground connection. |
| 4 | TXD | Transmit data pin. Sends serial data to the connected device. |
| 5 | RXD | Receive data pin. Receives serial data from the connected device. |
| 6 | STATE | Indicates the connection status (HIGH when connected, LOW when disconnected). |
The HC-05 module is straightforward to use in a circuit. Below are the steps and best practices for integrating it into your project.
1234 or 0000.Below is an example of how to use the HC-05 with an Arduino UNO to send and receive data.
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial BTSerial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
// Start the hardware serial communication
Serial.begin(9600); // For communication with the PC
// Start the Bluetooth serial communication
BTSerial.begin(9600); // Default baud rate of HC-05
Serial.println("HC-05 Bluetooth Module Test");
Serial.println("Send data from the Serial Monitor to test.");
}
void loop() {
// Check if data is available from the Bluetooth module
if (BTSerial.available()) {
char data = BTSerial.read(); // Read the data
Serial.print("Received from Bluetooth: ");
Serial.println(data); // Print the data to the Serial Monitor
}
// Check if data is available from the Serial Monitor
if (Serial.available()) {
char data = Serial.read(); // Read the data
BTSerial.write(data); // Send the data to the Bluetooth module
Serial.print("Sent to Bluetooth: ");
Serial.println(data); // Print the data to the Serial Monitor
}
}
Module Not Pairing:
1234 or 0000).No Data Transmission:
Unstable Connection:
Cannot Enter Command Mode:
Q: Can the HC-05 connect to multiple devices simultaneously?
A: No, the HC-05 supports only one-to-one communication.
Q: How do I reset the HC-05 to factory settings?
A: Enter command mode and send the AT+ORGL command.
Q: Can I use the HC-05 with a 5V microcontroller?
A: Yes, but use a voltage divider or level shifter for the RXD pin to avoid damage.
Q: What is the difference between HC-05 and HC-06?
A: The HC-05 supports both master and slave modes, while the HC-06 operates only in slave mode.