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 widely-used wireless communication device that enables Bluetooth connectivity for electronic projects. It operates in both master and slave modes, allowing it to either initiate a connection or accept connections from other Bluetooth devices. This versatility makes it ideal for a range of applications, including robotics, home automation, and Internet of Things (IoT) projects.

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

Technical Specifications

Key Technical Details

Pin Configuration and Descriptions

Pin Number Name Type Description
1 KEY Input Module enters AT command mode when pulled HIGH
2 VCC Power Supply voltage (3.3V to 6V)
3 GND Power Ground
4 TXD Output Transmit Data (connect to RX of host device)
5 RXD Input Receive Data (connect to TX of host device)
6 STATE Output Indicates the connection status

Usage Instructions

Integrating HC-05 with a Circuit

  1. Power Connections: Connect the VCC pin to a 5V supply and the GND pin to the ground.
  2. Data Connections: Connect the TXD pin of the HC-05 to the RX pin of the host microcontroller (e.g., Arduino UNO) and the RXD pin to the TX pin of the microcontroller.
  3. AT Command Mode: To enter AT command mode for configuration, pull the KEY pin HIGH, power on the HC-05, and use a serial monitor to send commands.

Important Considerations and Best Practices

Example Code for Arduino UNO

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup() {
  pinMode(9, OUTPUT);  // KEY pin if needed for AT commands
  digitalWrite(9, HIGH); // Enable AT command mode
  Serial.begin(9600);
  BTSerial.begin(38400);  // HC-05 default speed in AT command mode
  Serial.println("Enter AT commands:");
}

void loop() {
  // Keep reading from HC-05 and send to Arduino Serial Monitor
  if (BTSerial.available())
    Serial.write(BTSerial.read());

  // Keep reading from Arduino Serial Monitor and send to HC-05
  if (Serial.available())
    BTSerial.write(Serial.read());
}

Troubleshooting and FAQs

Common Issues

Solutions and Tips for Troubleshooting

FAQs

Q: How do I change the baud rate of the HC-05? A: Enter AT command mode and use the command AT+UART=<baud rate>,<stop bits>,<parity> to set the desired baud rate.

Q: Can the HC-05 be used to communicate with smartphones? A: Yes, the HC-05 can communicate with smartphones that have Bluetooth capabilities.

Q: What is the default password for pairing the HC-05? A: The default password is usually '1234' or '0000'.