Go Down

Topic: HM 10 Bluetooth module is not responding to AT commands (with Arduino Uno) (Read 86 times) previous topic - next topic

anikgen

I am quite new to HM-10 modules. So, pardon me if I made any stupid mistakes.

The hardware connections:


(The image is taken from https://circuitdigest.com/microcontroller-projects/how-to-use-arduino-and-hm-10-ble-module-to-control-led-with-android-app. I am using this exact same hardware configuration.)

The sketch:

Code: [Select]

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(2, 3); //RX|TX

void setup(){
  Serial.begin(9600);
  BTSerial.begin(9600); // default baud rate
  while(!Serial); //if it is an Arduino Micro
  Serial.println("AT commands: ");
}

void loop(){
  //read from the HM-10 and print in the Serial
  if(BTSerial.available()) {
    Serial.write(BTSerial.read());
  }
   
  //read from the Serial and print to the HM-10
  if(Serial.available())
    BTSerial.write(Serial.read());
}


After this I use a Serial Bluetooth Terminal Android app to connect to my HM-10 device. Once connected, I try sending AT through my app. According to my understanding, I should get an OK as a response. But, I get nothing. What am I doing wrong?

Your help is highly appreciated.

Nick_Pyner

What am I doing wrong?
Quite a lot, but nothing damaging. These modules have two exclusive modes:
AT mode - by default
Bluetooth Communications mode(i.e. wireless) by initiation.
This means you can only be in AT mode when you are not communicating. Result? you can only send AT modes from Arduino, not your Android app.

anikgen

@Nick_Pyner thanks a lot for the clarification. According to your suggestion, I tried sending AT through the serial monitor of the Arduino IDE. Still nothing.

Nick_Pyner

I believe your wiring is kosher, Rx>Tx and Tx>Rx, but check it just the same.
Make sure you are not in comms mode by accident or by design, i.e. LED not flashing fast.
Make sure you have the right instructions, specifically for HM-10, and note that that little button is redundant.
You might also check the Martyn Currey website, I'm really just a plain old HC-05 person myself.

Go Up