Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use HC-05 Bluetooth Module: Examples, Pinouts, and Specs

Image of HC-05 Bluetooth ModuleDesign with HC-05 Bluetooth Module in Cirkit Designer

Introduction

The HC-05 Bluetooth Module is a wireless communication module designed for short-range data transmission using Bluetooth technology. It is widely used in embedded systems, IoT projects, and other applications requiring wireless communication between devices. The module supports both master and slave modes, making it versatile for various use cases.

Explore Projects Built with HC-05 Bluetooth Module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino UNO Bluetooth-Controlled Relay System: A project utilizing HC-05 Bluetooth Module in a practical application
Arduino UNO Bluetooth-Controlled Relay System

This circuit features an Arduino UNO microcontroller interfaced with an HC-05 Bluetooth module for wireless communication. It also includes two 5V two-channel relay modules, which are connected to the Arduino for controlling external devices. The setup allows for remote control of devices via Bluetooth.

Open Project in Cirkit Designer
Image of Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS: A project utilizing HC-05 Bluetooth Module in a practical application
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS

This circuit features a Raspberry Pi Pico microcontroller interfaced with an HC-05 Bluetooth module for wireless communication, an HMC5883L compass module for magnetic field measurement, and a GPS NEO 6M module for location tracking. The Pico is configured to communicate with the HC-05 via serial connection (TX/RX), with the compass module via I2C (SCL/SDA), and with the GPS module via serial (TX/RX). Common power (VCC) and ground (GND) lines are shared among all modules, indicating a unified power system.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The HC-05 module is a compact and reliable solution for Bluetooth communication. Below are its key technical details:

Key Technical Details

Pin Configuration and Descriptions

The HC-05 module has 6 pins, as described in the table below:

Pin Name Description
VCC Power supply pin (3.3V to 5V).
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 Status pin. Indicates the connection status (HIGH when connected, LOW otherwise).

Usage Instructions

The HC-05 module is straightforward to use in a circuit. Below are the steps and best practices for integrating it into your project.

How to Use the HC-05 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Connect TXD and RXD:
    • Connect the TXD pin of the HC-05 to the RX pin of your microcontroller.
    • Connect the RXD pin of the HC-05 to the TX pin of your microcontroller. Use a voltage divider if your microcontroller operates at 5V logic levels to avoid damaging the module.
  3. Enable the Module: Leave the EN pin unconnected for normal operation. Pull it HIGH to enter command mode.
  4. Pair the Module: Search for the HC-05 on your Bluetooth-enabled device, pair using the default PIN code (1234), and establish a connection.
  5. Send and Receive Data: Use UART communication to send and receive data between the HC-05 and the connected device.

Important Considerations and Best Practices

Example: Connecting HC-05 to Arduino UNO

Below is an example of how to use the HC-05 module with an Arduino UNO to send and receive data.

Circuit Connections

Arduino Code

// Example code to send and receive data using HC-05 Bluetooth Module
#include <SoftwareSerial.h>

// Define RX and TX pins for SoftwareSerial
SoftwareSerial BTSerial(10, 11); // RX = Pin 10, TX = Pin 11

void setup() {
  // Initialize serial communication
  Serial.begin(9600); // For communication with the PC
  BTSerial.begin(9600); // For communication with HC-05

  Serial.println("HC-05 Bluetooth Module Test");
  Serial.println("Send data via Bluetooth to see it here.");
}

void loop() {
  // Check if data is available from HC-05
  if (BTSerial.available()) {
    char data = BTSerial.read(); // Read data from HC-05
    Serial.print("Received: ");
    Serial.println(data); // Print received data to Serial Monitor
  }

  // Check if data is available from Serial Monitor
  if (Serial.available()) {
    char data = Serial.read(); // Read data from Serial Monitor
    BTSerial.write(data); // Send data to HC-05
    Serial.print("Sent: ");
    Serial.println(data); // Print sent data to Serial Monitor
  }
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Module Not Powering On:

    • Ensure the VCC pin is connected to a 3.3V or 5V power source.
    • Check for loose connections or damaged wires.
  2. Unable to Pair with Device:

    • Verify that the module is powered on and in range.
    • Ensure the default PIN code (1234) is entered correctly.
    • Check if the module is already paired with another device.
  3. No Data Transmission:

    • Confirm that the TXD and RXD pins are correctly connected.
    • Ensure the baud rate of the HC-05 matches the microcontroller's baud rate.
    • Use a voltage divider on the RXD pin if the microcontroller operates at 5V logic levels.
  4. AT Commands Not Working:

    • Ensure the EN pin is pulled HIGH to enter command mode.
    • Use a baud rate of 38400 bps for AT commands (default for HC-05 in command mode).

FAQs

By following this documentation, you can effectively integrate the HC-05 Bluetooth Module into your projects and troubleshoot common issues.