Part descriptionThe 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 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 & PinsI found an eagle library for the module (download at bottom of page). 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. ConfigurationAt 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). 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 commandsDefault settings of the HC-06: Slave 9600, N, 8, 1 Name linvor Pincode 1234 Command testSent: AT Receive: OK Change baud rateSent: 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 nameSent: AT+NAMEname Receive: OKname Example Sent: AT+NAMEblue Receive: OKblue Change pin codeSent: AT+PINxxxx Receive: OKsetpin Example Sent: AT+PIN9999 Receive: OKsetpin ApplicationThis 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. I use this module in a RGB matrix project to send images to the matrix. Comments |
Projects > Electronic Projects >