HC-05 Bluetooth Module

Introduction

The HC-05 Bluetooth module is a widely used component in embedded systems and wireless communication projects. It is a low-cost, easy-to-use module that allows devices to communicate wirelessly via Bluetooth. Whether you are working on home automation, robotics, or IoT applications, the HC-05 module offers a reliable solution for seamless connectivity.

This article provides a detailed overview of the HC-05 Bluetooth module, including its features, specifications, working principles, applications, and how to interface it with microcontrollers like Arduino.

Features and Specifications

The HC-05 module comes with several features that make it a popular choice among developers and hobbyists. Below are its key specifications:

  • Bluetooth Version: 2.0 + EDR (Enhanced Data Rate)
  • Operating Voltage: 3.3V (Can tolerate 5V logic levels on RX)
  • Communication: Serial (UART) communication with baud rates ranging from 9600 to 115200 bps
  • Frequency: 2.4GHz ISM band
  • Range: Up to 10 meters in open space
  • Modes: Master and Slave mode selection
  • Security: Authentication and encryption support
  • Current Consumption: ~30mA (active mode), ~1mA (idle mode)

These features make the HC-05 module suitable for various wireless communication applications.

Working Principle of HC-05

The HC-05 module operates using Bluetooth Serial Port Profile (SPP), which enables wireless serial communication between devices. It connects to microcontrollers via UART (TX and RX pins) and facilitates data transmission wirelessly to another Bluetooth-enabled device, such as a smartphone or another microcontroller.

It can operate in two primary modes:

  1. Command Mode: Allows users to configure settings like the device name, baud rate, and mode of operation using AT commands.
  2. Data Mode: The module enters this mode after establishing a successful connection, enabling seamless data exchange between paired devices.

Interfacing HC-05 with Arduino

To use the HC-05 Bluetooth module with an Arduino, follow these steps:

Components Required

  • HC-05 Bluetooth Module
  • Arduino Uno (or any other compatible board)
  • Jumper wires
  • 1KΩ and 2KΩ resistors (for voltage level shifting on RX pin)

Wiring Diagram

HC-05 PinArduino Pin
VCC5V
GNDGND
TXDRX (D2 if using SoftwareSerial)
RXDTX (via voltage divider)
ENNot connected (Optional for AT mode)

Arduino Code Example

Below is a simple Arduino sketch for establishing a basic communication link between the HC-05 and a serial monitor:

#include <SoftwareSerial.h>
SoftwareSerial BTSerial(2, 3); // RX | TX

void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600);
}

void loop() {
  if (BTSerial.available()) {
    Serial.write(BTSerial.read());
  }
  if (Serial.available()) {
    BTSerial.write(Serial.read());
  }
}

This code allows bidirectional communication between the Arduino’s serial monitor and the Bluetooth-connected device.

Applications of HC-05 Bluetooth Module

The HC-05 module is widely used in various fields, including:

  • Home Automation: Wireless control of home appliances using smartphones.
  • Robotics: Remote control of robots via Bluetooth.
  • IoT Applications: Integration with sensors and cloud platforms.
  • Wearable Technology: Data transfer from fitness devices to smartphones.
  • Wireless Data Logging: Collecting and transmitting sensor data wirelessly.
Categories: Uncategorized