How to configure the Bluetooth
HC-06 module with AT commands, using Bolt 18F2550 system, through
the serial port.
a previous project described
here, an expansion
card with a
HC-06 and a serial
DB9 connector was
developed. The card
is inserted into the
serial port of
any microcontroller system.
The company sells a product
based on this design:
Bluetooth HC-06 module with serial port
In the particular
case of this project,
system was used, as shown in
the following photos,
to transmit the AT
commands, through the serial port of the HC-06
It is important to note that the 5 volt
@40 ma. supply needed for the Bluetooth expansion module shown
below, is fed from the Bolt board through the pin 7 of the DB9 connector.
different programs were developed in ANSI C to test
each of the AT commands, as shown in the table below.
each of the AT commands, connect devices as shown in
PCB VERSION OF
BLUETOOTH MODULE WITH SERIAL PORT:
SYSTEM TO CONFIGURE HC-06
MODULE WITH AT COMMANDS:
AT COMMANDS FORMAT:
All AT commands are strings of ASCII codes. According to the manufacturer's specification, the entire command
(without enter CR/LF),
should be transmitted from the microcontroller board to the
HC-06 Bluetooth in a single
time, at 9600 bps (which is the default rate).
For this purpose, using the
Bolt 18F2550 system, three
ANSI C programs were developed to send some of the commands, and
display the responses of the HC-06 module in the system LCD.
To do testing of the
commands, you have to load the corresponding .hex file to the
Bolt system and see the response in the LCD, according to the
table below. You may also modify the .c source file according to
your needs, to
change the parameters.
**In this particular command, the user will see the new name only
when pairing the Bluetooth HC-06 device to a PC computer with a
master Bluetooth module as shown below for a Windows 8 machine.
In this example, name was modified to "BlueBolt".
-For a preliminary testing of AT commands. Command:
Use the following program: C18-BOLT-BLUETOOTH-AT.zip
the firmware version of
HC-06. Command: 'AT+VERSION' Response: OKLinvorV1.8 Use the following
the device name. Command:
This example program changes the name of the HC-06
"BlueBolt". Use the following program:
C18-BOLT-BLUETOOTH-BLUEBOLT.zip User may use another name modifying
the .c program, compiling and loading the resulting .hex file to Bolt system.
-To change the
value is 9600).
change the password (pin number) for
Please note that,
as factory settings, the module has
a configuration of
9600 bps, pin
= 1234 and
name = HC-06
(some models have 'Linvor' as factory name)
Summary of AT Commands:
No action is taken by the
Bluetooth, it simply
acknowledges with “OK”
letting you know
communication was successful.
Sets the Bluetooth UART baud
rate. Baud rate is set by an
hexadecimal index from '1'
Indexes are: 1:1200, 2:2400,
3:4800, 4:9600, 5:19200,
6:38400, 7:57600, 8:115200,
Bluetooth Device Name
Sets Bluetooth Device Name
Sets the security code
needed to connect to the
Response: OK<4 digit code>
Get The Firmware Revision