JIEXING HC-08 Low Power Bluetooth 4.0 Module User Manual

June 6, 2024
JIEXING

HC-08 BLUETOOTH CART
COMMUNICATION MODULE
V3.1 USER MANUAL

HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL
Version

Software: HC-08 V3.1, Hardware: V2.0

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 frequency is 2.4GHz ISM, modulation 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 an open environment.

The module uses the stamp hole encapsulation, can patch welding, module size is 26.9mm 13mm 2.2mm, very convenient to the customer within the embedded application system.
The module uses the CC2540 chip, the configuration of the 256K Byte space, supports AT command, the user can according to need to change the role and the serial baud rate, equipment name and other parameters, the use of flexible.


WEB:www.hc01.com

HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL
The HC-08 module has 30 pins, onboard PCB antenna, pin specific definitions are listed in the following table:

pin definition I/O explain
1 TXD output UART output, 3.3V TTL level
2 RXD input, weak pull up UART input 3. W TTL level
3 NC
4 NC
5 NC
6 DC input Debug clock
7 DD Input/output Debug data
8 P2.0 input, weak pull up NC
9 P1.7 input weak pull down NC
10 P1.6 Input, weak pulldown NC
11 nRST input, pull up Module reset pin, a low level of not less than 10ms

reset
12| VCC| input| Power pin, the requirements of 3.3V DC power supply, the supply current is not less than 100mA
13| GND| | Ground
14| LINCOLN| input| LED control pin ( not))
15| P1.4| input weak pull-down| NC
16| P1.3| output| LED output ( Note.° )
17| P1.1| output| Link indicating ( Note(2,: )
18| P1.2| input, weak pull-down| The master module clear memo!), ( Note’s )
19| P1.0| input, weak pull-down| NC
20| P0.7| input, weak pull up| NC
21| USB_D-| | NC
22| USB_D+| | NC
23| P0.6| input, weak pull up| NC
24| P0.1| input, weak pull up| NC
25| P0.5| input weak pull-down| NC
26| P0.0| input, weak pull up|
27| VCC| input| Power pin, the requirements of 3.3V DC power supply, the supply current is not less than 100mA
28| GND| | Ground
29| RXD| input, weak pull up| UART input 3.3V TTL level
30| TXD| output| UART output, 3.3V TTL level

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 outputs a low-level voltage, after connection, this pin outputs 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 has been recorded.
Note④: Input pin, be used to control the LED. If this pin is grounded, LED off. If this pin is left hanging, LED on.

Electrical characteristics:

parameter test condition representative value
working voltage DC2.0V∼3.6V

working current
( not LED)| master| not connected / connection| 21mA/9mA
slave| MODEO, not connected / connection| 8.5mA/9mA
MODE1, not connected / connection| 6pA∼2.6mA /1.6mA
MODE2, not connected / connection| 0.4μA/1.6mA

HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL AT COMMAND

The AT command to setting module parameter. Connection before, the module can operate 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| Test command| –| M/S
2| AT+RX| Check the basic parameters| –| M/S
3| AT+DEFAULT| Restore factory setting| | M/S
4| AT+RESET| Reset the module| –| M/S
5| AT+VERSION| Check version and date| –| M/S
6| AT+ROLE=x| Change master/slave role| S| M/S
7| AT+NAME=xx>xxxxxxxvr| Revise name| HC-08| M/S
8| AT+ADDR=XXXX(XXX(XXX| Revise address| Hardware
address| M/S
9| AT+RFPM=x| Revise RF power| 0(4dBm)| M/S
10| AT+BAUD=x,y| Revise UART baud| 9600,N| M/S
11| AT+CONT=x| Set connect ability| 0(Can be
connected)| M/S
12| AT+AVDA=x)orxxvcxxvcx| Change the broadcast data| –| S
13| AT+MODE=x| Set working mode| 0| S
14| AT+AINT=xx| Change the broadcast interval| 320| M/S
15| AT+CINT=MYY| Change the connection interval| 6,12| M/S
16| AT+CTOUT=xx| Change the connection
timeout time| 200| M/S
17| AT+CLEAR| The master module to dear the slave module addresses have been recorded.| | M
18| AT+LED=x| LED ON/OFF| 1| M/S
19| AT+LUUID=xxxx| Search UUID| FFFO| M/S
20| AT+SUUID=xx)or| Service UUID| FFEO| M/S

HC-08 BLUETOOTH UART COMMUNICATION MODULE USER MANUAL

21 AT+TUUID=xxxx Characteristic UUID FFE1 M/S
22 AT+AUST=x Set the time for automatic sleep 20 S

Note:

  1.  The AT command is behind no newline; if no special instructions, all AT commands are not transmitted using a 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 Bluetooth low energy, there will be special instructions and programs 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 ——–>>>> Bluetooth name
Role: Slave ——–>>>> master/slave role
Baud: 9600,NONE ——–>>>> UART baud rate
Addr: xx,xx,xx,xx,xx,xx ——–>>>> Bluetooth address
PIN: 000000 ——–>>>> Bluetooth password
Note: Temporarily does not support changing passwords!
③ Restore factory setting
Command: AT+DEFAULT
Return: OK
The module will automatically restart, please carry out a new operation on the restart
200ms!
④ Reset the module
Command: AT+ RESET
Return: OK
The module will automatically restart, please carry out the new operation on the restart 200ms!
⑤ Check version and date
Command: AT+ VERSION
Return: HC-08V3.1, 2017-07-07
⑥ Change master/slave role
Set command: AT+ROLE=x
Query command: AT+ROLE=?
X: role(M or S), M: master, S: slave。
The 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 in the master module.
⑦ Revise name
Set command: AT+ NAME=xxxxxxxxxxxx
Query command: AT+ NAME=?
The 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 the normal display. To send more than 12 characters, then only the first 12 characters). Setup is complete, effective after
the 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.

⑨ Revise RF power
Set command: AT+RFPM=x
Query command: AT+RFPM=?
X: RF power, as shown in the following table:

Parameter RF power
? View the current RF power
0 4dBm (default)
1 OdBm
2 -6dBm
3 -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 of 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=x(Only modified the UART baud rate)
AT+BAUD=x, y(Modify 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 😡 Parameter parity bit :y
? View the current baud rate
1200 1200bps N No parity
2400 2400bps E Even parity
4800 4800bps 0 Odd parity
9600 9600bps (default)
19200 19200bps
38400 38400bps
57600 57600bps
115200 115200bps

Example:
Send: AT+BAUD=19200
Return: OK19200
UART baud rate modified for 19200bps.
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 a 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 able is a variety of communication baud rate, the time interval of reference value:

baud rate (bps) 1200 2400 4800 9600 19200 38400 57600 115200
500 bytes time interval (ms) 6800 3600 2000 1000
300 bytes time interval (ms) 4200 2400 1200 600 400
100 bytes time interval (ms) 1500 800 400 160 100 120
80 bytes time interval (ms) 1000 650 320 120 80 60 100
60 bytes time interval (ms) 800 500 250 100 60 60 60 100
20 bytes time interval (ms) 200 100 50 20 20 20 20 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, the 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 Slave role

0
(default)| Central
Can be connected, the connection after entering ordinary transparent transmission mode| Peripheral
Can be connected, the connection after entering ordinary transparent transmission mode
1| Observer
The module can not be connected to other devices, but will automatically scan the HC-08 from the broadcast data machine package, fixed 2 seconds refresh time.| Broadcaster
Not connected with the master role, but can be combined with low power mode 3, the realization of broadcast data packet sent.

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, the broadcast aster module will receive the corresponding data, and through the serial port output.
  2. This model is only for the user who 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 data(Only slave module)
Command: AT+AVDA=xxxxxxxxxxxx
The parameter “XXXX XXXX XXXX” can be any 1~12 bytes of user data. If at this point the master module state of AT+CONT=1, then the master module UART port will output the “XXXX XXXX XXXX” 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 mode(Only slaver)
Set command: AT+MODE=x
Query command: AT+MODE=?

Command Parameter Return Function

AT+
MODE| =?| 0/1/2| Gets the current mode.
=0| OK| Full power mode (default), LED open.
=1| 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.

=2| Level 2 power-saving mode, LED close. No connection the current is 0.4RA. Can not be found, not connected before waking up, after awakening can be connected.

Note:

  1. Mode 1 is mainly used for:
    A. Used to reduce the power consumption.
    B. The slave module sends the broadcast data to the master module can be achieved one to much 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 another wireless device.

  2. Mode1 and mode2 are available through the UART port to send 1-byte data to wake up, but the front few bytes of data may be garbled after waking 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 a non-connected state, the 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 model. 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, the module will return to 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 the unconnected. Each time unit of the broadcast interval is 625µs (if xx is equal to 1, the broadcast interval is 625µs; if xx is equal to 2, the broadcast interval is 1250µs, etc.) The unit range of the broadcast interval is 32~16000 (equal 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
The broadcast interval is 1600 (equal to 1000ms).
⑮ 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 the minimum connection interval, yy is the maximum connection interval. xx≤actual connection interval≤yy. 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
The 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
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 to put the module 18 pin to the 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 characters 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).
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 the 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 another Bluetooth master after the serial port wake-up.

Reference schematic

WEB:www.hc01.com

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals