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 operates using the Bluetooth 2.0 protocol and is designed for serial communication. The module is widely used in embedded systems and IoT applications to enable data transfer over short distances. Its ease of use and compatibility with microcontrollers like Arduino make it a popular choice for hobbyists and professionals alike.

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 communication between microcontrollers and smartphones
  • Remote control of devices (e.g., robots, home automation systems)
  • Data logging and monitoring applications
  • Wireless sensor networks
  • Serial cable replacement

Technical Specifications

The HC-05 module is a versatile and reliable Bluetooth device. Below are its key technical details:

Key Technical Details

  • Bluetooth Protocol: Bluetooth 2.0 + EDR (Enhanced Data Rate)
  • Operating Voltage: 3.3V to 5V
  • Operating Current: 30mA (typical)
  • Communication: UART (Universal Asynchronous Receiver-Transmitter)
  • Baud Rate: Default 9600 bps (configurable from 1200 to 1382400 bps)
  • Range: Up to 10 meters (line of sight)
  • Modes: Master and Slave
  • Dimensions: 37.5mm x 15.2mm x 3.5mm
  • Default PIN Code: 1234

Pin Configuration and Descriptions

The HC-05 module typically has 6 pins. Below is the pinout and description:

Pin Name Description
1 EN/KEY Enables AT command mode when HIGH. Used for configuration.
2 VCC Power supply input (3.3V to 5V).
3 GND Ground connection.
4 TXD Transmit data pin. Sends serial data to the connected device.
5 RXD Receive data pin. Receives serial data from the connected device.
6 STATE Indicates the connection status (HIGH when connected, LOW when disconnected).

Usage Instructions

How to Use the HC-05 in a Circuit

  1. Powering the Module: Connect the VCC pin to a 5V power source and the GND pin to ground.
  2. Serial Communication:
    • 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 the microcontroller operates at 5V logic levels to avoid damaging the HC-05.
  3. AT Command Mode:
    • To configure the module, set the EN/KEY pin HIGH and power cycle the module. The module will enter AT command mode, allowing you to change settings like the baud rate, name, and PIN code.
  4. Pairing:
    • Search for the HC-05 on your Bluetooth-enabled device. Use the default PIN code 1234 to pair.

Important Considerations and Best Practices

  • Voltage Levels: The RXD pin is not 5V tolerant. Use a voltage divider or level shifter if your microcontroller operates at 5V logic.
  • Antenna Placement: Ensure the module's antenna is not obstructed by metal objects to maintain a strong signal.
  • Baud Rate: Match the baud rate of the HC-05 with your microcontroller for proper communication.
  • Connection Status: Use the STATE pin to monitor the connection status in your application.

Example: Connecting HC-05 to Arduino UNO

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

#include <SoftwareSerial.h>

// Create a SoftwareSerial object for communication with HC-05
SoftwareSerial BTSerial(10, 11); // RX, TX

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

  Serial.println("HC-05 Bluetooth Module Test");
  Serial.println("Type something in the Serial Monitor to send to HC-05");
}

void loop() {
  // Check if data is available from the PC
  if (Serial.available()) {
    char data = Serial.read(); // Read data from the PC
    BTSerial.write(data); // Send data to HC-05
  }

  // Check if data is available from HC-05
  if (BTSerial.available()) {
    char data = BTSerial.read(); // Read data from HC-05
    Serial.write(data); // Send data to the PC
  }
}

Notes:

  • Connect the HC-05's TXD pin to Arduino pin 10 (RX of SoftwareSerial).
  • Connect the HC-05's RXD pin to Arduino pin 11 (TX of SoftwareSerial) using a voltage divider.

Troubleshooting and FAQs

Common Issues and Solutions

  1. HC-05 Not Pairing with Device:

    • Ensure the module is powered and the LED is blinking.
    • Verify the default PIN code (1234) is entered correctly.
    • Check if the device supports Bluetooth 2.0.
  2. No Data Transmission:

    • Confirm the baud rate of the HC-05 matches the microcontroller's settings.
    • Verify the TXD and RXD connections are correct.
    • Use a voltage divider for the RXD pin if the microcontroller operates at 5V logic.
  3. AT Commands Not Working:

    • Ensure the EN/KEY pin is HIGH before powering the module.
    • Use a serial terminal with the correct baud rate (default: 38400 bps in AT mode).
  4. Weak Signal or Connection Drops:

    • Avoid placing the module near metal objects or other sources of interference.
    • Ensure the module is within the 10-meter range.

FAQs

  • Can the HC-05 work with 5V logic?

    • The TXD pin can output 5V logic, but the RXD pin is not 5V tolerant. Use a voltage divider for safe operation.
  • How do I reset the HC-05 to factory settings?

    • Enter AT command mode and send the AT+ORGL command to reset the module.
  • Can the HC-05 act as both Master and Slave?

    • Yes, the HC-05 can be configured as either Master or Slave using AT commands.
  • What is the difference between HC-05 and HC-06?

    • The HC-05 supports both Master and Slave modes, while the HC-06 only supports Slave mode.

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