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

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

Image of Modulo Bluetooth HC-05Design with Modulo Bluetooth HC-05 in Cirkit Designer

Introduction

The HC-05 is a Bluetooth module designed and manufactured by Arduino to enable wireless communication between devices. It supports both master and slave modes, making it a versatile solution for a wide range of applications. The module is commonly used to connect microcontrollers, such as Arduino boards, to smartphones, computers, or other Bluetooth-enabled devices. Its ease of use and reliable performance make it a popular choice for wireless communication in IoT projects, robotics, and home automation systems.

Explore Projects Built with Modulo Bluetooth 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 Arduino UNO Bluetooth Communication Interface: A project utilizing Modulo Bluetooth 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.

Open Project in Cirkit Designer
Image of Arduino UNO Bluetooth-Controlled Relay System: A project utilizing Modulo Bluetooth 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.

Open Project in Cirkit Designer

Common Applications and Use Cases

Technical Specifications

The HC-05 Bluetooth module is a compact and efficient device with the following key 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.5mm

Pin Configuration and Descriptions

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

Pin Name Description
VCC Power supply pin (3.3V to 5V). Connect to the 5V pin of the Arduino.
GND Ground pin. Connect to the GND pin of the Arduino.
TXD Transmit data pin. Sends serial data to the connected microcontroller.
RXD Receive data pin. Receives serial data from the connected microcontroller.
EN (Key) Enable pin. Used to switch between command and data modes.
STATE Indicates the connection status (HIGH when connected, LOW when disconnected).

Usage Instructions

How to Use the HC-05 in a Circuit

  1. Wiring the HC-05 to an Arduino UNO:

    • Connect the VCC pin of the HC-05 to the 5V pin of the Arduino.
    • Connect the GND pin of the HC-05 to the GND pin of the Arduino.
    • Connect the TXD pin of the HC-05 to the RX pin of the Arduino (pin 0).
    • Connect the RXD pin of the HC-05 to the TX pin of the Arduino (pin 1).
    • Optionally, connect the EN pin to a digital pin on the Arduino for mode switching.
  2. Configuring the HC-05:

    • By default, the HC-05 operates in slave mode with a baud rate of 9600 bps.
    • To change settings (e.g., baud rate or mode), enter AT command mode by setting the EN pin HIGH.
  3. Example Circuit Diagram:

    Arduino UNO          HC-05
    ------------------------------
    5V                -> VCC
    GND               -> GND
    RX (Pin 0)        -> TXD
    TX (Pin 1)        -> RXD
    

Example Code for Arduino UNO

The following code demonstrates how to send and receive data using the HC-05 module:

#include <SoftwareSerial.h>

// Create a SoftwareSerial object to communicate with the HC-05
SoftwareSerial Bluetooth(10, 11); // RX = Pin 10, TX = Pin 11

void setup() {
  // Initialize serial communication with the computer
  Serial.begin(9600);
  // Initialize serial communication with the HC-05
  Bluetooth.begin(9600);

  Serial.println("HC-05 Bluetooth Module Initialized");
  Serial.println("You can now send and receive data.");
}

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

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

Important Considerations and Best Practices

Troubleshooting and FAQs

Common Issues and Solutions

  1. Issue: The HC-05 is not responding to AT commands.

    • Solution: Ensure the EN pin is HIGH to enter AT command mode. Also, verify the baud rate is set to 38400 bps in AT mode.
  2. Issue: The module is not pairing with a Bluetooth device.

    • Solution: Check if the module is in slave mode. Ensure the pairing device is within range and the correct PIN (default: 1234) is used.
  3. Issue: Data transmission is unreliable or slow.

    • Solution: Verify the baud rate matches between the HC-05 and the microcontroller. Ensure there are no obstructions or interference in the communication range.
  4. Issue: The HC-05 is not powering on.

    • Solution: Confirm the VCC pin is connected to a 3.3V or 5V power source. Check all connections for loose wires.

FAQs