The HC-06 is the slave only version of the HC-05. It can also be configured using AT commands.

Config settings

The config settings are non-volatile (they are remembered when power is lost).

Sending config commands to the HC-06 using a PC using a USB to serial cable

You might want to do this so you can configure the HC-06 without using an Arduino, or even if you want to connect your computer to a remote HC-05 without using the computer’s Bluetooth adapter for some reason.

Parts

HC-06 Bluetooth Serial Transceiver

FTDI Serial TTL-232 USB Type C Cable – 5V Power / 3.3V Logic or TTL-232R-3V3-WE FTDI USB to UART Cable

Wiring
TTL-232R / TTL-232RFunctionTC-06
BlackGNDGND
RedVCCVCC
YellowRXDTXD
OrangeTXDRXD
BrownCTSLink CTS to RTS
GreenRTSLink CTS to RTS

Configure your serial port / terminal software to use 9600-8-N-1 (baud 38400, 8-bit, no parity, 1 stop bit).

Sending config commands to the HC-06 via an Arduino

E.g. connecting the TX and RX pin of the HC-06 to the TX and RX pins of the Arduino Uno TX and RX pins (don’t connect the STATE pin for this).

ArduinoHC-06
IO0RX (connect via 1K2+2K2 potential divider)
IO1TX (fine to connect directly to the Arduino Uno)

A 1K2+2K2 potential divider is required on the RX pin to shift the Arduino 5V TX pin down to 3.3V required by the HC-06 RX pin.

Menu > Tools > Serial Monitor

Line ending dropdown: “Both NL and CR” <<Not sure on this, in our tests with a terminal application it didn’t accept \r\n – yet to try with the Arduino IDE.

Baud dropdown: “9600”

Programming the HC-06 using AT commands

The HC-06 Bluetooth module is permanently configured to be slave and is always in AT mode when not paired to any other device. So to configure it, make sure there is nothing that will attempt to pair with it when it appears and simply power it up.

Example commands you can use

Check it’s in AT command mode

AT

(You should get the OK response)

Return the HC05 to its default manufacture settings

You need to press and hold the push button when sending this one, as it causes the HC-05 to reset and it will exit config mode as it restarts without the button held.

AT+ORGL\r\n

Change comms settings

AT+BAUD8

The number sets the baud rate:

1: 1200 baud
2: 2400 baud
3: 4800 baud
4: 9600 baud (default)
5: 19200 baud
6: 38400 baud
7: 57600 baud
8: 115200 baud
9: 230400 baud
A: 460800 baud
B: 921600 baud
C: 1382400 baud

Note the baud rate changes immediately and is also used for AT mode. You’ll need to set your terminal program or Arduino IDE to use your new baud rate.

Change device name from the default HC-05

AT+NAMEnewname

You can use this to get the current name: AT+NAME

Change default security code from 1234

AT+PIN5678

Version

AT+VERSION

Read Slave HC-05 Bluetooth address

There doesn’t appear to be an equivalent command to the HC-05 “AT+ADDR?” unfortunately, you’ll have to use your PC or phone to scan for it and get its MAC address.

BluefruitConnect on the iPhone or android will do it.

USEFUL?
We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.

Comments

Your email address will not be published. Required fields are marked *