HB100 gesture control project

Thread Starter

visionofast

Joined Oct 17, 2018
71
Hi,
I saw this useful description about HB100 module in AAC website.
I'm about to design a project to detect gesture or movement of my hand in order to control devices around my work room using an arduino.
as an example, If I shaked my hand for 3 times with normal speed,it turns the light of the room...and if i did it for 4 times it turns on AC on the wall.
and i think, it could be exapnded by combination of "shaking speed" and "number of shaking" to define as many command as I want.
so,do you think it's possible by this module and an arduino to process this amount of data in a fair speed?
and would the preamp circuit with LM324 used in manual work well for that?
BTW: there are already two libraries suggested for this module FreqMeasure and FreqPeriod, that i doubt which one is better this project.:rolleyes:
 

Sensacell

Joined Jun 19, 2012
2,587
Before you get too excited...

Buy one of those units, hook it up and watch the output on a scope.
I have a feeling the signal will be minute, ambiguous and buried in noise for the kind of gestures you are proposing.
If it was that easy, we'd all be gesturing our way through life.

If you cannot get a clean and unambiguous signal, no amount of clever coding is going to do much good.
 

Thread Starter

visionofast

Joined Oct 17, 2018
71
@Sensacell

as for noise issue, i think a low noise opamp or a hard-limiter circuit would put the module into work without problem.
I attached a circuit that may do the trick,but since i have no scope and the mentioned low noise opamp,i can't test it for the instance.

@DNA Robotics


I'm looking for a wireless gesture detector indeed.I think the project you have linked is wired with gloves and stuffs :/
by the way that ,I don't need necessarily detect small gestures or movements, just recognizeing any kind of pattern in movement by hand would suffice.

 

Attachments

Sensacell

Joined Jun 19, 2012
2,587
@Sensacell

as for noise issue, i think a low noise opamp or a hard-limiter circuit would put the module into work without problem.
I attached a circuit that may do the trick,but since i have no scope and the mentioned low noise opamp,i can't test it for the instance.

@DNA Robotics


I'm looking for a wireless gesture detector indeed.I think the project you have linked is wired with gloves and stuffs :/
by the way that ,I don't need necessarily detect small gestures or movements, just recognizeing any kind of pattern in movement by hand would suffice.

The low noise opamp does nothing if the signal itself is not inherently unambiguous- you are making a lot of assumptions about an unknown signal- test it!
 

Thread Starter

visionofast

Joined Oct 17, 2018
71
finally got access to a measuring device to see what happens with default amplifier in datasheet,
the Amp circuit works more acceptable than expected, just added a 100nf cap in serial with output, to remove DC component.
and...by using AnalogFrequency library ,I could have toggled a led on Arduino Uno by shaking hand with the speed of higher than 100hz frequency shift in signal.
anyway, arduino looks slow to define more complex gestures as command.
measurements of normal and idle signal attached.
 

Attachments

Thread Starter

visionofast

Joined Oct 17, 2018
71
here's the code I had written for SR04 ultrasound module for a Parking door opener with shaking my hand before.
this code waits until your hand gets near to SR0F module (in less than 5cm),and then starts capturing the distance of your Hand to Module for 5secs (for more distances than 5cm).
if you shake your hand with enough Variance ,it sends a signal to open/close parking's door via a ASK DX-RF module.
so, maybe someone interested to advance it with a better algoritm or HB100 module to detect number of Hand-Shaking as more desired command.

Code:
#include <Statistics.h>
#include <HCSR04.h>
#include <TimerOne.h>
#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();
HCSR04 hc(5,6);//initialisation class HCSR04 (trig pin , echo pin)
Statistics stats(20);
int ledPin = 13;
void setup()
{
  mySwitch.enableTransmit(10);
// Serial.begin(9600);
  pinMode(ledPin, OUTPUT);
  Timer1.attachInterrupt(callback);
  Timer1.stop();
}

void callback()
{
//  Serial.print("Distance: ");
//Serial.println( hc.dist() );
//  Serial.print("Mean: ");
//  Serial.println(stats.mean());
//  Serial.print(" Std Dev: ");
//  Serial.println(stats.stdDeviation());
//  Serial.print(" Variance: ");
//  Serial.println(stats.variance());
if (stats.stdDeviation()>15)
{
// Serial.println(" passed... ");

  mySwitch.send(000000, 24); //replace 000000 with your Parking door's code
  delay(1000);
  mySwitch.send(000000, 24); //replace 000000 with your Parking door's code
  delay(1000);
}

  Timer1.stop();
}
void loop()
{
int data = hc.dist();
  stats.addData(data);
if ( hc.dist() <5)
{
  Timer1.initialize(5000000);


  for (int i = 0; i <= 5; i++)
{
  digitalWrite(ledPin, !digitalRead(ledPin));
  delay(100);
}
//Serial.println("start capturing... ");

}

/*Serial.println( hc.dist() );
  Serial.print("Mean: ");
  Serial.print(stats.mean());
  Serial.print(" Std Dev: ");
  Serial.println(stats.stdDeviation());
  Serial.print(" Variance: ");
  Serial.println(stats.variance());
  delay(100);
  delay(50);
  if (stats.stdDeviation()>300)
  {
  digitalWrite(ledPin, !digitalRead(ledPin));
  } */
}
 
Top