HM-10 Setup for prop control

I am using an HM-10 for the first time I purchased from DSD TECH. I am going to use this module to control halloween decorations from a central server build on a Raspberry Pi.

Does anybody have any good tutorials on using the DSD TECH HM-10 with an arduino? I am writing the test code on an UNO, but will be migrating to a Nano for implementation.
So far the only application that I have been able to make work is the demo application. WIndows is unable to see the HM-10 when I scan for bluetooth, and any AT commands seem to require a reboot of the chip. I would like to be able to set the AT commands in the setup() function.

Any help would be appreciated.

What's a HM-10? No problem to find out if You supply a link to its datasheet.

1 Like

What does the demo application do?

Post it here, use the <CODE/> button in the message composition window toolbar.

a7

I do not think an arduino will control a Hummer model 10. Post a link to technical information on your Hummer, I got over a hundred hits. My neighbor tells me it is a model that did not make production and to ask how you got it.

100 people have posed in these forums about the HM-10 bluetooth module without starky asinine comments and posting links.

Here is a simple google search for an hm-10.. No hummers are returned.

https://www.google.com/search?q=hm-10&rlz=1C1GCEB_enUS1047US1047&oq=hm-10&gs_lcrp=EgZjaHJvbWUqDAgAEAAYQxjjAhiKBTIMCAAQABhDGOMCGIoFMgwIARAuGEMY5QQYigUyBggCEEUYOzIGCAMQRRg7MgYIBBBFGDsyBggFEEUYPDIGCAYQRRg8MgYIBxBFGDzSAQgzMTM1ajBqNKgCALACAA&sourceid=chrome&ie=UTF-8

Oh look, here is a link right to arduino.cc

Holy shit!

Good to know arduino users have become children instead of helpful developers.

And since you have been utterly helpful here is the sample application they provide to begin using it.

#include <SoftwareSerial.h>

SoftwareSerial HM10(2, 3); // RX = 2, TX = 3

char appData;

String inData = "";

void setup()

{

Serial.begin(9600);

Serial.println("HM10 serial started at 9600");

HM10.begin(9600); // set HM10 serial at 9600 baud rate

pinMode(13, OUTPUT); // onboard LED

digitalWrite(13, LOW); // switch OFF LED

}

void loop()

{

HM10.listen(); // listen the HM10 port

while (HM10.available() > 0) { // if HM10 sends something then read

appData = HM10.read();

inData = String(appData);  // save the data in string format

Serial.write(appData);

}

if (Serial.available()) { // Read user input if available.

delay(10);

HM10.write(Serial.read());

}

if ( inData == "F") {

Serial.println("LED OFF");

digitalWrite(13, LOW); // switch OFF LED

delay(500);

}

if ( inData == "N") {

Serial.println("LED ON");

digitalWrite(13, HIGH); // switch OFF LED

delay(500);

digitalWrite(13, LOW); // switch OFF LED

delay(500);

}

}

I saw the post but they stated what it was and posted there code following forum guidelines which you might want to look over again. There are many things with the same or similar description when number and letters are used, that is why we ask for links. Good Luck!

There is a difference between saying, "Can you post a link to the hardware" and being an ass hat about things.

You mean this code?

# include <SoftwareSerial.h>

SoftwareSerial HM10(2, 3); // RX = 2, TX = 3

char appData;
String inData = "";

void setup()
{
  Serial.begin(9600);
  Serial.println("HM10 serial started at 9600");
  HM10.begin(9600); // set HM10 serial at 9600 baud rate
  pinMode(13, OUTPUT); // onboard LED
  digitalWrite(13, LOW); // switch OFF LED
}

void loop()
{
  HM10.listen(); // listen the HM10 port
  
  while (HM10.available() > 0) { // if HM10 sends something then read
    appData = HM10.read();
    inData = String(appData);  // save the data in string format
    Serial.write(appData);
  }
  
  if (Serial.available()) { // Read user input if available.
    delay(10);
    HM10.write(Serial.read());
  }
  
  if ( inData == "F") {
    Serial.println("LED OFF");
    digitalWrite(13, LOW); // switch OFF LED
    delay(500);
  }
  
  if ( inData == "N") {
    Serial.println("LED ON");
    digitalWrite(13, HIGH); // switch OFF LED
    delay(500);
    digitalWrite(13, LOW); // switch OFF LED
    delay(500);
  }
}

a7

Yes, that is the demo code.

That is all normal. HM-10 is a BLE device and is in AT mode by default on start up. You can thereby send AT commands in setup until you send a standard serial command. Any further AT commands after that require a reboot.
I believe you should see it OK in windows, but you don't need to pair with it. You may need a proper BLE terminal programme. Check the Martyn Currey website.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.