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

How to Use hc06: Examples, Pinouts, and Specs

Image of hc06
Cirkit Designer LogoDesign with hc06 in Cirkit Designer

Introduction

The HC-06 is a Bluetooth module designed for wireless communication, commonly used in embedded systems and IoT projects. It operates as a slave device, allowing microcontrollers to connect and communicate with smartphones or other Bluetooth-enabled devices. The module is simple to use, cost-effective, and widely supported, making it a popular choice for hobbyists and professionals alike.

Explore Projects Built with hc06

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO Bluetooth-Controlled Obstacle-Avoiding Robot with Servo and Ultrasonic Sensor
Image of 자동차: A project utilizing hc06 in a practical application
This circuit is a Bluetooth-controlled robotic vehicle with obstacle avoidance capabilities. It uses an Arduino UNO to control two DC motors via an L9110 motor driver, a servo motor for directional control, and an ultrasonic sensor for distance measurement. The HC-06 Bluetooth module allows for remote control, while the power is supplied by a combination of a 9V battery and a 4xAA battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Health Monitoring System with Bluetooth Connectivity
Image of Vital Monitoring System: A project utilizing hc06 in a practical application
This circuit is designed to monitor environmental and physiological parameters, display data, and provide wireless connectivity. It includes sensors for temperature and blood oxygen levels, visual output via an LCD, and indication through LEDs and a buzzer, all controlled by an Arduino UNO. The HC-06 Bluetooth module allows for remote data communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
Image of women safety: A project utilizing hc06 in a practical application
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Raspberry Pi Pico-Based Navigation Assistant with Bluetooth and GPS
Image of sat_dish: compass example: A project utilizing hc06 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

Explore Projects Built with hc06

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 자동차: A project utilizing hc06 in a practical application
Arduino UNO Bluetooth-Controlled Obstacle-Avoiding Robot with Servo and Ultrasonic Sensor
This circuit is a Bluetooth-controlled robotic vehicle with obstacle avoidance capabilities. It uses an Arduino UNO to control two DC motors via an L9110 motor driver, a servo motor for directional control, and an ultrasonic sensor for distance measurement. The HC-06 Bluetooth module allows for remote control, while the power is supplied by a combination of a 9V battery and a 4xAA battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Vital Monitoring System: A project utilizing hc06 in a practical application
Arduino UNO Health Monitoring System with Bluetooth Connectivity
This circuit is designed to monitor environmental and physiological parameters, display data, and provide wireless connectivity. It includes sensors for temperature and blood oxygen levels, visual output via an LCD, and indication through LEDs and a buzzer, all controlled by an Arduino UNO. The HC-06 Bluetooth module allows for remote data communication.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of women safety: A project utilizing hc06 in a practical application
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of sat_dish: compass example: A project utilizing hc06 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

Common Applications and Use Cases

  • Wireless data transmission between microcontrollers and smartphones
  • Home automation systems
  • Remote control of devices
  • IoT (Internet of Things) projects
  • Robotics and wireless sensor networks

Technical Specifications

The HC-06 Bluetooth module has the following key technical specifications:

Parameter Value
Bluetooth Version Bluetooth 2.0 + EDR (Enhanced Data Rate)
Operating Voltage 3.3V to 5V
Current Consumption 30mA (typical)
Communication Range Up to 10 meters (unobstructed)
Baud Rate (Default) 9600 bps
Communication Protocol UART (Universal Asynchronous Receiver-Transmitter)
Operating Temperature -20°C to +75°C
Dimensions 27mm x 13mm x 2mm

Pin Configuration and Descriptions

The HC-06 module has 4 pins, as described in the table below:

Pin Name Description
1 VCC Power supply input (3.3V to 5V). Connect to the 5V pin of the microcontroller.
2 GND Ground. Connect to the ground of the microcontroller.
3 TXD Transmit data. Sends serial data to the microcontroller.
4 RXD Receive data. Receives serial data from the microcontroller.

Usage Instructions

How to Use the HC-06 in a Circuit

  1. Power the Module: Connect the VCC pin to a 5V power source and the GND pin to ground.
  2. Connect to a Microcontroller:
    • Connect the TXD pin of the HC-06 to the RX pin of the microcontroller.
    • Connect the RXD pin of the HC-06 to the TX pin of the microcontroller. Use a voltage divider if the microcontroller operates at 5V logic levels to avoid damaging the HC-06 (which uses 3.3V logic).
  3. Pair the Module:
    • Power on the HC-06. The onboard LED will blink rapidly, indicating it is in pairing mode.
    • Search for Bluetooth devices on your smartphone or computer. The HC-06 will appear as "HC-06."
    • Pair with the module using the default PIN code, which is usually 1234 or 0000.
  4. Send and Receive Data:
    • Use a serial communication program (e.g., Arduino Serial Monitor) to send and receive data wirelessly.

Important Considerations and Best Practices

  • Voltage Levels: Ensure the RXD pin does not receive more than 3.3V. Use a voltage divider or level shifter if necessary.
  • Baud Rate: The default baud rate is 9600 bps. Ensure your microcontroller's UART settings match this value.
  • Range: The module works best within 10 meters in an unobstructed environment. Walls and other obstacles may reduce the range.
  • Avoid Interference: Keep the module away from sources of electromagnetic interference (e.g., motors, high-frequency circuits).

Example Code for Arduino UNO

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

#include <SoftwareSerial.h>

// Create a SoftwareSerial object to communicate with the HC-06
SoftwareSerial BTSerial(10, 11); // RX, TX pins for HC-06

void setup() {
  Serial.begin(9600); // Start the hardware serial communication
  BTSerial.begin(9600); // Start the software serial communication with HC-06

  Serial.println("HC-06 Bluetooth Module Test");
  Serial.println("Send data from your Bluetooth device to see it here.");
}

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

  // Check if data is available from the Serial Monitor
  if (Serial.available()) {
    char c = Serial.read(); // Read a character from Serial Monitor
    BTSerial.write(c); // Send the character to HC-06
  }
}

Notes on the Code

  • Connect the HC-06's TXD pin to Arduino pin 10 and RXD pin to Arduino pin 11.
  • Open the Serial Monitor and set the baud rate to 9600 to test communication.
  • Use a Bluetooth terminal app on your smartphone to send and receive data.

Troubleshooting and FAQs

Common Issues and Solutions

  1. The HC-06 is not visible during pairing:

    • Ensure the module is powered on and the LED is blinking rapidly.
    • Check the wiring, especially the VCC and GND connections.
    • Verify that the Bluetooth device you are using supports Bluetooth 2.0.
  2. Data is not being transmitted or received:

    • Ensure the baud rate of the microcontroller matches the HC-06's default baud rate (9600 bps).
    • Check the TX and RX connections. Ensure they are not swapped.
    • If using a 5V microcontroller, ensure the RXD pin of the HC-06 is protected with a voltage divider.
  3. The module disconnects frequently:

    • Ensure the module is within the specified range (10 meters).
    • Minimize interference from other wireless devices or physical obstructions.
  4. The default PIN code does not work:

    • Try common default PINs such as 1234 or 0000.
    • If the PIN has been changed, reset the module to factory settings (refer to the manufacturer's documentation).

FAQs

Q: Can the HC-06 act as a master device?
A: No, the HC-06 is designed to operate only as a slave device. For master functionality, consider using the HC-05 module.

Q: Can I change the baud rate of the HC-06?
A: Yes, the baud rate can be changed using AT commands. Refer to the manufacturer's documentation for details.

Q: Is the HC-06 compatible with Arduino?
A: Yes, the HC-06 is fully compatible with Arduino and other microcontrollers that support UART communication.

Q: How do I reset the HC-06 to factory settings?
A: Use AT commands to reset the module. For example, send the AT+ORGL command via a serial terminal.

By following this documentation, you should be able to successfully integrate and use the HC-06 Bluetooth module in your projects.