HM Module Manual
HM Module Manual
acquisition module
---- Master and slave role in one
---- Remote control without other MCU
---- The PIO data acquisition without other MCU
13. Product parameters
2. Product overview
3. Product model
4. Product certificate
Products have FCC-ID, CE, RoHS.
5. Product pictures
5 NC NC
6 NC NC
7 NC NC P2_2
8 NC NC P2_1
9 NC NC P2_0
10 NC NC
11 RESETB Reset if low >100ms. RESET_N
12 VCC 3.3V
13 GND Ground
14 GND Ground
15 USB_D- USB interface PIN3
16 NC NC
17 NC NC
18 NC NC
19 NC NC
20 UB_D+ USB interface PIN2
8 NC NC PIN3
9 VCC V3.3 VCC
10 NC NC or VCC
11 RESETB Reset if low <100ms RESET_N
12 GND Ground GND
13 PIO3 input/output pin P1_1
6.9 HM-Sensor
7. System function
How to wake up module from sleep mode?
There are two ways to wake up module from sleep mode.
7.1 Send “I am iron man, I am iron man, I am iron man I am iron…..” string.
Yes, that is a joke, in sleep mode, you can send a long string (Length >
80 or more), that string can made module wake up, and you will receive
“OK+WAKE” string through UART. That string can’t include any AT commands.
7.2 Long press system KEY >=1000 ms.
After wake up module, you can send and receive AT commands.
How to let module into sleep mode?
In discoverable mode, send “AT+SLEEP” string through UART, if all is okay,
module will return “OK+SLEEP” string and into sleep mode.
8 AT Commands
Factory default setting:
Name: HMSoft; Baud: 9600, N, 8, 1; Pin code: 000000; Peripheral
Role; transmit mode.
AT Command format:
Uppercase AT command format. string format, without any other
symbol. (e.g. \r or \n).
1. Test Command
-------------------------------------------------------Last Version V539 2015-03-08 18
HM Bluetooth module datasheet
AT OK None
OK+LOST
If Module is not connected to remote device will receive: “OK”
If Module has connected, module will disconnected from remote device, if “AT
+ NOTI” is setup to 1, will receive: “OK+LOST”
2. Query module address
Send Receive Parameter
AT+ADC[para1]? OK+GET:0.00 Para1: 3~B
map to PIO3~PIOB
HM-11 has no this function.
Added since V526.
3. Query module address
A: 2000ms
B: 3000ms
C: 4000ms
D: 5000ms
E: 6000ms
F: 7000ms
Default: 9
HMSoft Default: 0
HMSensor Default: 9
@Override
byte[] scanRecord) {
......<Other code>......
//Since V522
if(scanRecord[i + 7] > 0)
if(scanRecord[i + 5] > 0)
if(scanRecord[i + 6] > 0)
......<Other code>......
};
iOS:
c. Included in LeScan function result NSDictionary struct, service id is
0xB000.
12. Query/Set Bit format
Send Receive Parameter
This command is used only for compatible uses 7 data bits, 2 stop bit device.
13. Query/Set baud rate
Send Receive Parameter
AT+BAUD? OK+Get:[para1] Para1: Baud rate No.
AT+BAUD[para1] OK+Set:[para1] 0---------9600
1---------19200
2---------38400
3---------57600
4---------115200
5---------4800
6---------2400
7---------1200
8---------230400
Default: 0(9600)
e.g.
Query baud:
Send: AT+BAUD?
Receive: OK+Get:0
Setup baud:
Send: AT+BAUD1
Receive: OK+Set:1
Note: If setup to Value 7, After next power on, module will not support any
AT Commands, until PIO0 is pressed, Module will change Baud to 9600.
14. Query/Set Minimum Link Layer connection interval
Send Receive Parameter
AT+COMI? OK+Get:[P1] P1: 0 ~ 9
1: Update
Default: 1(update)
Notice: Only Central role is used. Must set up AT+IMME1 and AT+ROLE1
first.
If remote device has already connected to other device or shut down,
“OK+CONNF” will received after about 10 seconds.
22. Try connect an address
Send Receive Parameter
AT+CO[P0][P1] OK+CO[P0][P0][P2] P0: N, 1
N: Normal Address
1: Dual module Addr
P1: Address
Like: 0017EA090909
P2: A, E, F
A: Connecting
E: Connect error
F: Connect Fail
Notice: Only central role is used. Must set up AT+IMME1 and AT+ROLE1
first.
If remote device has already connected to other device or shut down,
“OK+CONNF” will received after about 10 Seconds.
e.g.
Try to connect an device which MAC address is 00:17:EA:09:09:09
Send: AT+CON0017EA090909
May receive a reply:
OK+CONNA ========= Accept request, connecting
OK+CONNE ========= Connect error
OK+CONN ========= Connected, if AT+NOTI1 is setup
OK+CONNF ========= Connect Failed, After 10 seconds
23. Query PIO04~PIO11 input(output) state
Para1 is a byte, has 8 bits, bit 7 ~ bit 0 is map to the PIO4 ~ PIO11.
This command is added since V515 version.
24. Query/Set PIO collection rate
Send Receive Parameter
If the device not enable iBeacon function, P0, P1, P2 will use ‘0’ fill.
1: On
Default: 0
1: Turn on iBeacon
Default: 0
51. Query/Set PIO pins output high or low (Only this time, when module next
power on, this value is not be used)
e.g.
Query PIO2
Send: AT+PIO2?
Setup PIO2 output high
Send: AT+PIO21
Receive: OK+PIO21
HM-10 HMSensor version: para1 value is 2~A
HM-10 HMSoft version: para1 value is 2~B
e.g.
Query Pin Code
Send: AT+PIN?
Receive: OK+PIN:000000
Setup Pin Code 008888
Send: AT+PIN008888
Receive: OK+Set:008888
53. Query/Set Module Power
3: 6dbm
Default: 2
1:Show name
Default: 0
This value is only used for Central Role, when module has Last Connected
address.
71. Query/Set Module Bond Mode
Send Receive Parameter
AT+TYPE? OK+Get:[para1] None
AT+TYPE[para1] OK+Set:[para1] Para1: 0~2
0:Not need PIN Code
1:Auth not need PIN
2:Auth with PIN
3:Auth and bond
Default: 0
Important: If your module version is less than V515, please don’t use
this command. Under android 4.3 AT+TYPE1 is same to AT+TYPE2.
Note1: Value 3 is added in V524.
72. Query/Set service UUID
Send Receive Parameter