The HC-05 is a Bluetooth module manufactured by Arduino, with the part ID "Bluetooth Module." It is designed to enable wireless communication between devices over the 2.4 GHz frequency range. The module supports both master and slave modes, making it a versatile choice for a wide range of applications. It is commonly used in Internet of Things (IoT) projects, robotics, and wireless data transfer systems.
The HC-05 Bluetooth module is a robust and reliable component with the following key specifications:
Parameter | Value |
---|---|
Operating Voltage | 3.3V to 5V |
Operating Current | 30 mA (typical) |
Communication Protocol | UART (Universal Asynchronous Receiver-Transmitter) |
Baud Rate | Default: 9600 bps (configurable) |
Frequency Range | 2.4 GHz ISM band |
Bluetooth Version | Bluetooth 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 | Pin Number | Description |
---|---|---|
EN (Key) | 1 | Enables AT command mode when pulled HIGH. Leave LOW for normal operation. |
VCC | 2 | Power supply input (3.3V to 5V). |
GND | 3 | Ground connection. |
TXD | 4 | Transmit data pin. Sends serial data to the connected device. |
RXD | 5 | Receive data pin. Receives serial data from the connected device. |
STATE | 6 | Indicates the connection status (HIGH when connected, LOW when disconnected). |
Below is an example code to establish communication between an Arduino UNO and the HC-05 module:
// Example: HC-05 Bluetooth Module with Arduino UNO
// This code sends and receives data via the HC-05 module.
#include <SoftwareSerial.h>
// Define RX and TX pins for SoftwareSerial
SoftwareSerial BTSerial(10, 11); // RX = Pin 10, TX = Pin 11
void setup() {
// Initialize hardware serial communication
Serial.begin(9600); // For communication with the PC
Serial.println("Enter AT commands:");
// Initialize Bluetooth serial communication
BTSerial.begin(9600); // Default baud rate for HC-05
}
void loop() {
// Check if data is available from the Bluetooth module
if (BTSerial.available()) {
char data = BTSerial.read(); // Read data from HC-05
Serial.write(data); // Send data to the Serial Monitor
}
// Check if data is available from the Serial Monitor
if (Serial.available()) {
char data = Serial.read(); // Read data from the Serial Monitor
BTSerial.write(data); // Send data to the HC-05
}
}
Module Not Powering On
Unable to Pair with Device
No Data Transmission
AT Commands Not Working
Q: Can the HC-05 module communicate with smartphones?
Q: How do I reset the HC-05 to factory settings?
AT+ORGL
.Q: Can I use the HC-05 for audio transmission?
Q: What is the difference between master and slave modes?
By following this documentation, you can effectively integrate the HC-05 Bluetooth module into your projects and troubleshoot common issues.