Make IBeacon With HM10/HM11

62K6537

Intro: Make IBeacon With HM10/HM11

iBeacon is a new technology described by Apple Inc. as "a new class of low-powered, low-cost transmitters that can notify nearby iOS 7 or 8 devices of their presence".The technology enables a smart phone or other device to perform actions when in close proximity to an iBeacon.

One application is an indoor positioning system, which helps smart phones determine their approximate location or context. With the help of an iBeacon, a smartphone's software can approximately find its relative location to an iBeacon in a store. iBeacons can help a phone show notifications of items nearby that are on sale, and it can enable payments at the point of sale (POS) where customers don’t need to remove their wallets or cards to make payments. iBeacon technology works using the Bluetooth Low Energy (BLE) technology, also known as Bluetooth Smart. iBeacon uses Bluetooth low energy proximity sensing to transmit a universally unique identifier picked up by a compatible app or operating system. The identifier can then be looked up over the internet to determine the device's physical location or trigger an action on the device such as a check-in on social media or a push notification. Various vendors have since made hardware iBeacons that come in a variety of form factors, including small coin cell devices, USB sticks, and generic Bluetooth 4.0 capable USB dongles.

STEP 1: Hardware

We will use a HM-10 module. It is bluetooth low energy 4.0 module. This module has Mcu on board which means that we can program it with rx, tx, and that we also can use FTDI chip to send AT commands via serial connection. By sending AT commands we are configuring options for this module. I would recommend flashing module with new firmware right after getting it, it’s very simple but useful step.

STEP 2: Scheme

Now we will see how to connect hm10 to the ftdi. hm10 is working on 3.3 voltage, and its not recommended to put it on higher voltage. Here is the pin layout and how to connect them:

hm10 ftdi

rx——————————————-tx

tx——————————————-rx

cts——————————————cts

rts——————————————dtr/rts

For all parts who don’t have 3.3v power supply , we need voltage divider. It is connection of two resistors in series as seen on image: http://a.pololu-files.com/picture/0J1423.600.png?... If you have external power supply like this on link you have to connect common ground of ftdi and power supply. DO NOT FORGET THIS!

Ok, when you connect this you can proceed to next step.

STEP 3: Updating Firmware

  1. First download your firmware from this web site;

-For cc2541 : https://github.com/suryasundarraj/hm-10-firmware

-For cc2540 :

2. Carefuly choose right model of chip, here we have cc2540 and cc2541. Take a look to the module and see which model of chip you have and download the firmware.

3. To enter in an update mode, you have to go on arduino IDE software and choose COM port (or serial on mac) , and open serial monitor.

4. In serial monitor set baud rate to “9600” and “no line ending”, and then write “AT+SBLUP” without quotes. The hm10 should respond with “OK+SBLUP”

5. When you are done with that, open a folder where you extracted firmware ,start program, choose com port of ftdi.

6. Choose "img" file and select .bin file in folder and finally click on Load image button

DO NOT INTERRUPT THE UPDATE PROCCES. IT CAN DAMAGE YOUR MODULE!

STEP 4: Ibeacon Configuration

Now we have to write commands to configure module to ibeacon, as you see on picture i make program to do it for me.(when i test it i will upload here)

Open arduino ide, choose COM port (serial on mac) , open serial monitor and write thess commands:

1. AT+RENEW Restores factory defaults

2. AT+RESET Reboot HM-10

3. AT Wait for OK

4. AT+MARJ0x1234 Set iBeacon Major number to 0x1234 (hexadecimal)

5. AT+MINO0xFA01 Set iBeacon Minor number to 0xFA01 (hexadecimal)

6. AT+ADVI5 Set advertising interval to 5 (546.25 milliseconds)

7. AT+NAMEDOPEY Set HM-10 module name to DOPEY. Make this unique.

8. AT+ADTY3 Make non-connectable (save power)

9. AT+IBEA1 Enable iBeacon mode

10.AT+DELO2 iBeacon broadcast-only (save power)

11.AT+PWRM0 Enable auto-sleep. This reduces power from 8 to 0.18 mA

12.AT+RESET Reboot

You can change major , minor and name of the commands. You can find more commands on this link: http://www.jnhuamao.cn/iBeacon_en.zip The ibeacon is made now. Just disconnect wires from ftdi and put battery on vcc and gnd

STEP 5: Wake Up Hm-10

When the HM-10 is in auto-sleep mode, it will quickly go to sleep when powered upor rebooted. After sending it the AT+PWRM0 command and restarting it, theHM-10 will no longer respond to AT commands. To wake up the device, send it along line of random alphabetic characters which is 80 characters or more. It willwake up and respond with OK+WAKE. If you want to work with the device for awhile, send it an AT+PWRM1 command so it does not sleep on you. You can thensend it an AT+PWRM0 when you are done to reduce power consumption. Have fun with your new iBeacon.

STEP 6: Test IBeacon Scan

The following screenshots show three of the HM-10 based iBeacons scanned by an Android phone, and the distance to one of the devices.

Locate iBeacon for iOS:

- https://itunes.apple.com/us/app/locate-for-ibeaco...
iBeacon Scavenger Hunt:

- https://itunes.apple.com/us/app/beacon-scavenger-...

-https://play.google.com/store/apps/details?id=com...

iBeacon Scanner for Android:

- https://play.google.com/store/apps/details?id=kr....

30 Comments

Hi wanna ask can i change the major value by sending AT+MARJ while the HM-10 is advertising
To send data over the beacon probably means that it be done through AT+MINO[0xXXXX] where 0xXXXX is a character string for hex temperature. With beacons there is no connection to break, so AT commands should work.


Is it possible to do for other ble modules like jdy,nrf etc...??
Hello Armins2

Could the Hm-10 be used to transmit a digital output of yes or now, triggered by an analog sensor controlled only by the HM-10 module?

(Want to transmit to a phone when a pulse sensor detects a heartbeat)

If so... I´ll appreciate a lot if you could yuo help me with some guidance or example
Thanks!
In my HM10 module, i get response OK for AT and AT+RESET commands.I get response for no other command not even for AT+SBLUP. Is there any solution?
Hello , i think you must update your firmware , can you check the version of your module now ?
Is possible to advertise temperature data using hm10…? I couldn't find where we specify what to advertise.
Hello.. i m following this steps but i did'nt have results.. My phone dont detect my HM10 device ?? Any help please

Hello , did you module is v256 version and above ?

What is ftdi? When I search it shows different chips, and one usb-uart converter. Could you please be more descriptive on ftdi?
Hello , yes ftdi is usb to uart converter . You have a different chips that do same conversion example (ftdi , chg , cp2012...) on you is what chip to choose but they all do same job convert usb signals to uart ttl level .

Hello Sir, I already followed your steps and it didnt work :( I am using BLE 4.0 HM10 v540 then I also download the app that you are using which is my android phone is also compatible for BLE 4.0 Scanning but still it didnt work :( I can't see my BLE Device to my Android Phone even I already try a different version of android which is 4.3 above android version.. Can you help me sir about this problem ? I really really really need your help sir please please please help me sir I'm begging sir .. I think u are the one person who can help me about this please please sir I really need this sir for my thesis sir huehue pls I'm a 4th yr IT Student from Philippines.. Please sir Help me about this. I am really hoping your response sir please please please sir Im begging please help me. Thankyou thankyou very much.

Hello Jhon i see you really need this , you dont need to begging for help. i'm here to help anyone who wants to make this so can we speak on fb or something like that ?

Wow sir Really Thankyou very much for not ignoring my msg. thankyou.. If it is ok to you sir ? we can also use vcall in facebook. here's my account name : " Jampong Mga Daliri " and the link of my Fb account : " https://www.facebook.com/jampongmga.daliri "

Again sir, Thankyou Very Much as in Thankyou.

Hi, my HM_10 went to sleep and I could not get it to wake up. I've tried typing the 80+ character string to the serial monitor and coding

"Serial.write("sdisdisdsdsdsdsdsadsadsadsadasdsadsadsadsadsadsadgfhgjhghghgfhgtrytrytryerrewrwrewregjvbdsfewregfgfpdodoidodpdosjwjww");"

for it to write to it. My HM_10 will not turn on. Am i doing this wrong? I can't send any AT commands. Thank you

Hi sorry for not answering for this time i think you must check first your circuit , expectly orientation of rx and tx , when you sending other commands is it respond like when you type "AT" ypu should get "OK"..

and can you send a code please

Hi, thanks for the tutorial!

How would you include a master module linked with Arduino that would measure when the HM-10 passes by within a certain range, then send some info (like "HM-10 passed by") via an app to an Android phone?

Thanks!

More Comments