Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

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

Image of HC-05
Cirkit Designer LogoDesign with HC-05 in Cirkit Designer

Introduction

The HC-05 is a Bluetooth module that allows for wireless communication between devices. It is a versatile and widely used component in embedded systems, enabling seamless connectivity between microcontrollers and Bluetooth-enabled devices such as smartphones, tablets, or computers. The module supports both master and slave modes, making it suitable for a variety of wireless communication applications.

Explore Projects Built with HC-05

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS
Image of sat_dish: compass example: A project utilizing HC-05 in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Bluetooth Communication Interface
Image of Bluetooth: A project utilizing HC-05 in a practical application
This circuit connects an HC-05 Bluetooth module to an Arduino UNO for wireless communication. The HC-05's VCC and GND are connected to the Arduino's 5V and GND, respectively, for power. The TXD pin of the HC-05 is connected to the Arduino's D1 (RX) pin, and the RXD pin of the HC-05 is connected through a voltage divider made of two resistors to the Arduino's D0 (TX) pin, allowing for serial communication between the two devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Bluetooth-Controlled Relay System
Image of home automaton: A project utilizing HC-05 in a practical application
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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and HC-05 Bluetooth Communication Interface
Image of blutooth: A project utilizing HC-05 in a practical application
This circuit connects an HC-05 Bluetooth Module to an Arduino UNO for wireless communication. The HC-05's VCC and GND are connected to the Arduino's 5V and GND for power. The HC-05's TXD and RXD pins are connected to the Arduino's D11 and D10 pins, respectively, allowing for serial communication between the two devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with HC-05

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 sat_dish: compass example: A project utilizing HC-05 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Bluetooth: A project utilizing HC-05 in a practical application
Arduino UNO Bluetooth Communication Interface
This circuit connects an HC-05 Bluetooth module to an Arduino UNO for wireless communication. The HC-05's VCC and GND are connected to the Arduino's 5V and GND, respectively, for power. The TXD pin of the HC-05 is connected to the Arduino's D1 (RX) pin, and the RXD pin of the HC-05 is connected through a voltage divider made of two resistors to the Arduino's D0 (TX) pin, allowing for serial communication between the two devices.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of home automaton: A project utilizing HC-05 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.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of blutooth: A project utilizing HC-05 in a practical application
Arduino UNO and HC-05 Bluetooth Communication Interface
This circuit connects an HC-05 Bluetooth Module to an Arduino UNO for wireless communication. The HC-05's VCC and GND are connected to the Arduino's 5V and GND for power. The HC-05's TXD and RXD pins are connected to the Arduino's D11 and D10 pins, respectively, allowing for serial communication between the two devices.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Wireless data transfer between microcontrollers and smartphones
  • Remote control of devices via Bluetooth
  • Home automation systems
  • Robotics and IoT projects
  • Wireless sensor networks

Technical Specifications

The HC-05 module is designed for ease of use and reliable communication. Below are its key technical specifications:

Parameter Value
Bluetooth Version 2.0 + EDR (Enhanced Data Rate)
Operating Voltage 3.3V to 5V
Operating Current 30mA (typical)
Communication Range Up to 10 meters (unobstructed)
Baud Rate (Default) 9600 bps
Modes Master and Slave
Frequency Band 2.4 GHz ISM band
Dimensions 37.5mm x 15.2mm x 2.7mm

Pin Configuration and Descriptions

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

Pin Name Description
1 EN (Key) Enables AT command mode when pulled HIGH. Leave LOW for normal operation.
2 VCC Power supply pin. Connect to 3.3V or 5V.
3 GND Ground pin. Connect to the ground of the circuit.
4 TXD Transmit pin. Sends serial data to the connected microcontroller or device.
5 RXD Receive pin. Receives serial data from the connected microcontroller or device.
6 STATE Indicates the connection status. HIGH when connected, LOW when disconnected.

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:

Connecting the HC-05 to a Microcontroller

  1. Power Supply: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Serial Communication:
    • Connect the TXD pin of the HC-05 to the RX pin of the microcontroller.
    • Connect the RXD pin of the HC-05 to the TX pin of the microcontroller. Use a voltage divider if the microcontroller operates at 5V logic levels to avoid damaging the RXD pin.
  3. Enable AT Command Mode (Optional):
    • Pull the EN (Key) pin HIGH to enter AT command mode for configuration.
    • Use a serial terminal to send AT commands for setting parameters like baud rate, name, or mode (master/slave).

Example: Connecting HC-05 to Arduino UNO

Below is an example of how to connect and use the HC-05 module with an Arduino UNO:

Circuit Diagram

  • HC-05 VCC → Arduino 5V
  • HC-05 GND → Arduino GND
  • HC-05 TXD → Arduino RX (Pin 0)
  • HC-05 RXD → Arduino TX (Pin 1) (Use a voltage divider if necessary)

Arduino Code Example

#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 with the HC-05
  BTSerial.begin(9600); // Default baud rate of HC-05
  Serial.begin(9600);   // Serial monitor baud rate

  Serial.println("HC-05 Bluetooth Module Test");
}

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

  // Check if data is available from the 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
  }
}

Important Considerations and Best Practices

  • Voltage Levels: The RXD pin of the HC-05 is not 5V tolerant. Use a voltage divider or level shifter if your microcontroller operates at 5V logic levels.
  • AT Command Mode: Use AT commands to configure the module before deployment. For example, you can set the module name, baud rate, and mode (master/slave).
  • Connection Status: Use the STATE pin to monitor the connection status of the module.
  • Avoid Pin Conflicts: If using the Arduino's hardware serial pins (0 and 1), ensure they are not used for other purposes like uploading code.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Module Not Responding to AT Commands:

    • Ensure the EN (Key) pin is pulled HIGH to enter AT command mode.
    • Verify the baud rate of the serial terminal matches the module's default baud rate (9600 bps).
  2. No Data Transmission:

    • Check the wiring of the TXD and RXD pins. Ensure they are correctly connected to the RX and TX pins of the microcontroller.
    • Verify that the devices are paired and within range.
  3. Unstable Connection:

    • Ensure there is no interference in the 2.4 GHz frequency band.
    • Check the power supply for stability and sufficient current.
  4. Module Not Pairing:

    • Confirm that the module is in discoverable mode (flashing LED indicates this).
    • Ensure the correct pairing code (default: "1234" or "0000") is used.

FAQs

Q1: Can the HC-05 module communicate with other Bluetooth versions?
Yes, the HC-05 is backward compatible with Bluetooth 1.1 and 1.2 devices.

Q2: How do I reset the HC-05 module?
To reset the module, disconnect and reconnect the power supply. Alternatively, use the AT command AT+RESET.

Q3: Can I use the HC-05 for audio transmission?
No, the HC-05 is designed for serial data communication and does not support audio transmission.

Q4: What is the difference between HC-05 and HC-06?
The HC-05 supports both master and slave modes, while the HC-06 operates only in slave mode.

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