HC-05 Bluetooth


I bought this bluetooth module (HC-05 or BT400_B6) on ebay some weeks ago at very low price.

I decided to test it with an Android telephone.

This module is configured as Slave by default.

Required Components

  • Bluetooth HC-05
  • BlueTerm (this is a free app for android and you can found it in the Google Play market)

Product Specifications

  • Chipset CSR BC417143
  • Bluetooth version V2.0+EDR
  • Output power Class II
  • Flash 8Mbit
  • Power Supply 3.3V
  • Size 26.9mm*13mm*2.2mm

Pin Description



HC05 pinMbed pin
1 - TxP10 - Rx
2 - RxP9 - Tx
12 - 3.3VVout - 3.3V
31 - PIO8--
32 - PIO9--
34 - PIO11GND or 3.3V

PIO8 is used to control LED indicating the status. It will blink after power on.

PIO9 is used to control LED indicating paring. It will be steady on when paring is successful.

PIO11 is used to set this two mode: AT command mode (if the pin is connect to 3.3V) or Automatic binding transparent data mode (if the pin is connect to GND). The AT command mode is used to configure some characteristics of the device (for example the Master, Slave or Loopback modes).

Test Code for Transparent data mode

Import programHC05_Transparent_mode

Transparent data mode for Bluetooth HC05

Output for Transparent data mode

First you must enable Bluetooth on your telephone. Search the bluetooth device and pair with it (the password is 1234). Then open BlueTerm and select the device.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

AT command mode

In AT command mode you can configure and send control command to the HC05 device.

For enter into AT mode you must follow this steps:

  • Power off the mbed
  • Tie PIO11 to 3.3V (you can see it on the schematic below)
  • Power on the mbed
  • Open a serial monitor (Set the baud to 115200; choose "Both CR+LF" in the check box)

Schematic for AT command mode


Basic AT commands

AT+VERSION?+VERSION:<Param> OKParam: Version numberGet the soft version
AT+ORGLOKNoneRestore default status
AT+ADDR?+ADDR: <Param> OKParam: Bluetooth addressGet module Bluetooth address
AT+NAME=<Param>OKParam: Bluetooth device nameSet device’s name
AT+NAME?+NAME:<Param> OKParam: Bluetooth device nameInquire device’s name
AT+ROLE=<Param>OKParam:0=Slave role; 1=Master role; 2=Slave-Loop roleSet module role
AT+ ROLE?+ ROLE:<Param>Param:0=Slave role; 1=Master role; 2=Slave-Loop roleInquire module role
AT+UART=<Param>,<Param2>,<Param3>OKParam1: baud rate( bits/s); Param2: stop bit; Param3: parity bitSet serial parameter
AT+ UART?+UART=<Param>,<Param2>,<Param3> OKParam1: baud rate( bits/s); Param2: stop bit; Param3: parity bitInquire serial parameter

Is possible to set this three modes:

  • Slave: Passive connection;
  • Master: Inquire the near SPP Bluetooth slave device, build connection with it positively, and build up the transparent data transmission between master and slave device;
  • Slave-Loop: Passive connection, receive the remote Bluetooth master device data and send it back to the master device.

Code for AT command mode

Important: The default setting of the serial port of HC05 is: baud 38400; 1stop bit and no parity.

Import programHC05_AT_mode

This program send an AT command to the HC05 module and shows the response into a terminal.

Output for AT command mode


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

C# Test Program

You can download the program here: HC05 Test Software v1.1
Is required Microsoft .NET Framework 3.5 or above.




U1: Updated the HC05 Test Software


2 comments on HC-05 Bluetooth:

21 Sep 2013
21 Jan 2014

Do you have the source available for the C# app? I would love to see how you're communicating with the device. Unfortunately, I can't run an exe directly (security risk).

Thanks a lot!

Please login to post comments.