Projects‎ > ‎Electronic Projects‎ > ‎

[Part] HC-06 Bluetooth to serial adapter






Part description


I had a hard time finding all information to this module, that's why I decided to write this little part description. I'm using the HC-06 Bluetooth module in my RGB LED matrix project.



The HC-06 is a slave Bluetooth to serial adapter. It measures only 28mm x 15 mm x 2.35mm.
Possible baud rates: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200

Figure 1: Part

It's easy to handle and can be used as wireless UART communication from PC to any µC. The HC-06 is a slave only device. To establish a connection between two µC, a master device is needed (e.g. the HC-05 can be configured as master or slave).

Once the connection to the Bluetooth module is established, a terminal program can be used to connect to the specified COM port (the connection to the module is represented as a serial connection and the designated COM port can be found in the hardware device manager under Windows).

I prefer MTTTY (can be found here) as a terminal program. It has some cool features.

I wrote a Java program to establish a connection to the COM port. I'll add this as a separated project soon. It's also possible to connect directly to the Bluetooth module using Java APIs, but I haven't tried it yet.

Layout & Pins


I found an eagle library for the module (download at bottom of page).

Figure 2: Pins

PIN01    UART_TXD, TTL/CMOS level, UART Data output
PIN02    UART_RXD, TTL/COMS level, s UART Data input
PIN11    RESET, the reset PIN of module, inputting low level can reset the module
PIN12    VCC, voltage supply for the logic, the recommended voltage in the datasheet is             3.3V (works fine with 5V for my module at home, but be careful)
PIN13    GND
PIN22    GND
PIN24    LED, working mode indicator
            Slave device: Before paired, this PIN outputs the period of 102ms square
            wave. After paired, this PIN outputs high level.

Configuration


At commands can be used to set up the device. Before paired, the module is in command mode and can be programmed. I used MAX232 voltage level regulator to connect the device directly to the COM port of my notebook (USB to RS232 converter module).

Figure 3: Typical setup for a MAX232

You can also use my MAX232 USB module, which is filed here.

I use the terminal program MTTTY to send the commands. It's important to type the commands very fast, otherwise the commands won't be recognized from the Bluetooth module. MTTTY has a neat feature - it can send txt. files. I just typed my commands in notepad, saved it and send it with MTTTY.

AT commands


Default settings of the HC-06:
Slave
9600, N, 8, 1
Name linvor
Pincode 1234

Command test


Sent: AT
Receive: OK

Change baud rate


Sent: AT+BAUD#
Receive: OKbaud

1: 1200
2: 2400
3: 4800
4: 9600
5: 19200
6: 38400
7: 57600
8: 115200

Example
Sent: AT+BAUD1
Receive: OK1200

Change device name


Sent: AT+NAMEname
Receive: OKname

Example
Sent: AT+NAMEblue
Receive: OKblue

Change pin code


Sent: AT+PINxxxx
Receive: OKsetpin

Example
Sent: AT+PIN9999
Receive: OKsetpin

Application


This is a typical schematic to use the HC-06 Bluetooth module as a serial connection between a PC and a µC. Remember, the recommended supply voltage is 3.3V as written in the datasheet.

Figure 4: Application note

I use this module in a RGB matrix project to send images to the matrix. 

Comments




Sources

Ċ
Alexander Wegner,
16 Feb 2012, 04:52
Ċ
Alexander Wegner,
16 Feb 2012, 05:34
ċ
SerialPortBluetooth.lbr
(4k)
Alexander Wegner,
16 Feb 2012, 05:34
Comments