HC05 and HC06 Bluetooth configuration experience summary
[Copy link]
Summary of Bluetooth configuration experience
- Taking HC05 and HC06 as examples - Author: Zhang Xinbin
1. Prepare materials
(1) A pair of Bluetooth modules
Figure 1: HC05 Figure 2: HC06
(2) USB to TTL one
Figure 3: USB to TTL
(3) DuPont line
2. Connection lines
3. AT Settings
1. Connect HC05 to HC05
(1) After the HC05 Bluetooth module and the USB to TTL converter are connected with a Dupont cable, press and hold the button, insert the USB to TTL converter into the computer, and then release the button. The HC05 Bluetooth module will flash slowly, indicating that it has entered the setting mode.
(2) Open the serial port debugging assistant (software), select the corresponding serial port (if not available, you need to install the driver), set the baud rate to 38400 , and click to open the serial port.
(3) Check "Send new line", enter AT, click Send, and the response is: OK.
(4) Set the name
Send: AT+NAME=****, **** is any English. If the name is set to an, then send
AT+NAME=an; response: OK
(5) Set the connection mode
Send: AT+CMODE=1; set to connect to any address. Response: OK
(6) Set the pairing password
Send: AT+PSWD =****, **** is any number. If the password is set to 2159, send AT+PSWD=2159; the response is: OK
(7) Set the baud rate
Send: AT+UART =****, 0, 0, **** is the baud rate. If the baud rate is set to
115200, then send AT+UART=115200,0,0; the response is: OK. Generally, the baud rate can be set to 115200, or 9600 is also acceptable.
(8) Set the Bluetooth to master-slave mode: Send: AT+ROLE=0, set the Bluetooth to slave mode. In slave mode, the Bluetooth flashes slowly.
Mode to connect to the phone
Bluetooth 2:
Send: AT+ROLE=1, set Bluetooth to host mode, Bluetooth flashes quickly in host mode.
(9) Connection test: Repower the two Bluetooth devices. After a while, the two Bluetooth devices will flash slowly in unison , indicating a successful connection.
2. Connect HC06 to HC06
(1) After the HC06 Bluetooth module and the USB to TTL converter are connected with a Dupont cable, do not press any buttons (there are no buttons on the top), and directly insert the USB to TTL converter into the computer. At this time, the HC06 Bluetooth module will flash quickly, indicating that it has entered the setup mode.
(2) Open the serial port debugging assistant (software), select the corresponding serial port (if not available, you need to install the driver), select the baud rate to the originally set baud rate, which is 9600 by default, and click to open the serial port.
(3) Uncheck "Send new line", enter AT, click Send, and the response is: OK.
(4) Set the name
Send: AT+NAME****, **** is any English character. If the name is set to an, then send
AT+NAMEan; response: OKsetNAME
(5) Set the pairing password
Send: AT+PIN****, **** is any number. If the password is set to 2159, send
AT+PIN2159; response: OKsetPIN
(6) Set the baud rate
Send: AT+BAUD, * is a number from 1 to C. If the baud rate is set to 115200, send
AT+BAUD8; the response is that the baud rate will be displayed. Generally, the baud rate is set to 115200, or
9600 is also possible. The corresponding commands and baud rates are as follows.
(7) Set the master-slave mode
Bluetooth 1: Send: AT+ROLE=S, set Bluetooth to slave mode, Bluetooth flashes quickly in slave mode, slave
Mode to connect to the phone
Bluetooth 2:
Send: AT+ROLE=M to set Bluetooth to host mode. In host mode, Bluetooth flashes slowly.
(8) Connection test Re-power the two Bluetooth devices. After a while, the two Bluetooth lights will stay on, indicating a successful connection.
3. Connection between HC05 and HC06
The configuration method is the same as above. You need to set the baud rate and pairing password to the same, and set one of the master and slave modes to the master and the other to the slave.
4. Differences between HC05 and HC06
(1) When setting up HC05AT, you need to check the option of sending new lines, but you do not need to check it for HC06.
(2) HC05 master flashes quickly and slave flashes slowly; HC06 master flashes slowly and slave flashes quickly. The two are exactly opposite.
(3) HC05 requires pressing and holding the button to enter AT settings, but HC06 does not require
|