Introduction
I have previously written a review on the HC-05 module and for connecting this module physically, that article can be used for instructions. In many ways the HM-10 is a drop in replacement of the HC-05. But there are some areas where they differ and that’s what I will cover in this follow up review of the HM-10.
There are quite a few different brands and copies of this board out there. To get some help identifying the genuine modules, the creator has posted some images on their website.
My model is a Keyes HM-10 with firmware v549 using Bluetooth 4.0. I paid about €8 per piece.
Setup
When you have hooked the HM-10 up like I explained with the HC-05 you’re ready to set it up using AT commands. One big difference from the HC-05 is that you don’t need to press any buttons on the module at all to enter the command mode. As long as it’s disconnected from other devices, it’s in AT command mode.
If you’re connecting the module via a USB to TTL like the CH340G, set the baud rate to 9600 in the lower right corner. If you are using SoftwareSerial you need to change the sketch. The module default AT command baud rate is 9600 so set that in your sketch like this:
mySerial.begin(9600);
When this is done, choose “No line ending” and type the command: AT
If everything is hooked up correctly, you will get an OK in the output window.
Connecting two modules
Just like in the other review I will explain how you can connect two of these modules, one in master mode and one in slave mode. This will allow you to send data from an Arduino to your PC where you can process the data. The method of connecthing the modules differs quite a lot from a pair of HC-05.
The slave module:
- AT (make sure the device is responding with OK).
- AT+RENEW (reset the device to factory settings).
- AT+PASS123456 (set the pin)
- AT+BAUD0 (set the speed)
- AT+ROLE0 (set the mode to slave)
- AT+NAMEtheslave (set a name)
- AT+RESET (reset the module)
The master module:
- AT (make sure the device is responding with OK).
- AT+RENEW (reset the device to factory settings).
- AT+PASS123456 (set the pin)
- AT+BAUD0 (set the speed)
- AT+ROLE1 (set the mode to master)
- AT+IMME1 (stops the module from auto-connecting)
- AT+DISC? (starts a scan for other devices)
After a little while the output window will show the available Bluetooth devices. The list starts with OK+DISCS which means the discovery has started. Then the devices are listed, numbered starting with OK+DIS0, OK+DIS1 and so on. You should be able to see your slave module in this list with a number and it’s name. Remember the number for the final steps. Finally the list is terminated with OK+DISCE which tells you that the scan has ended.
So to connect to your slave module, enter the following commands:
- AT+CONN0 (replace 0 with the number of your module in the discovery list)
- AT+IMME0 (set the module to auto connect)
- AT+RESET (reset the module)
When the module resets, if all went well they should both show a solid LED light and be connected. You can type some text in the serial console and hit enter to see if it works. The above settings are permanent and you can disconnect either one of them and when you reconnect them both they will automatically pair up again. If you want to issue commands to either one of them, disconnect one and the other will automatically enter AT command mode.
Power consumption
When idle, not connected: 8.5mA. Connected, about 9.5mA. MUCH lower than the HC-05! They also connect back up again in under a second.
Updating the firmware
On genuine models a software update option via the serial port has been available since v508 of the firmware. You can download the instructions (PDF) and firmware here. There has been rumors that the site was at some point infected with malware and is currently blocked by AVG. There is also a git repo with the files here. Basically you put the module in software update mode by issuing the AT command AT+SBLUP and then you use the HMSoft.exe application to update the firmware. It’s very straight forward.
Thoughts
The HM-10 is a nice upgrade if you want lower power consumption for battery driven projects. In my weather station project it connects in about 1 second max which saves precious mAh. The HC-05 spends around 3-4 seconds connecting, and the current draw while doing that is around 35mA.
I don’t like the merged AT command mode that the HM-10 drops into when it’s not connected. You have to be careful not to send data to the module unless you know it’s connected.
I highlighted some of the disadvantages of the HM-10 compared to the HC-05 in my previous article, but in short on some boards the state pin is syncronized with the LED, so when the module is disconnected and the LED blinks, so will the state pin(!). If you want to change this behavior you have to enter the AT command AT+PIO11. The pin and LED will then correctly go solid HIGH, when connected. But when the module is disconnected the LED and pin will both stay LOW.
If you don’t care about the connection time or power consumption you might be able to save a few bucks and get the HC-05 instead.
Datasheet: HM10v550