Hand gesture controled robot

Gesture recognition robot

Tired of controlling your robot with joystick ? Ever thought of controlling it with your hands.Wished I could control everything with my hands šŸ˜€ .Sitting in chair and controlling things like a BOSS šŸ˜€ . I loved it.So I finally came out with a cool DIY hand gesture recognition robot, which can follows the commands shown by hand. Sounds crazy butĀ I promise it’s very simple.
Making a gesture control robot is actually very simple. This robot is Ā a improvement of my another DIY projectĀ RC car using RFĀ module

Here also the robot is divided into two session, Transmitter and Receiver.The Receiver circuit is same as that of the old post and there is a slight change in the transmitter circuit ,here we need to program the transmitter circuit.So IĀ will be using a arduino as the programming platform to recognise the gestures made by hand i will be using a accelerometer sensor .So let’s building šŸ™‚

Stuff you needĀ 

 

Watch the Robot in Action

What is that and how does it work ?

What is a Accelerometer (ADXL335)?

DXL335 Accelerometer
ADXL335 Accelerometer

In brief an accelerometer is aĀ three-axis acceleration measuring device.The accelerometer used here is ADXL335 it has 3 axis (X Y Z).

The accelerometer is now there in almost all smartphones (We are not going to take it from a smartphone šŸ˜‰ Ā )You might definitely played motion games in your mobile (Eg Temple run) the character in the game moves left and right when you tilt your phone left and right respectively it is done by the accelerometer.

There is Ā another sensor called Gyroscope found in smartphone which we don’t Ā need now

 

How does it work and recognize the gestures ?

Here the brain of the robot is arduino uno(Atmega32) it is fed with some set of code.
The gestures/motion made by hand is recognised by aĀ acceleration measuring deviceĀ called accelerometer (ADXL335)

Gesture controled robot flow chartWorking

Here the Accelerometer reads the X Y Z coordinates when we make gestures by handĀ and send the X Y Z coordinates to the arduino (Here we don’t need the Z axis we need only two coordinated X and Y So neglect the Z coordinate) The arduino check the values of coordinates send a 4bit data to the Encoder IC accordance to the data received from the accelerometer.TheĀ Encoder passes the data to RF Transmitter and the transmitted data is received by the RF Receiver, The receiver sends the 4bit data to Decoder IC and the decodes it passes to Motor Driver IC,Later the motor driver make decision to turn the two motor in required direction

Make the power supply

First we will start with the power supply circuit. We need two power supply circuit one for the transmitter and one for receiver.The receiver circuit need to powered using 12v supply(Since I’am using a 12V motor) and transmitter circuit can be powered using 9v battery
Power supply

You can see the circuit for the receiver power supply on the right. Using this diagram, wire up the supply circuit. You can also add an LED via a 1k resistor to indicate the state of power supply.
voltage-regulator-7805-5v

  • IC 7805 which regulates the 12v supply to 5v (if cant get a 12v supply you can use a 9v supply)
  • 0.1uf & 470uf capacitor
  • And 1k resistor for status led

NOTE: Use heat sink for 7805 because we are dropping 7v (12-5 )so lots of heat will be produced to burn the regulator so use heat sink is recommended

Let’s Start Making Ā the Transmitter (Remote)

The receiver session consist of Ā accelerometer which detects the gesture made by hand sends the data to the arduino, Later arduino send data to the Encoder IC accordance to the data received from accelerometer and the data Ā is transmitted to the receiver

Wire up as per below circuit


tx circuit_schem

Illustration
This is just a illustrationĀ of the transmitter

Upload Code to Arduino

/*
* Gesture Recognition Robot - Avishkar
* Coder - Mayoogh Girish
* Website - http://bit.do/Avishkar
* This program lets you to control your robot with gesture made by your hand
*/

int GNDPin=A4; //Set Analog pin 4 as GND
int VccPin=A5; //Set Analog pin 5 as VCC
int xPin=A3; //X axis input
int yPin=A2; //Y axis input
int zPin=A1; //Z axis input(not used)
int Q1=10,Q2=11,Q3=12,Q4=13; //Output pins to be connected to 10, 11, 12, 13 of Decoder IC

long x; //Variabe for storing X coordinates
long y; //Variabe for storing Y coordinates
long z; //Variabe for storing Z coordinates

void setup()
{
  Serial.begin(9600);
  pinMode(Q1,OUTPUT);
  pinMode(Q2,OUTPUT);
  pinMode(Q3,OUTPUT);
  pinMode(Q4,OUTPUT);
  pinMode(GNDPin, OUTPUT);
  pinMode(VccPin, OUTPUT);
  digitalWrite(GNDPin, LOW); //Set A4 pin LOW
  digitalWrite(VccPin, HIGH); //Set A5 pin HIGH
}

void loop()
{
  x = analogRead(xPin); //Reads X coordinates
  y = analogRead(yPin); //Reads Y coordinates
  z = analogRead(zPin); //Reads Z coordinates (Not Used)

    if(x<340)      // Change the value for adjusting sensitivity  
      forward();
    else if(x>400) // Change the value for adjusting sensitivity
      backward();
    else if(y>400) // Change the value for adjusting sensitivity
      right();
    else if(y<340) // Change the value for adjusting sensitivity
      left();
    else
      stop_();
}

void stop_()
{
  Serial.println("");
  Serial.println("STOP");
  digitalWrite(Q1,LOW);
  digitalWrite(Q2,LOW);
  digitalWrite(Q3,LOW);
  digitalWrite(Q4,LOW);
}

void forward()
{
  Serial.println("");
  Serial.println("Forward");
  digitalWrite(Q1,HIGH);
  digitalWrite(Q2,LOW);
  digitalWrite(Q3,HIGH);
  digitalWrite(Q4,LOW);
}

void backward()
{
  Serial.println("");
  Serial.println("Backward");
  digitalWrite(Q1,LOW);
  digitalWrite(Q2,HIGH);
  digitalWrite(Q3,LOW);
  digitalWrite(Q4,HIGH);
}

void left()
{
  Serial.println("");
  Serial.println("Left");
  digitalWrite(Q1,LOW);
  digitalWrite(Q2,HIGH);
  digitalWrite(Q3,HIGH);
  digitalWrite(Q4,LOW);
}

void right()
{
  Serial.println("");
  Serial.println("Right");
  digitalWrite(Q1,HIGH);
  digitalWrite(Q2,LOW);
  digitalWrite(Q3,LOW);
  digitalWrite(Q4,HIGH);
}

Make the Receiver
UPLOAD RF RX TX (1)

The receiver circuit consist of 2 IC(HT12D decoder , L293D motor driver),RF receiver module
Wire the circuit as per the above receiver schematic. There is 2 led in the receiver board ,one lights up when power supply is given to the receiver and the other when power supply is given to transmitter circuit the led near the IC HT12D should lit and this provides you a valid transmission(VT) when power is given at the transmitter if not there is something wrong with your connection or your RF TX RX module

If you want to know more in details about the Ā receiver session please read this article

What all gesture will robot recognise Ā ?

This robot is designed for recognising five set of gesture. Forward , backward, left, right and stop.
You will get a better ideas if check the photos of gestures given below


Enjoying riding your robot šŸ˜€

 

Shrink it and Make it Permanent

Arduino uno will be large andĀ bulky on your hand . And if you are deciding to make another project using arduinoĀ you will need to remove the arduino and all connection made on it. and you will loose your old work šŸ˜¦
I don’t like doing that, so i came out with a solution to make it permanent one šŸ˜€
You can check this article to learn how to shrink your arduino project

standalone_pcb

Download the PCB layout for standalone version from hereĀ (mirror)

Watch this video in which i have transfer the Ā code to atmega8 MCU
I have only shown the outputs of MCU using LEDs .

Feel free to ask any doubt I will try my level best in helping Ā šŸ˜€

Advertisements

11 Comments Add yours

  1. AmashaDas says:

    cool and impressive šŸ™‚ would need some help with stuffs though …..thanks BTW

    Like

  2. Ateef Ansari says:

    I would require help, with pcb part of the project.
    Your work is good and inspiring.
    Need help for doing this project, can i get your email for askin further queries directly.

    Like

    1. Thanks for showing interest in my work.
      mayoogh1997@gmail.com

      Like

  3. Nikhil says:

    good project bro!
    sent you an email regarding my queries

    Like

  4. Sudipta kar says:

    where is receiver arduino code??

    Like

    1. There is no coding required for receiver part

      Like

  5. sanjith says:

    I would require help, with pcb part of the project.
    Your work is good and inspiring.
    Need help for doing this project, can i get your email for askin further queries

    Like

  6. Chetan says:

    Need your help,in power supply diagram you’ve mentioned 100uf and 10uf capacitors,but below you’ve written 0.1uf & 470uf capacitor.

    which to use??

    Like

  7. vishvajeet says:

    In receiver circuit why you had used HT12E instead of HT12D

    Like

    1. Sorry for the inconvenience,
      In receiver circuit it is Ht12d

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s