Configuring a HM-10 Module

Hello,

I wanted to know if i could configure my HM-10 Module using an Arduino UNO instead of using a CP2102 USB to Serial converter.

Yeah, you can do that. The first thing to do is upload a bare minimum sketch to the Uno so that it won’t interfere with the serial communication between the computer and the HM-10:

  • File > New
  • Sketch > Upload

Now you need to connect your HM-10 to the Uno with the connections RX-RX, TX-TX. This seems backwards of what it should be, but it’s actually not. The reason is that the RX and TX markings on your Uno are referring to its primary ATmega328P microcontroller but you’re not even using that microcontroller for this task. Instead, you are communicating between the HM-10 and the USB to TTL serial adapter chip on the Uno. Since the USB to TTL serial adapter chip on the Uno is connected to the ATmega328P RX-TX/TX-RX, you are actually making an RX-TX/TX-RX connection between the HM-10 and the USB to TTL serial adapter chip.

After that, you can open Tools > Serial Monitor and send commands to the HM-10 through the Uno.

Thank you very much M. Pert.

I was just worried about messing things up since the TX command in the Arduino is 5V while the RX command in the HM-10 is only 3.3V. so is there any risk ?

Yes. You must make sure not to subject the RX pin of the HM-10 to 5 V from the Uno, otherwise you could damage the HM-10. You will need to use a level shifter or voltage divider to reduce the voltage to a safe level.

so the wiring i did (HM-10 ----> Arduino )

VCC ----> 3.3V
GND ----> GND
TX ----> Pin 10
RX ----> Pin 11

i have a problem when i launch the serial monitor, when i add an AT command, nothing appears. Can u tell where the problem comes from ?

If you haven't used a level converter then you will have put 5V into the HM10, which is bad. You also haven't used the correct Arduino pins. Pins 0 and 1 are the serial pins.

I did exactly what you said, but still,i cant get a response when i use the AT commands. It's really frustrating .. where do you think is the problem ?

and should i write some sketch or code ?

I think the problem is that you've subjected the HM-10 to 5V signals from the Uno and damaged it.

but on the HM its written : 3.6V - 6V

YassineChouh:
but on the HM its written : 3.6V - 6V

YassineChouh:
I was just worried about messing things up since the TX command in the Arduino is 5V while the RX command in the HM-10 is only 3.3V. so is there any risk ?

I'm only going from what you've already said. Some HM-10 modules have a built-in voltage regulator and level shifters, can you post a link to the exact HM-10 that you bought?

the module i use : http://shoppingmaroc.net/modules-de-communication/847-module-bluetooth-40-at-09-hm-10-cc2541-serie-android-ios.html?search_query=bluetooth+4*&results=11

well what i want to do is make my HM10 act as a Beacon. i mean this is my project.

That website is pretty short on information, but Google knows about the ZS-040 baseboard that you're using.
First off- you may actually be dealing with a different module, not a HM-10. See here for details.
Looking at that unit I'd say that it has on onboard regulator for the power (which takes 3.6-6V) but no level shifting for the RX and TX pins. I wouldn't be surprised if you've damaged it by connecting it straight to the Mega.
This is a useful guide I found for turning the HM-10 into an iBeacon.

YassineChouh:
so the wiring i did (HM-10 ----> Arduino )

VCC ----> 3.3V
GND ----> GND
TX ----> Pin 10
RX ----> Pin 11

i have a problem when i launch the serial monitor, when i add an AT command, nothing appears. Can u tell where the problem comes from ?

My instructions were assuming you were going to connect the HM-10 to pins 0 and 1 on the Uno. If you want to connect it to pins 10 and 11, you need to have a software serial passthrough sketch running on the Uno, which must be set to communicate with the HM-10 at the correct baud rate.

ok. thank you very much

You may also want to check that you have the correct baud rate on the serial monitor or it won't work.