HC-08 USER MANUAL HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Date 2017-07-07 Product introduction HC-08 Bluetooth UART communication module is a new generation of Bluetooth specification V4.0 BLE Bluetooth protocol based on the transmission module. Wireless working is GFSK. The maximum transmit power module 4dBm, the receiving sensitivity is -93dBm, and iphone4s can achieve 80 meters of super long distance communication under open environment. is 2.4GHz ISM, modulation frequency The module uses the stamp hole encapsulation, can patch welding, module size the
* 2.2mm, very convenient to the customer within is 26.9mm * 13mm embedded application system. The module uses the 256K Byte space, supports AT command, the user can according to need to change role and the serial baud rate, equipment name and other parameters, the use of flexible. the CC2540 chip, the configuration of Product size Pin definition WEBwww.hc01.com PAGE 1 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL The HC-08 module has 30 pins, on board PCB antenna, pin specific definitions are listed in the following table:
pin definition 1 TXD 2 RXD 3 NC 4 NC 5 NC 6 DC 7 DD P2.0 8 9 P1.7 10 P1.6 11 nRST 12 VCC LEDCON 13 GND 14 15 P1.4 16 P1.3 17 P1.1 18 P1.2 19 P1.0 20 P0.7 21 USB_D-
22 USB_D+
23 P0.6 24 P0.1 25 P0.5 26 P0.0 27 VCC 28 GND 29 RXD 30 TXD I/O explain output input, weak pull up UART output, 3.3V TTL level UART input, 3.3V TTL level Debug clock input Debug data Input/output input, weak pull up NC input, weak pull down NC Input, weak pull down NC input, pull up input Module reset pin, a low level of not less than 10ms reset Power pin, the requirements of 3.3V DC power supply, the supply current is not less than 100mA Ground LED control pinNote LED outputNote Link indicatingNote input input, weak pull down NC output output input, weak pull down The master module clear memoryNote input, weak pull down NC NC input, weak pull up NC NC NC input, weak pull up NC input, weak pull up input, weak pull down NC input, weak pull up input Power pin, the requirements of 3.3V DC power supply, the supply current is not less than 100mA Ground UART input, 3.3V TTL level UART output, 3.3V TTL level input, weak pull up output WEBwww.hc01.com PAGE 2 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Note: Module indicating LED output pin, high level output, please use the resistance and LED connection. The connection before, From the slave module address the master module does not record, bright 100ms per second;
From the slave module address master module records, bright 900ms per second;
The slave module, LED light 1second very 2 seconds. After connection, LED lights always. Note: Link indicating output pin. Before connection, this pin output low level voltage, after connection, this pin output high level voltage. Note: Input pin, internal pull-down. This pin is connected with the high level, the master module to clear the slave module address have been recorded. Note: Input pin, be used to control the LED. If this pin is grounded, LED off. If this pin left hanging, LED on. Electrical characteristics:
parameter working voltage test condition
-
master not connected / connection working current not LED slave MODE0, not connected / connection MODE1, not connected / connection MODE2, not connected / connection representative value DC2.0V~3.6V 21mA/9mA 8.5mA/9mA 6A~2.6mA /1.6mA 0.4A/1.6mA WEBwww.hc01.com PAGE 3 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL AT COMMAND The AT command to setting module parameter. Connection before, module can operating AT command. Connection after entering serial transparent transmission mode. Module start is about 150ms, so the best after power on 200ms AT command operation. Unless otherwise indicated, the parameter setting of AT command is effective immediately. At the same time, parameters and functions of modification, the power down will not be lost. After the success of AT command modify unified returns OK ("AT+RX,AT+VERSION"
and so on the view of information command class except), no success does not return any information. AT COMMAND LIST AT Command x- parameter Function Default Role 1 AT 2 AT+RX 3 AT+DEFAULT 4 AT+RESET 5 AT+VERSION 6 AT+ROLE=x 7 AT+NAME=xxxxxxxxxxxx Test command Check the basic parameters Restore factory setting Reset the module Check version and date Change master/slave role Revise name 8 AT+ADDR=xxxxxxxxxxxx Revise address 9 AT+RFPM=x 10 AT+BAUD=x,y 11 AT+CONT=x 12 AT+AVDA=xxxxxxxxxxxx 13 AT+MODE=x 14 AT+AINT=xx 15 AT+CINT=xx,yy 16 AT+CTOUT=xx 17 AT+CLEAR 18 AT+LED=x 19 AT+LUUID=xxxx 20 AT+SUUID=xxxx Revise RF power Revise UART baud Set connect ability Change the broadcast data Set working mode Change the broadcast interval Change the connection interval Change the connection timeout time The master module to clear the slave module address have been recorded. LED ON/OFF Search UUID Service UUID WEBwww.hc01.com
-
-
-
-
-
S HC-08 Hardware address 0(4dBm) 9600,N 0(Can be connected)
-
0 320 6,12 200
-
1 FFF0 FFE0 M/S M/S M/S M/S M/S M/S M/S M/S M/S M/S M/S S S M/S M/S M/S M M/S M/S M/S PAGE 4 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL 21 AT+TUUID=xxxx FFE1 Characteristic UUID 22 AT+AUST=x Note:
Set the time for automatic sleep 20 M/S S 1. The AT command behind no newline; if no special instructions, all AT commands are not transmitted using newline. 2. 11~14 this 4 is advanced instruction and must be used in combination, can play its due role BLE Bluetooth low energy. Using a Bluetooth low energy, there will be special instructions and program introduced in the following sections. COMMAND EXPLAIN Test command Command: AT Return: OK Check the basic parameters View the basic parameters such as Bluetooth name, master/slave role, UART baud rate, address and password. Command: AT+RX Return: Name: HC-08 Role: Slave Baud: 9600,NONE Addr: xx,xx,xx,xx,xx,xx PIN: 000000
-------->>>> Bluetooth name
-------->>>> master/slave role
-------->>>> UART baud rate
-------->>>> Bluetooth address
-------->>>> Bluetooth password Note: Temporarily does not support change password!
Restore factory setting Command: AT+DEFAULT Return: OK The module will automatically restart, please carry out new operation on the restart 200ms!
Reset the module Command: AT+ RESET Return: OK The module will automatically restart, please carry out new operation on the restart 200ms!
Check version and date Command: AT+ VERSION WEBwww.hc01.com PAGE 5 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Change master/slave role Set command: AT+ROLE=x Query command :AT+ROLE=
X: role(M or S), M: master, S: slave Default setting is S(slave) Send: AT+ROLE=M Return: OK Set master role, the module will automatically restart Send: AT+ROLE=?
Return: Master You can view the role is the master module. Revise name Set command: AT+ NAME=xxxxxxxxxxxx Query command: AT+ NAME=
Default setting is HC-08, you can set the other name (12 characters limit, support the visual ASCII code and part of the escape character. The module supports Chinese, but android devices must be converted to "UTF8 code" to normal display. To send more than 12 characters, then only the first 12 characters). Setup is complete, effective after module automatically reset!
Example:
Send: AT+NAME=HCKJ Return: OKsetNAME Send: AT+NAME=?
Return: HCKJ Revise address Set command: AT+ADDR=xxxxxxxxxxxx Query command: AT+ADDR=?
The address must be 12 bit 0~F uppercase characters, namely hexadecimal characters. Example:
Send: AT+ADDR=1234567890AB Return: OKsetADDR Setup is complete, effective after module automatically reset!
Send: AT+ADDR=
Return: 1234567890AB Send: AT+ADDR=000000000000 Return: OKsetADDR Send 000000000, module to restore the default hardware address. Module factory default is hardware address. WEBwww.hc01.com PAGE 6 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Revise RF power Set command: AT+RFPM=x Query command: AT+RFPM=?
X:RF power, as shown in the following table:
Parameter RF power
?
0 1 2 3 View the current RF power 4dBmdefault 0dBm
-6dBm
-23dBm Example:
Send: AT+RFPM=2 Return: OK RF power modified -6dBm. Send: AT+RFPM=?
Return:-6dBm RF power is -6dBm. The peak current is more than 30mA (when RF power is 4dBm). Because the small discharge current button batteries, such as to use the button battery powered, the best setting for -6dBm or -23dBm. Revise UART baud Set command: AT+BAUD=xOnly modified the UART baud rate AT+BAUD=x, yModify the UART baud rate and parity bit Query command: AT+BAUD=?
x: UART baud rate, y: parity bit, As shown in the following table:
Parameter UART baud :x Parameter parity bit :y N E O No parity Even parity Odd parity
?
1200 2400 4800 9600 19200 38400 57600 115200 View the current baud rate 1200bps 2400bps 4800bps 9600bpsdefault 19200bps 38400bps 57600bps 115200bps Example:
Send: AT+BAUD=19200 Return: OK19200 UART baud rate modified for 19200bps. WEBwww.hc01.com PAGE 7 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Send: AT+BAUD=4800,E Return: OK4800,EVEN UART baud rate modified for 4800bps, and even parity. Send: AT+BAUD=
Return: 4800,EVEN View UART baud rate and parity bit. 9600bps baud rate following each packet please do not exceed the maximum number of bytes to 500 bytes, 19200bps baud rate above each packet please refer to the following table, have a certain time interval between data packets. The following table is a variety of communication baud rate, the time interval of reference value:
baud rate (bps) 500 bytes time interval (ms) 300 bytes time interval (ms) 100 bytes time interval (ms) 80 bytes time interval (ms) 60 bytes time interval (ms) 20 bytes time interval (ms) 1200 6800 4200 1500 1000 800 200 2400 3600 2400 800 650 500 100 4800 2000 1200 400 320 250 50 9600 1000 600 160 120 100 20 19200 38400 57600 115200 400 100 80 60 20 120 60 60 20 100 60 20 100 20 Note:
1. The above is the measured data, the fastest speed transceiver theory total:2500 bytes/sec, suggested that the speed control in the 2000 bytes/sec. 2. Bytes of each packet, suggestion is an integer multiple of 20. 3. Module sends data automatically subcontracting is an integer multiple of 20 bytes. Is to send a 100 bytes packet, will receive a plurality of packets at another end, each data packet is an integer multiple of 20, the total number of bytes for the full 100 bytes. Set connect ability Set command: AT+CONT=x Query command: AT+CONT=?
The X parameter functions are as follows:
Parameter Master role Central Slave role Peripheral 0 default Can be connected, the connection after entering ordinary transparent Can be connected, the connection after entering ordinary transparent transmission mode Observer transmission mode Broadcaster 1 The module can not be connected to other device, but will automatic scan the HC-08 from the broadcast data machine package, fixed 2 seconds Not connected with the master role, but can be combined with low power mode 3, the realization of broadcast data packet send. refresh time. WEBwww.hc01.com PAGE 8 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Example:
Send: AT+CONT=1 Return: OK Setup is complete, effective after module automatically reset!
Send: AT+CONT=?
Return: Non-Connectable The command please with "AT+MODE", "AT+AVDA" and "AT+AINT" command with the use of. Note:
1. The master/slave module CONT=1 is masterly used for transmitting broadcast data. From the slave role to send broadcast data, broadcast master module will receive the corresponding data, and through the serial port output. 2. This model is only for the user can grab this broadcast data package yourself. The specific communication protocol is not described here, the intention to please the following official website consultation online customer service: http://www.hc01.com/
Change the broadcast dataOnly slave module Command: AT+AVDA=xxxxxxxxxxxx Parameter xxxxxxxxxxxx can be any 1~12 bytes user data. If at this point the master module state of AT+CONT=1, then the master module UART port will output the xxxxxxxxxxxx data. The broadcast data will not be preserved permanently, will be deleted after the restart. Example:
Slave role send: AT+AVDA=1234567890AB Return: OK If at this point the master module state of AT+CONT=1, UART port will output:
1234567890AB. Set working modeOnly slaver Set command: AT+MODE=x Query command: AT+MODE=?
Command Parameter Return Function AT+
MODE
=?
=0
=1
=2 0/1/2 Gets the current mode. OK Full power mode (default), LED open. Level 1 power saving mode, LED close. The connection current is determined by the setting of AT+AINT. The connection is mainly determined by AT+CINT. The MODE1 has covered the 2.4 version of MODE3 and is more reasonable. Level 2 power saving mode, LED close. No connection the current is 0.4A. Can not be found, not connected before wake up, after awakening can be connected. WEBwww.hc01.com PAGE 9 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Note:
1. Mode 1 is mainly used for:
A. Used to reduce the power consumption. B. The slave module send the broadcast data to the master module, can be achieve one to many one-way communication (theory can be from a slave module to infinite master module). C. As anti-lost alarm, attendance card, heart rate meter or other wireless device. 2. Mode1 and mode2 are available through the UART port to send 1 byte data to wake up, but front few bytes of data may be garbled after wake up. Therefore, we recommend sending 10 bytes hexadecimal code of "0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF" to awaken the module, avoid the front several may be garbled bytes. Since then, modules work on the full speed mode, the UART port can be normal to send and receive data. In non connected state, module after awakening into full speed mode and maintained for 20 seconds(default setting, can be adjusted by AT command), and then return to the original mode. As long as 20 seconds in the UART has received data, then retiming. If the module is in the connected state, then after awakening will remain in the full speed mode, before disconnecting, module will return the original power mode. Example:
Send: AT+MODE=?
Return: 0 View the current mode. Send: AT+MODE=2 Return: OK Setting mode 2, effective immediately. Change the broadcast interval Set command: AT+AINT=xx Query command: AT+AINT=?
Broadcast intervals affect the power loss of unconnected. Each time unit of the broadcast interval is 625s (if xx equal to 1, the broadcast interval is 625s; if xx equal to 2, the broadcast interval is 1250s, etc.) The unit range of the broadcast interval is 32~16000 (equa to 20ms~10s). Example:
Send: AT+ AINT =1600 Return: OK+AINT=1600 Broadcast interval modified 1600 (equal to 1000ms). Send: AT+ AINT =?
Return: OK+AINT=1600 Broadcast interval is 1600 (equal to 1000ms). WEBwww.hc01.com PAGE 10 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Change the connection interval Set command:AT+CINT=xx,yy Query command:AT+CINT=?
Connection intervals affect the power loss of connection, the master needs to be set at the same time. In this command, xx is minimum connection interval, yy is maximum connection interval. xxactual connection intervalyy. A single parameter xx can be entered separately, if the yy < xx is recorded, at this time, yy will be replaced by xx. Each time unit of the broadcast interval is 1.25ms, the setting range is 6~3199
(equal to 7.5ms~4s) Example:
Send: AT+CINT=80 Return: OK+ CINT=80, 80 Connection interval modified 100ms. Send: AT+CINT=6, 12 Return: OK+ CINT=6, 12 Connection interval modified 7.5~15ms. Send: AT+CINT=?
Return: OK+ CINT=6, 12 Connection interval is 7.5~15ms. Change the connection timeout time Set command: AT+CTOUT=xx Query command: AT+CTOUT=?
Each time unit of the connection timeout time is 10ms. The unit range of the connection timeout time is 10~3200 (equal to 100ms~32s). This value directly affects the time of disconnection, the time of "accidental disconnection" (active disconnection is not affected by this value). Example:
Send: AT+ CTOUT=200 Return: OK+ CTOUT=200 Connection timeout time modified 2s. Send: AT+ CTOUT=?
Return: OK+ CTOUT=200 Connection timeout time is 2s. The master module to clear the slave module address have been recorded Only master Set command: AT+CLEAR Query command: OK WEBwww.hc01.com PAGE 11 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL The master module as long as the connection from the slave module, will remember the last time the connection from the slave module MAC address. If you want to connect to the other slave module, you must remove the current memory. The first way is put the module 18 pin to high level of 200mS, the other way is used the AT+CLEAR command. SET LED ON/OFF Set command: AT+LED=x Query command: AT+LED=?
In this command, x is 0 or 1. When x=0, LED is OFF; when x=1, LED is ON. If LED is OFF, use this command turned on the LED, must reset the module, LED will be bright!
SET Search UUID Set command: AT+LUUID=xxxx Query command: AT+LUUID=?
The parameters xxxx must be within the range of 0~F. Because of the large number of Bluetooth devices, the master (because there is no screen, it is difficult to manually select) set up search UUID filtering. In this case, only the same UUID slave module can be searched. Example:
Send: AT+LUUID= FFF0 Return: OK+LUUID=FFF0 Search UUID modified FFF0 (0xFFF0). Send: AT+ LUUID =?
Return: OK+LUUID=FFF0 Search UUID is FFF0 (0xFFF0). SET Service UUID Set command: AT+ SUUID=xxxx Query command: AT+ SUUID=?
The parameters xxxx must be within the range of 0~F. This service UUID is the basis for the master to find the service, and the characteristic can be found by finding the service. Example:
Send: AT+SUUID= FFE0 Return: OK+SUUID=FFE0 Service UUID modified FFE0 (0xFFE0). Send: AT+ SUUID =?
Return: OK+SUUID=FFE0 Service UUID is FFE0 (0xFFE0). WEBwww.hc01.com PAGE 12 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL 21 SET Characteristic UUID Set command: AT+ TUUID=xxxx Query command: AT+ TUUID=?
The parameters xxxx must be within the range of 0~F. The module only one characteristic UUID. The characteristic UUID properties: read, notify, write_without_response. Example:
Send: AT+TUUID= FFE1 Return: OK+TUUID=FFE1 Characteristic UUID modified FFE1 (0xFFE1). Send: AT+ TUUID =?
Return: OK+TUUID=FFE1 Characteristic UUID is FFE0 (0xFFE1). 22 Set the time for automatic sleep Set command: AT+ AUST=x Query command: AT+ AUST =?
The time for automatic sleep is 1~300s. The smaller the time it is, the more power is saved. In the low power mode, if there is no operation after the activation module, x seconds will return the low-power mode set by the user. Example:
Send: AT+ AUST=20 Return: OK+ AUST=20 The time for automatic sleep modified 20s. Send: AT+ AUST=?
Return: OK+ AUST=20 The time for automatic sleep is 20s. Note: the default of AUST is 20 seconds. If it is MODE1 low power mode, since the mode is discoverable and connectable, AUST can be set to a minimum of 1 second in order to save power. If it is MODE2 low power mode, because the mode is not discoverable and can not be connected, it is proposed to set up the AUST to 20 seconds or more to ensure that the module has enough time to connect with other Bluetooth master after the serial port wake-up. WEBwww.hc01.com PAGE 13 HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL Reference schematic This device complies with Part 15 of the FCC Rules. Operation is subject to the following two conditions: (1) this device may not cause harmful interference, and (2) this device must accept any interference received, including interference that may cause undesired operation. Changes or modifications to this unit not expressly approved by the party responsible for compliance could void the users authority to operate the equipment. NOTE: This equipment has been tested and found to comply with the limits for a Class B digital device, pursuant to Part 15 of the FCC Rules. These limits are designed to provide reasonable protection against harmful interference in a residential installation. This equipment generates, uses and can radiate radio frequency energy and, if not installed and used in accordance with the instructions, may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures:
-- Reorient or relocate the receiving antenna.
-- Increase the separation between the equipment and receiver.
-- Connect the equipment into an outlet on a circuit different from that to which the receiver is connected.
-- Consult the dealer or an experienced radio/TV technician for help. This device and its antenna(s) must not be co-located or operation in conjunction with any other antenna or transmitter. Important Note:
In the event that these conditions cannot be met (for example certain laptop configurations or co-location with another transmitter), then the FCC authorization is no longer considered valid and the FCC ID cannot be used on the final product. In these circumstances, the OEM integrator will be responsible for re-evaluating the end product (including the transmitter) and obtaining a separate FCC authorization. End Product Labeling The final end product must be labeled in a visible area with the following" Contains FCC ID:
2AEJQHC-08". Manual Information to the End User The OEM integrator has to be aware not to provide information to the end user regarding how to install or remove this RF module in the users manual of the end product which integrates this module. The end user manual shall include all required regulatory information/warning as show in this manual WEBwww.hc01.com PAGE 14