Project tutorial
Gesture / Motion Controlled Automatic Appliances

Gesture / Motion Controlled Automatic Appliances © GPL3+

Move your hand around - lights ON. Move hands over that again - lights OFF. Cool, right?

  • 2,098 views
  • 0 comments
  • 12 respects

Components and supplies

Apps and online services

About this project

Watch video for full tutorial

Today we'll be making an automatic system to control appliances by hand gesture or Motion sensing using just Arduino and PIR sensor.

In our project we'll make an Emergency light that light On/off by just moving your hand around it. In another word gesture or wave controlled light system. This can be used as an emergency light - when you reach home it'll automatically switch the lights on.

So our goal is to make a system that switches on once you wave at it, and switches off when you wave it back again.

There's Some issues to keep in mind before you'd work with PIR sensor.

  • PIR doesn't work properly for at least one minute when starts.
  • PIR output value is always 1 for some seconds.
  • It some times doesn't read motions.

To Solve that I've made a simple algorithm that's explained here https://ashrafminhajfb.blogspot.com/2018/10/problems-using-pir-sensor-always-high.html

Circuit Diagram

Circuit is pretty simple, I'm driving some lEDs on but if you want to control home appliances or bigger loads like main light orfanhere's a circuit with relay module.

Make the circuit and it should look something like this

Upload Code to arduino Pro mini 5v 16 mHz

See, Arduino pro mini doesn't have USB programming option. So you may Upload code using a USB to TTL converter. Or you may use an Arduino Uno. We all have an uno right?

So let's upload code using an arduino Uno.

  • Remove The ATmega IC from Uno (using a screwdriver) [be carefull not to harm the IC]
  • Connect Arduino pro mini ------ Uno as following
  • TX to tx
  • Rx to rx
  • Vcc to 5v
  • Gnd to gnd
  • rst to Reset

Then start arduino.ide and go to tools>board> select arduino pro or pro mini

Note: You can just upload code to Arduino pro (5v 16 mHz) mini using UNO not the 3.3v one. Check before you buy one.

Now download the code from herehttps://github.com/ashraf-minhaj/Gesture-or-Motion_controlled_Appliances

Then Upload and

Power it Up

For powering this use 7.4v to 11.4 volts. Although I've said that 5v is okay, its okay as long as loads are limited and you are powering from a 1Amp source.

Power up and- Have fun.

Happy Making!!!!

I didn't explain that much because it's just an easy project. Pretty Interesting and functional though.

Code

Gesture-or-Motion_controlled_Appliances_CodeC/C++
Copy or download from the link
/** Gesture / Motion Controlled Appliance - automatic Light !! **
 * by Ashraf Minhaj. 
 * for any query ashraf_minhaj@yahoo.com
 * Tutorial on http://ashrafminhajfb.blogspot.com
 * my youtube channel https://youtube.com/c/fusebatti
 */

int s = 12;     //PIR outPin on digital 10
int led1 = 4;   //led1 on 4
int led2 = 9;   //led2 on 9

void setup()       // put your setup code here, to run once:
{
 pinMode(s,INPUT);        //Setting Sensor as Input
 pinMode(led1,OUTPUT);  
 pinMode(led2,OUTPUT);    //LED pin as output
 
 Serial.begin(9600);      //initialize Serial Monitor- for debugging(else not mandatory)
}

void loop() 
{
  digitalWrite(led1,LOW);    //By default lights off
  digitalWrite(led2,LOW);
  delay(60000);               //1 minute delay so that the PIR gets enough hot to function
  Serial.println("Start");   //Shows a start message
  
  goto off;           //going to off 
 
ON:                  //the ON statement
{
  Serial.println("ON is running");
  digitalWrite(led1,HIGH);   
  digitalWrite(led2,HIGH);      
  
  
  if((digitalRead(s)))   //if Again sensor input has been read - switch off
  {
    digitalWrite(led1,LOW);    //switch off
    digitalWrite(led2,LOW);      
  
    delay(6500);        //around 7 seconds delay
       /* PIR needs at least 5 seconds to function again*/
    goto off;
  }
  
  else           //Else just Be ON
  { 
    goto ON;
  }
}

off:              //OFF statement
{
  Serial.println("OFF is running");

  digitalWrite(led1,LOW);   
  digitalWrite(led2,LOW);      
  
  if((digitalRead(s)))       //if again sensor input has been read - switch ON
  {
    digitalWrite(led1,HIGH);    //switch on
    digitalWrite(led2,HIGH);    
    delay(6500);           /* PIR needs at least 5 seconds to function again*/
    goto ON;
  }
  
  else        //just be off
  { 
    goto off; 
  }
}

}

Schematics

Gesture-or-Motion_controlled_Appliances-Circuit
Gesture motion controlled emergency light circuit hxoy3krr4s

Comments

Similar projects you might like

Hand Gesture Controlled Robot

Project tutorial by Mayoogh Girish

  • 54,944 views
  • 78 comments
  • 65 respects

Motion Controlled Color Changer!

Project tutorial by Arduino “having11” Guy

  • 9,433 views
  • 17 comments
  • 14 respects

Arduino Motion Controlled Electronics!

Project tutorial by Arduino “having11” Guy

  • 3,788 views
  • 0 comments
  • 14 respects

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 11,564 views
  • 41 comments
  • 98 respects

LED Controlled by 3D Gesture Sensor

Project tutorial by HomeMadeGarbage

  • 5,853 views
  • 0 comments
  • 19 respects

Advance Automatic Railway Crossing System

Project showcase by Pawan singh and Akansh Saxena

  • 1,839 views
  • 1 comment
  • 13 respects
Add projectSign up / Login