Comparing the HM10 and BLE CC41a Bluetooth 


These units will not connect to an HC05/HC06 and although it was visible to my Samsung Galaxy 5 it would not connect.

The HM10 has a crystal fitted, shown as a silver rectangle in the picture above, alongside the bottom four solder connections on the picture right. The CC41A does not have this crystal.

Download the Sketch from my GitHub here.

I saw a pair of HM 10 Bluetooth boards on eBay for less than £6 and purchased them. I wanted to try using Bluetooth 4 and to also use them as iBeacons. They arrived from Hong Kong in less than two weeks and I set about trying to get them to work. I used a simple sketch (shown below) that I use to set up HC05 Bluetooth boards. However, I just could not get them to work, I could see them on my Android phone but the would not connect. The units would not respond to AT being sent, I had set up the Serial Monitor to 9600 Baud and no Carriage Return or Line Feed.

Eventually I turned on NL/CR and sending AT gave the response OK. As I worked my way through the instruction set I found that not all seemed to work. The answer was that I had a BLE CC41A Bluetooth board which is a clone of the HM10. This Bluetooth requires LF/CR to be sent after a command, the default baud rate is 9600, the same as the HM10.

Other differences are that the commands can be in either uppercase or lowercase and the ? is not used, so to report the Baud rate AT+BAUD is used instead of AT+BAUD? The BLE CC41A has a limited command set and not all the HM10 commands are available. Typing in AT+HELP will print out a list of commands.

By default the CC41A is set as a Slave (ROLE=0) and the Baud Rate is 9600. It can be returned to this state at anytime by sending AT+RENEW and once OK has been received send AT+RESET. 

To set the CC41A as a Master, first reset to factory settings as shown above, although this is not strictly necessary at least you know where you are starting from, then send AT+INQ and wait for a reply. The CC41A will report any Slave units it can find, giving each Slave a number. To connect to a Slave send AT+CONNn, where n is the number for the Slave. With just one other Bluetooth available this would be AT+CONN1. The units pair almost immediately with the LEDs on both units changing from flashing to solid. Unfortunately, unlike the HC05, the Cc41A has to be connected each time to the Slave, when power is removed.

The HM10 and CC41A are 3 volt devices, but because the power requirements are low it can be powered from the Arduino 3 volt pin. Use a Bi Directional Logic Level Converter, like this one here. I use Software Serial using pin 2 for Rx and pin 3 for Tx, remember the Arduino Rx is connected to the Bluetooth Tx and the Arduino Tx (pin 3) is connected to the Bluetooth Rx.

Upload the sketch below to both the Master and the Slave and leave the Slave running. Un Rem the lines on the Sketch on the Master Arduino and upload the modified Sketch, once it uploads switch the Serial Monitor on. After 20 seconds or so the Master should connect and the LEDs should remain lit.

/***********************************************************

BLE CC41A Bluetooth Master setup sketch
This is a clone of the HM10 BLE board
In the Serial Monitor ensure that 'Both NL and CR' is selected
Select a Baud Rate of 9600
enter the following commands into the MASTER unit
AT - should return OK
AT+RENEW - restores to factory settings
AT+RESET - software reset
AT+ROLE1 - sets to Master
AT+INQ - searches for nearby Slave units
AT+CONN1 - connects to Slave Unit 1
************************************************************/
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(2, 3); // RX, TX
void setup()
{
// Start the hardware serial port
Serial.begin(9600);
pinMode(13, OUTPUT); // onboard LED
digitalWrite(13, LOW); // switch OFF LED
bluetooth.begin(9600);
// un REM this to set up a Master and connect to a Slave
/*
Serial.println("BLE CC41A Bluetooth");
Serial.println("----------------------------------");
Serial.println("");
Serial.println("Trying to connect to Slave Bluetooth");
delay(1000);
bluetooth.println("AT"); // just a check
delay(2000);
bluetooth.println("AT+ROLE1"); // st up as Master
delay(2000);
bluetooth.println("AT+INQ"); // look for nearby Slave
delay(5000);
bluetooth.println("AT+CONN1"); // connect to it
*/
}
void loop()
{
bluetooth.listen();
// while there is data coming in, read it
// and send to the hardware serial port:
while (bluetooth.available() > 0) {
char inByte = bluetooth.read();
Serial.write(inByte);
}
// Read user input if available.
if (Serial.available()){
delay(10); // The DELAY!
bluetooth.write(Serial.read());
}
}