Ir directamente al contenido

All items ship from our office in Colorado USA - $5.95 Flat-Rate US shipping & free shipping on orders over $75!

HC-05 Bluetooth Wireless RS-232 Master/Slave Transceiver Module User Guide

HC-05 Bluetooth Wireless RS-232 Master/Slave Transceiver Module

📋 Overview

The HC-05 is a Bluetooth 2.0 serial transceiver module that adds wireless communication to your Arduino or microcontroller projects. It works as a wireless serial (UART) bridge — anything you send over the serial connection on one end comes out the Bluetooth connection on the other end, and vice versa. If you've ever used a wired serial connection between two devices, the HC-05 lets you do the same thing wirelessly, at distances up to 10 meters (30 feet).

What makes the HC-05 especially versatile is that it can operate as either a master or a slave device. Slave mode means it waits for another device (like your phone) to connect to it. Master mode means it can actively initiate a connection to another Bluetooth device. This makes it possible to create wireless links between two Arduinos, between an Arduino and a phone, or between an Arduino and a computer — all without writing complex Bluetooth protocol code.

The module has two operating modes: Communication mode (normal data transmission) and AT command mode (for configuration). In communication mode, it acts as a transparent serial pass-through. In AT command mode, you can change settings like the device name, pairing password, baud rate, and master/slave role using simple text commands.

⚠️ Important: The HC-05 module's radio chip operates at 3.3V logic levels. The breakout board includes a voltage regulator that allows you to power it from 3.6V to 6V (typically 5V from an Arduino), but the RX data pin is not 5V tolerant. You must use a voltage divider on the RX pin when connecting to a 5V Arduino. Connecting 5V directly to the RX pin can damage the module.


⭐ Key Features

  • Bluetooth 2.0 + EDR: Based on the CSR BC417 radio chip with data rates up to 3 Mbps
  • Master and Slave Modes: Can initiate connections (master) or accept them (slave) — configurable via AT commands
  • Transparent Serial Bridge: Acts as a wireless UART — no Bluetooth protocol knowledge required
  • AT Command Configuration: Change name, password, baud rate, role, and more using simple serial commands
  • Wide Power Range: 3.6V to 6V input (on-board regulator provides 3.3V to the radio chip)
  • Low Power Consumption: ~30 mA when searching/unpaired, ~10 mA when connected
  • 10-Meter Range: Class 2 Bluetooth with built-in PCB antenna, up to 10 meters (30 feet) line of sight
  • 6-Pin Breakout Board: Anti-reverse header with clearly labeled pins
  • Default Settings: Name: HC-05, Password: 1234, Baud rate: 9600 (communication) / 38400 (AT mode)

📊 Specifications

Parameter Value
Bluetooth Version Bluetooth 2.0 + EDR (Enhanced Data Rate)
Radio Chip CSR BC417
Frequency Band 2.4 GHz ISM band
Output Power -4 to +6 dBm (Class 2)
Sensitivity -80 dBm typical
Data Rate Up to 3 Mbps (EDR), UART up to 1382400 bps
Range Up to 10 meters (30 feet) line of sight
Operating Modes Master, Slave, or Master/Slave (loopback)
Interface UART (serial TTL)
Default Baud Rate (Communication) 9600 bps
Default Baud Rate (AT Command) 38400 bps
Default Name HC-05
Default Pairing Password 1234
Input Voltage (VCC) 3.6V to 6V (on-board 3.3V regulator)
Logic Level (RX/TX) 3.3V (RX is NOT 5V tolerant)
Current (Unpaired/Searching) ~30 mA
Current (Connected) ~10 mA
Antenna Built-in PCB antenna
Memory External 8 Mbit flash
Module Dimensions Approx. 27 × 13 mm (1.06 x 0.51 inches) W × H (radio module only)
Breakout Board Dimensions Approx. 44 × 16 × 4 mm (1.73 x 0.63 x 0.16 inches) L × W × H

📌 Pinout

The HC-05 breakout board has 6 pins in a single row. Some boards label the button/key pin as EN (enable) and others as KEY — they serve the same function.

Pin Name I/O Description
1 EN / KEY Input When held HIGH (3.3V) during power-on, the module enters AT command mode. Leave unconnected or LOW for normal communication mode.
2 VCC Power Power supply input: 3.6V to 6V. Connect to Arduino 5V pin.
3 GND Power Ground. Connect to Arduino GND.
4 TXD Output Serial data output (3.3V level). Connect to Arduino RX pin.
5 RXD Input Serial data input (3.3V level). Use a voltage divider from Arduino TX pin. NOT 5V tolerant.
6 STATE Output Outputs HIGH when connected, LOW when disconnected. Can be used to detect connection status. (Optional — often left unconnected.)

Note: Some HC-05 boards also have a small push button on the radio module itself. Pressing and holding this button while powering on the module is an alternative way to enter AT command mode (same as holding EN/KEY HIGH).


🔌 Wiring to Arduino UNO

The HC-05 communicates via serial (UART). We use Arduino's SoftwareSerial library on pins D2 and D3 so that the hardware serial (pins 0 and 1) remains free for the Serial Monitor and sketch uploads.

Standard Wiring (Communication Mode)

HC-05 Pin Arduino UNO Pin Notes
VCC 5V Powers the module via on-board regulator
GND GND Common ground
TXD D2 (SoftwareSerial RX) HC-05 TX → Arduino RX. 3.3V output is safe for Arduino input.
RXD D3 (SoftwareSerial TX) via voltage divider Arduino TX → HC-05 RX. Must use voltage divider (see below).
EN / KEY Not connected Leave unconnected for normal communication mode
STATE Not connected Optional — connect to a digital pin if you want to detect connection status

Voltage Divider for the RX Pin

The HC-05's RX pin expects 3.3V logic. The Arduino UNO's digital pins output 5V. You need a simple voltage divider to step the 5V down to approximately 3.3V:

  • Connect a 1 kΩ resistor from Arduino D3 (TX) to the HC-05 RXD pin
  • Connect a 2 kΩ resistor (or two 1 kΩ resistors in series) from the HC-05 RXD pin to GND

This creates a voltage divider that outputs approximately 3.3V from the 5V Arduino signal: 5V × (2kΩ / (1kΩ + 2kΩ)) = 3.33V.

Tip: If you don't have a 2 kΩ resistor, you can use a 2.2 kΩ resistor instead (giving ~3.4V, which is fine). Or use two 1 kΩ resistors in series. The exact values aren't critical — you just need to get the voltage below 3.6V.

AT Command Mode Wiring

To enter AT command mode for configuration, add one connection:

  • Connect the EN / KEY pin to Arduino 3.3V (or any 3.3V source)
  • Power on the module with EN/KEY held HIGH
  • The LED on the module will blink slowly (about once every 2 seconds) instead of the rapid blinking seen in communication mode

Alternatively, hold the small push button on the module while powering it on.

Connecting the HC-05 Module to an Arduino Uno Microcontroller
Connecting the HC-05 Module to an Arduino Uno Microcontroller
Connecting the HC-05 Module to an Arduino Nano Microcontroller
Connecting the HC-05 Module to an Arduino Nano Microcontroller

🔧 AT Command Mode

AT command mode lets you configure the HC-05's settings using simple text commands sent over the serial connection. You must enter AT command mode before sending commands.

How to Enter AT Command Mode

  1. Disconnect power from the HC-05 module
  2. Hold the EN/KEY pin HIGH (connect to 3.3V) or hold the push button on the module
  3. Apply power to the module while keeping EN/KEY HIGH or the button pressed
  4. The LED will blink slowly (~2 seconds on, ~2 seconds off) — this confirms AT command mode
  5. Open the Serial Monitor at 38400 baud with line ending set to "Both NL & CR"
  6. Type AT and press Enter — the module should respond with OK

Important: AT commands must be sent with \r\n (carriage return + newline) line endings. In the Arduino Serial Monitor, set the line ending dropdown to "Both NL & CR". Commands can be uppercase or lowercase.

Essential AT Commands

Command Function Example / Response
AT Test connection Response: OK
AT+VERSION? Get firmware version Response: +VERSION:x.x
AT+NAME? Get current device name Response: +NAME:HC-05
AT+NAME=MyDevice Set device name Response: OK
AT+PSWD? Get current pairing password Response: +PSWD:1234
AT+PSWD=5678 Set pairing password Response: OK
AT+UART? Get current UART settings Response: +UART:9600,0,0 (baud, stop bits, parity)
AT+UART=115200,0,0 Set baud rate to 115200 Response: OK
AT+ROLE? Get current role Response: +ROLE:0 (0=Slave, 1=Master)
AT+ROLE=0 Set as slave Response: OK
AT+ROLE=1 Set as master Response: OK
AT+ADDR? Get module's Bluetooth address Response: +ADDR:xxxx:xx:xxxxxx
AT+ORGL Restore factory defaults Response: OK
AT+RESET Reset the module Response: OK (module restarts)

Tip: After changing settings with AT commands, use AT+RESET to restart the module so the new settings take effect. The module will return to communication mode after reset (unless EN/KEY is still held HIGH).

Common Baud Rate Values

The AT+UART command accepts these standard baud rates: 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600, 1382400. The default communication baud rate is 9600.


📡 Understanding Master and Slave Modes

The HC-05 can operate in two roles:

  • Slave (Role 0): The module waits for another device to connect to it. This is the default mode. Use this when pairing with a phone, tablet, or computer.
  • Master (Role 1): The module actively searches for and connects to a specific slave device. Use this when you want two HC-05 modules to automatically connect to each other.

Pairing with a Phone (Slave Mode)

  1. Leave the HC-05 in its default slave mode (AT+ROLE=0)
  2. Power on the module — the LED will blink rapidly (searching/discoverable)
  3. On your phone, go to Settings > Bluetooth and scan for devices
  4. Select "HC-05" from the list of available devices
  5. Enter the pairing password: 1234 (default)
  6. Once paired, the LED will blink twice quickly, then pause — this indicates a successful connection
  7. Use a Bluetooth serial terminal app (such as "Serial Bluetooth Terminal" on Android) to send and receive data

Linking Two HC-05 Modules (Master + Slave)

  1. Configure one module as slave (AT+ROLE=0) — note its address using AT+ADDR?
  2. Configure the other module as master (AT+ROLE=1)
  3. On the master, set the connection mode to fixed address: AT+CMODE=0
  4. On the master, bind to the slave's address: AT+BIND=xxxx,xx,xxxxxx (replace colons with commas)
  5. Reset both modules and power them on — they will automatically connect to each other
  6. Once connected, data sent to one module's serial input will appear on the other module's serial output

🚀 Step 1: Basic Serial Communication

This sketch creates a serial bridge between the Arduino's Serial Monitor and the HC-05 module. Anything you type in the Serial Monitor is sent to the HC-05 (and out via Bluetooth), and anything received via Bluetooth is displayed in the Serial Monitor. This is the foundation for all HC-05 projects.

/*
 * HC-05 Basic Serial Bridge
 * Envistia Mall - Product Support
 *
 * Creates a serial bridge between the Serial Monitor
 * and the HC-05 Bluetooth module. Type in the Serial
 * Monitor to send data via Bluetooth, and received
 * Bluetooth data appears in the Serial Monitor.
 *
 * Connections:
 *   HC-05 VCC   -> Arduino 5V
 *   HC-05 GND   -> Arduino GND
 *   HC-05 TXD   -> Arduino D2 (SoftwareSerial RX)
 *   HC-05 RXD   -> Arduino D3 (SoftwareSerial TX) via voltage divider
 *   HC-05 EN    -> Not connected (communication mode)
 */

#include <SoftwareSerial.h>

// HC-05 TX connects to Arduino D2 (RX)
// HC-05 RX connects to Arduino D3 (TX) via voltage divider
SoftwareSerial BTSerial(2, 3); // RX, TX

void setup() {
  Serial.begin(9600);       // Serial Monitor
  BTSerial.begin(9600);     // HC-05 default baud rate
  Serial.println("HC-05 Bluetooth Serial Bridge Ready");
  Serial.println("Type a message and press Enter to send via Bluetooth.");
}

void loop() {
  // If data is received from Bluetooth, send it to Serial Monitor
  if (BTSerial.available()) {
    Serial.write(BTSerial.read());
  }

  // If data is typed in Serial Monitor, send it to Bluetooth
  if (Serial.available()) {
    BTSerial.write(Serial.read());
  }
}

How to Use:

  1. Wire the HC-05 to the Arduino as shown in the Wiring section (don't forget the voltage divider on RX!)
  2. Upload the sketch to your Arduino
  3. Open the Serial Monitor at 9600 baud
  4. Pair your phone with the HC-05 (see "Pairing with a Phone" above)
  5. Open a Bluetooth serial terminal app on your phone (e.g., "Serial Bluetooth Terminal" for Android)
  6. Connect to "HC-05" in the app
  7. Type a message on your phone — it should appear in the Arduino Serial Monitor
  8. Type a message in the Serial Monitor — it should appear on your phone

🚀 Step 2: AT Command Configuration Sketch

This sketch lets you send AT commands to the HC-05 from the Arduino Serial Monitor. Use it to change the module's name, password, baud rate, or master/slave role. You must enter AT command mode first (see the AT Command Mode section above).

/*
 * HC-05 AT Command Mode
 * Envistia Mall - Product Support
 *
 * Sends AT commands to the HC-05 for configuration.
 * The HC-05 must be in AT command mode (EN/KEY held
 * HIGH during power-on, or button held during power-on).
 *
 * AT command mode uses 38400 baud by default.
 *
 * Connections:
 *   HC-05 VCC   -> Arduino 5V
 *   HC-05 GND   -> Arduino GND
 *   HC-05 TXD   -> Arduino D2 (SoftwareSerial RX)
 *   HC-05 RXD   -> Arduino D3 (SoftwareSerial TX) via voltage divider
 *   HC-05 EN    -> Arduino 3.3V (to enter AT mode)
 */

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); // RX, TX

void setup() {
  Serial.begin(9600);        // Serial Monitor
  BTSerial.begin(38400);     // HC-05 AT command mode baud rate
  Serial.println("HC-05 AT Command Mode");
  Serial.println("Set Serial Monitor to 'Both NL & CR'");
  Serial.println("Type AT and press Enter to test.");
}

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

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

How to Use:

  1. Wire the HC-05 as shown above, with EN/KEY connected to 3.3V
  2. Power off the Arduino, then power it back on (the HC-05 must start with EN/KEY HIGH)
  3. Confirm the LED is blinking slowly (~2 seconds on/off) — this means AT command mode is active
  4. Open the Serial Monitor at 9600 baud
  5. Set the line ending dropdown to "Both NL & CR"

  6. Type AT and press Enter — you should see OK
  7. Try other commands: AT+NAME?, AT+PSWD?, AT+UART?, AT+ROLE?
  8. When finished, disconnect EN/KEY from 3.3V and reset the module to return to communication mode

🚀 Step 3: Bluetooth-Controlled LED

This sketch demonstrates a practical application: controlling an LED from your phone via Bluetooth. Send "1" to turn the LED on and "0" to turn it off. This same pattern can be extended to control relays, motors, servos, or any other output.

/*
 * Bluetooth-Controlled LED
 * Envistia Mall - Product Support
 *
 * Controls the Arduino's built-in LED via Bluetooth.
 * Send '1' from your phone to turn the LED ON.
 * Send '0' from your phone to turn the LED OFF.
 *
 * Connections:
 *   HC-05 VCC   -> Arduino 5V
 *   HC-05 GND   -> Arduino GND
 *   HC-05 TXD   -> Arduino D2 (SoftwareSerial RX)
 *   HC-05 RXD   -> Arduino D3 (SoftwareSerial TX) via voltage divider
 */

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); // RX, TX
const int ledPin = 13;         // Built-in LED

void setup() {
  Serial.begin(9600);
  BTSerial.begin(9600);
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, LOW);
  Serial.println("Bluetooth LED Control Ready");
  Serial.println("Send '1' to turn ON, '0' to turn OFF");
}

void loop() {
  if (BTSerial.available()) {
    char received = BTSerial.read();

    if (received == '1') {
      digitalWrite(ledPin, HIGH);
      BTSerial.println("LED is ON");
      Serial.println("LED is ON");
    }
    else if (received == '0') {
      digitalWrite(ledPin, LOW);
      BTSerial.println("LED is OFF");
      Serial.println("LED is OFF");
    }
  }
}

How to Use:

  1. Upload the sketch to your Arduino
  2. Pair your phone with the HC-05 and open a Bluetooth serial terminal app
  3. Connect to "HC-05" in the app
  4. Send 1 — the Arduino's built-in LED turns on and the app shows "LED is ON"
  5. Send 0 — the LED turns off and the app shows "LED is OFF"

🛠️ Troubleshooting

Symptom Possible Cause Solution
LED on module doesn't light up No power or wrong polarity Check VCC (3.6–6V) and GND connections. Verify the Arduino is powered.
Module not discoverable by phone Module is in AT command mode Disconnect EN/KEY pin and power cycle the module. LED should blink rapidly.
Module not discoverable by phone Module is set to master mode Enter AT command mode and send AT+ROLE=0 to set it back to slave.
Pairing fails Wrong password Default password is 1234. Check with AT+PSWD? in AT command mode.
AT commands return no response Wrong baud rate AT command mode uses 38400 baud by default. Make sure SoftwareSerial is set to 38400.
AT commands return no response Wrong line ending Set Serial Monitor line ending to "Both NL & CR".
AT commands return no response Not in AT command mode EN/KEY must be HIGH before power is applied. Power cycle with EN/KEY connected to 3.3V.
Garbled data received Baud rate mismatch Ensure both the Arduino sketch and the HC-05 are set to the same baud rate (default: 9600).
Data only goes one direction TX/RX wires swapped HC-05 TXD goes to Arduino RX (D2). HC-05 RXD goes to Arduino TX (D3) via voltage divider.
Module worked once, now won't respond RX pin damaged by 5V If you connected Arduino TX directly to HC-05 RX without a voltage divider, the module may be damaged. Always use a voltage divider.
Phone connects but no data Wrong app or serial settings Use a Bluetooth SPP (Serial Port Profile) terminal app, not a BLE app. The HC-05 is Bluetooth 2.0 Classic, not BLE.
Module resets or behaves erratically Insufficient power The HC-05 draws ~30 mA. Ensure your power supply can handle it. Avoid powering from a weak source.

LED Blink Patterns

LED Pattern Meaning
Rapid blinking (~5 Hz) Communication mode — not connected (searching/discoverable)
Two quick blinks, then pause Communication mode — connected to a device
Slow blinking (~0.5 Hz, 2 sec on/off) AT command mode — ready for configuration

💡 Tips & Best Practices

  • Always Use a Voltage Divider on RX: This is the #1 cause of HC-05 failures. The RX pin is 3.3V only. A simple 1 kΩ + 2 kΩ voltage divider protects the module from 5V Arduino signals.
  • HC-05 TXD to Arduino is Safe: The HC-05's TXD pin outputs 3.3V, which is high enough for the Arduino to read as a logic HIGH. No level shifting is needed on this connection.
  • Use SoftwareSerial: Don't connect the HC-05 to Arduino pins 0 and 1 (hardware serial). These are used for sketch uploads and the Serial Monitor. Use SoftwareSerial on other pins instead.
  • Bluetooth Classic, Not BLE: The HC-05 uses Bluetooth 2.0 Classic (SPP profile). It is not compatible with Bluetooth Low Energy (BLE) apps or devices. On your phone, use a Bluetooth SPP serial terminal app.
  • iOS Compatibility: Apple iOS does not support Bluetooth SPP (Serial Port Profile) for third-party apps. The HC-05 works with Android phones, Windows PCs, and Linux computers, but not with iPhones or iPads. For iOS projects, you need a BLE module like the HM-10 or an ESP32.
  • Change the Default Password: The default password "1234" is well-known. For any project that will be used outside your workbench, change it using AT+PSWD=xxxx.
  • Change the Default Name: If you have multiple HC-05 modules, give each one a unique name using AT+NAME=MyDevice so you can tell them apart when pairing.
  • SoftwareSerial Limitations: SoftwareSerial on the Arduino UNO works reliably up to about 57600 baud. For higher baud rates, consider using an Arduino Mega (which has multiple hardware serial ports) or a board with additional hardware UARTs.
  • Power Supply: The HC-05 draws about 30 mA when searching and 10 mA when connected. This is well within the Arduino's 5V pin capacity, but if you're powering multiple modules or sensors, keep total current draw in mind.
  • Range: The rated range is 10 meters (30 feet) line of sight. Walls, metal objects, and other 2.4 GHz devices (WiFi routers, microwaves) can reduce the effective range.

🎯 Typical Applications

  • Wireless serial communication between Arduino and Android phone
  • Bluetooth remote control for robots, cars, and drones
  • Wireless data logging from sensors to a phone or computer
  • Bluetooth-controlled home automation (lights, relays, locks)
  • Wireless link between two Arduinos (master + slave pair)
  • Replacing wired RS-232 serial connections with wireless
  • Remote monitoring and debugging of Arduino projects
  • Bluetooth-enabled weather stations and environmental monitors

⚠️ Important Notes

  • RX Pin is NOT 5V Tolerant: Always use a voltage divider when connecting the HC-05 RX pin to a 5V Arduino. Connecting 5V directly will damage the module.
  • Not Compatible with iOS: The HC-05 uses Bluetooth Classic (SPP), which is not supported by iPhones or iPads for third-party apps. Use an HM-10 (BLE) or ESP32 for iOS projects.
  • Not Bluetooth Low Energy (BLE): The HC-05 is Bluetooth 2.0 Classic. It cannot communicate with BLE-only devices. If you need BLE, use an HM-10 or ESP32 module.
  • AT Command Mode Baud Rate: AT command mode always uses 38400 baud by default, regardless of the communication mode baud rate setting.
  • Power Cycle Required: To enter AT command mode, EN/KEY must be HIGH before power is applied. You cannot switch to AT mode while the module is already running — you must power cycle it.
  • Factory Reset: If you've changed settings and can't communicate with the module, enter AT command mode and send AT+ORGL to restore factory defaults (name: HC-05, password: 1234, baud: 9600, role: slave).
  • 2.4 GHz Interference: The HC-05 operates in the 2.4 GHz ISM band, shared with WiFi, microwaves, and other Bluetooth devices. In congested RF environments, you may experience reduced range or occasional data errors.

🏪 Where to Buy the HC-05

The HC-05 Bluetooth Transceiver Module is available from Envistia Mall:

Buy the HC-05 Bluetooth Transceiver Module →

  • 📦 Fast Free US Shipping
  • 🔄 Hassle-Free Returns
  • 📧 Responsive Customer Support

📚 Additional Resources


This guide is provided by Envistia Mall for educational and technical reference purposes. The manufacturer and Envistia LLC (dba Envistia Mall) are not responsible for any damages or losses resulting from the use of this product. Always follow proper electrical safety practices when working with electronic components. Specifications are based on manufacturer data and are subject to change without notice.

Share this guide:
in

🛒 Related Products

Find the components mentioned in this guide in our store.

Browse Products →