Hand Gesture Controlled Robot using Arduino

Hand Gesture Controlled Robot using Arduino

  • 2016-09-07
  • 1305

Robots are playing an important role in automation across all the sectors like construction, military, medical, manufacturing, etc. After making some basic robots like line follower robot, computer controlled robot, etc, we have developed this accelerometer based gesture controlled robot by using arduino uno. In this project we have used hand motion to drive the robot. For this purpose we have used accelerometer which works on acceleration.

Required Components

  1. Arduino UNO
  2. DC Motors
  3. Accelerometer
  4. HT12D
  5. HT12E
  6. RF Pair
  7. Motor Driver L293D
  8. 9 Volt Battery
  9. Battery Connector
  10. USB cable
  11. Robot Chasis

RF Pair:

RF Pair

A gesture controlled robot is controlled by using hand in place of any other method like buttons or joystick. Here one only needs to move hand to control the robot. A transmitting device is used in your hand which contains RF Transmitter and accelero-meter. This will transmit command to robot so that it can do the required task like moving forward, reverse, turning left, turning right and stop. All these tasks will be performed by using hand gesture.

Here the most important component is accelerometer. Accelerometer is a 3 axis acceleration measurement device with ±3g range. This device is made by using polysilicon surface sensor and signal conditioning circuit to measure acceleration. The output of this device is Analog in nature and proportional to the acceleration. This device measures the static acceleration of gravity when we tilt it. And gives an result in form of motion or vibration.

According to the datasheet of adxl335 polysilicon surface-micromachined structure placed on top of silicon wafer. Polysilicon springs suspend the structure over the surface of the wafer and provide a resistance against acceleration forces. Deflection of the structure is measured using a differential capacitor which incorporate independent fixed plates and plates attached to the moving mass. The fixed plates are driven by 180° out-of-phase square waves. Acceleration deflects the moving mass and unbalances the differential capacitor resulting in a sensor output whose amplitude is proportional to acceleration. Phase-sensitive demodulation techniques are then used to determine the magnitude and direction of the acceleration.

Accelerometer

Pin Description of accelerometer

  1. Vcc        5 volt supply should connect at this pin.
  2. X-OUT  This pin gives an Analog output in x direction
  3. Y-OUT  This pin give an Analog Output in y direction
  4. Z-OUT   This pin gives an Analog Output in z direction
  5. GND      Ground
  6. ST          This pin used for set sensitivity of sensor

Circuit Diagram and Explanation

Gesture Controlled Robot is divided into two sections:

  1. Transmitter part
  2. Receiver part

In transmitter part an accelerometer and a RF transmitter unit is used. As we have already discussed that accelerometer gives an analog output so here we need to convert this analog data in to digital. For this purpose we have used 4 channel comparator circuit in place of any ADC. By setting reference voltage we gets a digital signal and then apply this signal to HT12E encoder to encode data or converting it into serial form and then send this data by using RF transmitter into the environment.

At the receiver end we have used RF receiver to receive data and then applied to HT12D decoder. This decoder IC converts received serial data to parallel and then read by using arduino. According to received data we drive robot by using two DC motor in forward, reverse, left, right and stop direction.

Working

Gesture controlled robot moves according to hand movement as we place transmitter in our hand. When we tilt hand in front side, robot start to moving forward and continues moving forward until next command is given.

When we tilt hand in backward side, robot change its state and start moving in backwards direction until other command is given.

When we tilt it in left side Robot get turn left till next command.

When we tilt hand in right side robot turned to right.

And for stopping robot we keeps hand in stable.

Gesture Controlled Robot transmitter part

Gesture Controlled Robot transmitter part

Circuit Diagram for Transmitter Section

[Hand Gesture Controlled Robot Circuit Diagram using Arduino

Circuit Diagram for Receiver Section

Circuit for this hand gesture controlled robot is quite simple. As shown in above schematic diagrams, a RF pair is used for communication and connected with arduino. Motor driver is connected to arduino to run the robot. Motor driver’s input pin 2, 7, 10 and 15 is connected to arduino digital pin number 6, 5, 4 and 3 respectively. Here we have used two DC motors to drive robot in which one motor is connected at output pin of motor driver 3 and 6 and another motor is connected at 11 and 14. A 9 volt Battery is also used to power the motor driver for driving motors.

Program Explanation

In program first of all we have defined output pins for motors.

define

And then in setup we have given the directions to pin.

directions

After this we read input by using ‘if statement’ and perform relative operation.

reading and programming

There are total five conditions for this Gesture controlled Robot which are giving below:

We have writen the complete program according to the above table conditions. Below is the complete code.

#define FD 16
#define BD 17
#define LD 18
#define RD 19

#define m11 3
#define m12 4
#define m21 5
#define m22 6

void forward()
{
   digitalWrite(m11, HIGH);
   digitalWrite(m12, LOW);
   digitalWrite(m21, HIGH);
   digitalWrite(m22, LOW);
}

void backward()
{
   digitalWrite(m11, LOW);
   digitalWrite(m12, HIGH);
   digitalWrite(m21, LOW);
   digitalWrite(m22, HIGH); 
}

void left()
{
   digitalWrite(m11, HIGH);
   digitalWrite(m12, LOW);
   digitalWrite(m21, LOW);
   digitalWrite(m22, LOW);
}

void right()
{
   digitalWrite(m11, LOW);
   digitalWrite(m12, LOW);
   digitalWrite(m21, HIGH);
   digitalWrite(m22, LOW);
}

void Stop()
{
   digitalWrite(m11, LOW);
   digitalWrite(m12, LOW);
   digitalWrite(m21, LOW);
   digitalWrite(m22, LOW);
}

void setup() 
{
  pinMode(FD, INPUT);
  pinMode(BD, INPUT);
  pinMode(LD, INPUT);
  pinMode(RD, INPUT);

  pinMode(m11, OUTPUT);
  pinMode(m12, OUTPUT);
  pinMode(m21, OUTPUT);
  pinMode(m22, OUTPUT);
}

void loop() 
{

  int temp1=digitalRead(FD);
  int temp2=digitalRead(BD);
  int temp3=digitalRead(LD);
  int temp4=digitalRead(RD);
 
  if(temp1==1 && temp2==0 && temp3==0 && temp4==0)
  backward();

  else if(temp1==0 && temp2==1 && temp3==0 && temp4==0)
  forward();

  else if(temp1==0 && temp2==0 && temp3==1 && temp4==0)
  left();

  else if(temp1==0 && temp2==0 && temp3==0 && temp4==1)
  right();

  else
  Stop();
}

Suggest

Arduino Fun: Make a high-tech remote controlled car

The Player Control with Playstation and Arduino - VR

Arduino Step by Step: Your complete guide

Crazy about Arduino: Your End-to-End Workshop - Level 1

Arduino Based Obstacle Avoiding and Maze Solving Robot