

The HC-05 is a Bluetooth module manufactured by Arduino (Part ID: Bluetooth) that enables wireless communication between devices. It is a versatile and cost-effective solution for implementing Bluetooth connectivity in various projects. The module supports both master and slave modes, making it suitable for a wide range of applications, including Internet of Things (IoT) devices, robotics, and wireless data transfer systems.








The HC-05 module is designed to operate efficiently in embedded systems and offers the following key specifications:
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Operating Current | 30mA (typical) |
| Communication Protocol | UART (Universal Asynchronous Receiver-Transmitter) |
| Baud Rate | Default: 9600 bps (configurable) |
| Bluetooth Version | 2.0 + EDR (Enhanced Data Rate) |
| Range | Up to 10 meters (unobstructed) |
| Modes | Master and Slave |
| Dimensions | 37.5mm x 15.2mm x 2.7mm |
The HC-05 module has six pins, as described in the table below:
| Pin Name | Description |
|---|---|
| VCC | Power supply pin (3.3V to 5V). Connect to the power source. |
| GND | Ground pin. Connect to the ground of the circuit. |
| TXD | Transmit pin. Sends serial data to the connected device. |
| RXD | Receive pin. Receives serial data from the connected device. |
| EN (Key) | Enable pin. Used to switch between command mode and data mode. |
| STATE | Indicates the connection status. High when connected, low when not connected. |
The HC-05 module is straightforward to use in a circuit. Follow the steps below to integrate it into your project:
Wiring the Module:
VCC pin of the HC-05 to the 5V pin on the Arduino.GND pin of the HC-05 to the GND pin on the Arduino.TXD pin of the HC-05 to the RX pin (pin 0) on the Arduino.RXD pin of the HC-05 to the TX pin (pin 1) on the Arduino. Use a voltage divider (e.g., 1kΩ and 2kΩ resistors) to step down the Arduino's 5V TX signal to 3.3V for the HC-05's RXD pin.Configuring the Module:
EN pin high (connect it to 3.3V) before powering the module.Arduino Code Example: Below is an example code to send and receive data between the Arduino and a Bluetooth-enabled device (e.g., smartphone):
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial BTSerial(10, 11); // RX = pin 10, TX = pin 11
void setup() {
Serial.begin(9600); // Start Serial Monitor communication
BTSerial.begin(9600); // Start Bluetooth communication
Serial.println("HC-05 Bluetooth Module Initialized");
}
void loop() {
// Check if data is received from Bluetooth
if (BTSerial.available()) {
char data = BTSerial.read(); // Read the incoming data
Serial.print("Received: ");
Serial.println(data); // Print the received data to Serial Monitor
}
// Check if data is sent from Serial Monitor
if (Serial.available()) {
char data = Serial.read(); // Read the data from Serial Monitor
BTSerial.write(data); // Send the data to the Bluetooth device
Serial.print("Sent: ");
Serial.println(data); // Print the sent data to Serial Monitor
}
}
EN pin high before powering the module.No Response from the Module:
VCC and GND pins are properly connected.RXD and TXD pins are correctly wired (crossed connections: TXD to RX, RXD to TX).Data Not Transmitting or Receiving:
Unable to Enter Command Mode:
EN pin is set high before powering the module.Q1: Can the HC-05 connect to multiple devices simultaneously?
A1: No, the HC-05 can only connect to one device at a time.
Q2: How do I reset the HC-05 to factory settings?
A2: Enter command mode and send the AT+ORGL command to reset the module to its default settings.
Q3: Can I use the HC-05 with a 3.3V microcontroller?
A3: Yes, the HC-05 operates at 3.3V logic levels and is compatible with 3.3V microcontrollers.
Q4: What is the difference between master and slave modes?
A4: In master mode, the HC-05 initiates connections with other Bluetooth devices. In slave mode, it waits for incoming connection requests.