Project tutorial
Hand Gesture Controlled Robot

Hand Gesture Controlled Robot © CC BY-ND

Tired of controlling your robot with a joystick? Ever thought of controlling it with your hands?

  • 71,962 views
  • 81 comments
  • 86 respects

Components and supplies

Apps and online services

About this project

Intro

I wish I could control everything with my hands! Sitting in my chair and controlling things like a BOSS. I'd love it! So I finally came out with a cool DIY hand gesture recognition robot, which can follow the commands made by hand gestures. 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 too, the robot is divided into two parts, transmitter and receiver. The receiver circuit is the same as that of the old post and there is only a slight change in the transmitter circuit, here we need to program the transmitter circuit. So I will be using an Arduino as the programming platform. To recognize the gestures made I will be using an accelerometer sensor. So let’s get building!

Watch the Robot in Action

What is that and how does it work?

What is an Accelerometer (ADXL335)?

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

Almost all smart phones now have accelerometers (even though we are not going to take it from a smart phone). You definitely played motion games in your mobile (e.g Temple run) where 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 smart phone 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 are recognized by a acceleration measuring device called accelerometer (ADXL335).

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 checks the values of coordinates and sends a 4 bit code to the Encoder IC. The Encoder passes the data to RF transmitter and the transmitted data is received by the RF receiver. The receiver sends the 4 bit code to the Decoder IC and the decoder passes it to Motor Driver IC. Later the motor driver makes the decision to turn the two motors in the required direction.

Make the power supply

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

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.

  • IC 7805 which regulates the 12V supply to 5V (if you can't get a 12V supply you can use a 9V supply)
  • 0.1uf and 470uf capacitor
  • 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 usage of heat sink is recommended.

Let’s Start Making  the Transmitter (Remote)

The transmitter section consists of an accelerometer which detects the hand gesture and sends the data to the Arduino. Later Arduino sends data to the Encoder IC in accordance to the data received from accelerometer and the data is transmitted to the receiver. Wire up as per the below circuit:

NOTE : Please, be aware that some accelerometers use 3.3V power supply and might be damaged by 5V. Check the supplier's documentation to find out which is the correct voltage.

This is just an 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

The receiver circuit consists of 2 IC (HT12D decoder, L293D motor driver), RF receiver module.

Wire the circuit as per the above receiver schematic. There are 2 LEDs in the receiver board, one lights up when the power supply is given to the receiver and the other when power supply is given to the transmitter circuit. The LED near the IC HT12D should light up 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 detail about the receiver section please read this article .

What gestures will the robot recognize?

This robot is designed for recognizing five sets of gestures: forward, backward, left, right and stop. You will get a better idea if you check the photos of the gestures given below.

Enjoying driving 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 connections 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 a permanent one. You can check this article to learn how to shrink your Arduino project.

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

Watch this video in which I have transferred the code to Atmega8 MCU. I have only shown the outputs of MCU using LEDs .

Feel free to ask if you have any doubts. I will try my level best in helping you.

Comments

Similar projects you might like

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 11,563 views
  • 41 comments
  • 98 respects

Smartphone Controlled Arduino 4WD Robot Car

Project in progress by Andriy Baranov

  • 53,345 views
  • 43 comments
  • 98 respects

How to Make a Remote Controlled Robotic Hand with Arduino

Project showcase by Gabry295

  • 35,362 views
  • 5 comments
  • 110 respects

Bolt Controlled Robot Car

Project tutorial by Team Bolt

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