Hello everyone, this blog post explains how to setup an HM-10 bluetooth module as an iBeacon. iBeacons can be used with mobile applications as an indoor positioning system, which helps smartphones determine their approximate location.
COMPONENTS USED:
- PC with arduino IDE installed (For Arduino Serial Monitor)
- USB to serial converter(CP2102)
- HM-10 bluetooth module
- Connecting wires for making connections
If you don’t have HM-10 module and CP2102 module you can have one from our store.HM-10 ,CP2102
HARDWARE CONNECTIONS
- Using the USB to serial converter connect the HM-10 module to PC.
-
Connections are as below…
- 5V of USB to TTL – ——–>VCC of HM-10
- GND ————-> GND
- TX of USB to TTL———>RX of HM-10
- RX of USB to TTL———>TX of HM-10
- Open the Serial port using the serial monitor in the Arduino IDE. The baud rate must be 9600.
- You can use any other serial monitor software like putty for the same purpose. Well I’m comfortable with Arduino serial Monitor.
Now power your module by plugging it to the USB port of your PC. To check whether the module is working, you can use our app called BLE chat, which can be downloaded from Google play store.
Now follow the below steps to setup HM10 as an iBeacon
Step 1:
- Open arduino IDE and select TOOLS
- Select COM port to which the CP2102 usb to ttl module is connected. Open the serial monitor.
- At the bottom menu select baud rate as “9600 baud” and line ending as “No line ending”.
Step 2:
Firmware version used is V540
Now you need to type in a few AT commands in the console for setting the HM10 module as iBeacon.
Each command will be acknowledged with an OK.
- AT+RENEW
- AT+RESET
- AT
- AT+MARJ0xABCD
- AT+MINO0x1234
- AT+ADVI5
- AT+NAMEIBEAC
- AT+ADTY3
- AT+IBEA1
- AT+DELO2
- AT+PWRM0
- AT+RESET
Note: The values of the parameters in red should be what you want them to be. The above are just examples.
Now the module is configured as an iBeacon, it should be visible on your Android device if you have an iBeacon locator App installed.
Step 3:
You can download any iBeacon detector application from google play store Here an app called “Locate Beacon” is used. Open the application. This application works only if your mobile supports BLE.
And select the Locate beacon menu. The app will list all visible iBeacons.
Cilck on any iBeacon to get the distance info regarding the same.