Introduction: Turn Your CC2541 Based HM-10 Bluetooth Smart Module Into an IBeacon

Picture of Turn Your CC2541 Based HM-10 Bluetooth Smart Module Into an IBeacon

This tutorial walks through the steps for converting an HM-10 Bluetooth Smart (previously known as BLE) module as an iBeacon.

( Module image courtesy https://github.com/nickswalker/ble-dev-kit/wiki/HM-10-Pinout )

Step 1: Solder the Module Onto a General Purpose PCB

Picture of Solder the Module Onto a General Purpose PCB

The first thing you need to do is to solder the module onto a general purpose PCB / matrix board / dot board. You could use wires as well ending in berg headers (male or female), if that works for you, but the PCB serves as a firm base for the arrangement. Breakout the following four signals from the CC2541 based HM-10 Bluetooth Smart Transceiver into pinouts.

Pin 1 -> Tx on HM-10

Pin 2 -> Rx on HM-10

Pin 12 -> 3.3V on HM-10

Pin 13 / Pin 14 -> GND on HM-10

(Pinout Image courtesy : https://urbanjack.wordpress.com/2014/04/27/how-to-build-you-own-bluetooth-low-energy-ibeacon-for-10-diy/ )

Step 2: Setup the Connection With the CP2102 USB to Serial Converter

Picture of Setup the Connection With the CP2102 USB to Serial Converter

The HM-10 works on 3.3V. The CP2102 USB to Serial converter is an ideal module for communicating with the

CC2541 based HM-10 Bluetooth Smart Transceiver.

Make the following connections using jumper wires :

Pin 1 -> Tx on HM-10 ------------ Rx on CP2102
Pin 2 -> Rx on HM-10 ------------ Tx on CP2102

Pin 12 -> 3.3V on HM-10 ------------ 3.3V on CP2102

Pin 14 -> GND on HM-10 ------------ GND on CP2102

Step 3: Setup the Module As an IBeacon

You can use the serial terminal on the Arduino or any other serial terminal you are comfortable with to communicate with the HM-10. The CC2541 based HM-10 Bluetooth Smart Transceiver is programmed with the AT firmware, which means it can receive certain commands in a predefined format and act accordingly, without requiring any firmware programming.

You can communicate at a baud rate of 9600 with no newline characters set in your Serial Terminal.

You need to run the following set of commands in the serial monitor. After each command you should receive an "Ok" as a response.

AT+RENEW Restores factory defaults
AT+RESET Reboot HM-10 AT Wait for OK
AT+MARJ0x1234 Set iBeacon Major number to 0x1234 (hexadecimal)
AT+MINO0xFA01 Set iBeacon Minor number to 0xFA01 (hexadecimal)
AT+ADVI5 Set advertising interval to 5 (546.25 milliseconds)
AT+NAMEYOURNAME Set HM-10 module name to YOURNAME. Make this unique.
AT+IBEA1 Enable iBeacon mode
AT+RESET Reboot

Step 4: Optimisation

That's it, your CC2541 based HM-10 Bluetooth Smart Transceiver will now behave as an iBeacon.

To minimise power consumption, you can issue the following command :

AT+PWRM0

This command will enable auto-sleep and reduce power consumption from 8 to 0.18 mA. The iBeacon will still keep on transmitting.

AT+ADTY3

The HM-10 is a Bluetooth module and can be used as a transceiver. This command will make the HM-10 non-connectable to save power. This ensures that the communication features are disabled, and also that no client can connect to the module. This helps reduce power consumption further.

AT+DELO2

The HM-10 being a Bluetooth transceiver both broadcasts its presence and scans for other devices. The above command puts the iBeacon in broadcast-only mode to save power.

You can get the firmware to upgrade your iBeacon here :

http://www.jnhuamao.cn/HowToUpgradeFirmware_en.zip

http://www.jnhuamao.cn/rom/HMSoft-10-2541.zip

The datasheet with a complete set of instructions is here : http://www.jnhuamao.cn/bluetooth40_en.zip

Step 5: Verification

You can check if your module is working by getting the iBeacon scanner app on Android here.

You can use that the app to check presence of the iBeacon, your distance from it, the UUID and other attributes of the beacon.

Have fun with your beacons !

Comments

Crusher70 made it! (author)2017-01-04

Hi there,

Great tutorial, nice and clear and easy to follow.

So thank you.

Just a quick note for people who are nervous about soldering and the potential to ruin the board.

The hobbyists best friend "Blu Tak" comes to the rescue. Here is a pic of what I'm trying to describe. Its just a mock up with a board I had in my parts bin.

1. Slightly bend down the pins on some Dupont or tinned cable.

2. Stick board down with Blu Tak.

3. Roll Blu Tak into two sausages one bigger than the other.

4.Place small one next to the board then the other.

I found the contact was better if you don't push too hard into the Blu Tak.

I know its not Brain surgery but if it saves just one person for ruining their board it's worth the post.

Lyubomyr8 (author)2016-09-19

Hello. Great tutorial, thank You!

While HM-10 is an ibeacon, can i still some information with iOS. For instance I would like to send reading from the sensor. Is it possible to do simultaneously with setting HM-10 as ibeacon?

Lyubomyr8 (author)Lyubomyr82016-09-19

I mean when Bluetooth and sensor are connected to Arduino

LOFI Robot (author)2016-06-29

For anyone that might be interested. I just published free iOS and Android app, that lets you control Arduino with gamepad style interface. The app is compatible with the most popular HM-10 BLE to Serial module.

More info:

https://www.instructables.com/id/Controlling-Arduino-Robot-With-IOS-IPhone-IPad-or-/

ovisopa (author)2016-03-27

How long will run on an coin cell with the extra two commands that disable communication to save power ?

PawanvirS (author)2016-03-17

GREAT tutorial

About This Instructable

52,770views

81favorites

License:

More by ankitdaf:Turn your CC2541 based HM-10 Bluetooth Smart Module into an iBeaconGetting Started with the Daflabs ESP8266 ESP-12 Breakout BoardGetting Started with the ESP8266 ESP-12
Add instructable to: