Accelerometer Based Hand Gesture Controlled Robot using Arduino

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 Circuit Diagram

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:

Movement of hand

Input for Arduino from gesture

 

 

 

Side

D3

D2

D1

D0

Direction

Stable

0

0

0

0

Stop

Tilt right

0

0

0

1

Turn Right

Tilt left

0

0

1

0

Turn Left

Tilt back

1

0

0

0

Backward

Tilt front

0

1

0

0

Forward

 

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

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();
}

Video: 

Comments (77)

  • pcbway's picture
    pcbway

    Hello, I'm a technical staff of PCBWay.
    I see your side also useful to PCB board
    In order to refuse industry profits, to break the bottom line of the price again I recommend to you our factory PCBWay:
    Online submission of files, acceptance quickly with no issues.
    Detailed tracking of the manufacturing process on the website, you can follow online and see what the lead time is. we are happy with the great finished PCBs. And a good price

    too!
    Fast manufacturing and fast DHL international shipping.

    Jul 30, 2015
  • vikram's picture
    vikram

    Can you please tell me the range of the RF ? I mean for what distance can I use this RF ? Are there ant better ways to transmit the commands ?

    Jan 21, 2016
  • Jayesh's picture
    Jayesh

    can you please tell me which rf pair should i use? Also can i use atmega8 instead of Arduino UNO?

    Jan 29, 2016
  • Jayant's picture
    Jayant

    @Vikram @Jayesh This is ASK RF module Wireless Transmitter & Receiver Pair - 433MHz. It has apporx 100 meter range when operated at max supply voltage (12v). Check its more detail (with images) in this project: RF controlled Robot

    Feb 23, 2016
  • rupinder's picture
    rupinder

    what is the meaning of temp and fd in programming

    Sep 12, 2016
  • charankumar 's picture
    charankumar

    I like this project but i dont know how to give program to the robot

    Feb 16, 2016
  • mohanroyal's picture
    mohanroyal

    Nice approach

    Feb 26, 2016
  • mohanroyal's picture
    mohanroyal

    Can we use transmitting ckt with out cmos

    Feb 26, 2016
  • vipin 's picture
    vipin

    What is value of variable resistor set for transmitter circuit?

    Mar 02, 2016
  • saddam khan's picture
    saddam khan

    you can you 10K.

    Mar 03, 2016
  • abrar's picture
    abrar

    Please give me PCB layout of this circuit

    Mar 03, 2016
  • Saifulla Shariff's picture
    Saifulla Shariff

    Good one !

    Mar 21, 2016
  • shubham's picture
    shubham

    Hey friend!! Firstly i would like to thank u for uploading this project.
    I am also making the same project as urs using the same diagram and code and everything but i am not able to successfully run it.Pls help me asap as i hv to submit my project in 3-4 days.
    I have used same connection and the led on receiver is also glowing but i am not able to figure out the problem as motors r not running.

    Mar 25, 2016
  • Abhishek's picture
    Abhishek

    The information is not sufficient, without looking into your code and circuit, we cant help.

    Mar 29, 2016
  • Megashree R's picture
    Megashree R

    Can I use the same code to drive stepper motors?

    Mar 28, 2016
  • Anonymous's picture
    Anonymous

    Can you please send me a pic of transmitter module?

    Apr 04, 2016
  • Gokul's picture
    Gokul

    I'm new to this rf things...can u explain to me the use of Use of encoder nd decoders

    Mar 29, 2016
  • Megashree R's picture
    Megashree R

    Hello,
    I built a transmitter module on a bread board and it looks really clumsy because of too many connecting wires and potentiometers. It's too large for a hand palm. However, in the video that you have uploaded, transmitter looks really small. So, kindly upload a picture of the transmitter module alone so that I'll get some idea of optimizing the design.

    Apr 04, 2016
  • Megashree R's picture
    Megashree R

    Should we connect all the components as it is shown in the transmitter and receiver diagrams?

    Apr 04, 2016
  • Anamul Haque's picture
    Anamul Haque

    i can not find any accelerometer sensor in proteus.......also encoder-decoder HT12E & HT12D....please help me how to find this component in proteus.......Badly need this component to simulate this project

    Apr 08, 2016
  • HIMANSHU RATHI's picture
    HIMANSHU RATHI

    I want where you have simulated this circuit, coz I can't find all the components used in Proteus.
    if anyone have the simulated file for this project please mail me

    Apr 09, 2016
  • Hadmath singh's picture
    Hadmath singh

    I built a transmitter module on a bread board and it looks really clumsy because of too many connecting wires and potentiometers. It's too large for a hand palm. However, in the video that you have uploaded, transmitter looks really small. So, kindly upload a picture of the transmitter module alone so that I'll get some idea of optimizing the design.

    Apr 10, 2016
  • Megashree R's picture
    Megashree R

    Please reply as soon as possible. The project deadline is approaching and I badly need a help in building the transmitter module.

    Apr 13, 2016
  • Maddy's picture
    Maddy

    @Megashree @Hadmath Please check, we have uploaded the Image of Transmitter.

    Apr 18, 2016
  • Animesh's picture
    Animesh

    I am not able to make the led on the receiver side glow pls help..

    May 01, 2016
  • Alina Lepcha's picture
    Alina Lepcha

    Hey friend!! Firstly i would like to thank u for uploading this project.
    I am also making the same project as yours using the same diagram and code and everything but i am not able to successfully run it. Please help me asap as i have to submit my project in 3-4 days.
    I have used same connection and the led on receiver is also glowing but i am not able to figure out the problem as motors are not running.

    May 03, 2016
  • Megashree R's picture
    Megashree R

    Should the antenna pin of transmitter and receiver modules be left as it is? or should we connect any coil to that pin?

    May 05, 2016
  • leo's picture
    leo

    hi friend, im doing a similar project to this one. can you please help me with this, which circuit simulator did you use because i cant find most of these components on Proteus. looking forward for your reply. Thank you.

    May 05, 2016
  • Sinjan Chakraborty's picture
    Sinjan Chakraborty

    I can not upload code into arduino uno r3.
    The error is:-
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x43
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x43
    please tell me how can i solve this error

    May 06, 2016
  • Bharath Reddy's picture
    Bharath Reddy

    Is the program correct for sure or is there any other program.

    Jun 10, 2016
  • Chandramauli Kaushik's picture
    Chandramauli Kaushik

    My robot is only going forward. What could be wrong? Please help....

    Jun 23, 2016
  • Abhishek's picture
    Abhishek

    Program and Circuits are complete and correct, make sure you did the right connections.

    Jul 09, 2016
  • akarsh indi 's picture
    akarsh indi

    hi i would like to know how you calibrated the accelerometer

    Aug 25, 2016
  • shoaib's picture
    shoaib

    What is the model no. of the accelerometer used here?and I don't find l293d motor driver,Does any other motor driver work?

    Jun 25, 2016
  • Shoaib's picture
    Shoaib

    I dont find this model of motor driver L293D.Will any other motor driver work? I dont see 4 input pins in other motor driver like L293D.At that situation which pins i use to connect to Arduino?

    Jun 26, 2016
  • Abhishek's picture
    Abhishek

    Its Accelerometer Sensor ADXL335. And L293D is very common IC, are you sure that it is not available?

    Jul 09, 2016
  • rupinder's picture
    rupinder

    i cant find components for making this on proteus how did u done it on proteus

    Jun 27, 2016
  • rema's picture
    rema

    What modul transmitter and receiver do you use.?

    Jul 13, 2016
  • Abhishek's picture
    Abhishek

    This is ASK Hybrid Transmitter and receiver RF module operates at 433Mhz frequency.

    Aug 13, 2016
  • vignesh's picture
    vignesh

    i built all the circuit but still its not doing a thing,what might be wrong???

    Jul 16, 2016
  • Kre's picture
    Kre

    Can i use xbee instead of rf?

    Jul 26, 2016
  • saddam khan's picture
    saddam khan

    yes

    Jul 29, 2016
  • SUDHIR's picture
    SUDHIR

    HELLO.

    I HAVE MADE THE EXACT CIRCUIT FOR Rx AND Tx, & USED THE EXACT SAME CODE.
    BUT IT IS NOT WORKING CORRECTLY.

    SOMETIME MOTORS HAVE TURNED ON WHILE OTHERTIME THEY DONT,
    PLEASE HELP SORTING THIS OUT.

    Jul 30, 2016
  • Shreya's picture
    Shreya

    What can this be used for?

    Aug 18, 2016
  • Mohammad Shoaib's picture
    Mohammad Shoaib

    Is there needed any header file such as for decoder,motor driver?I connected all elements exactly as like as your provided figure but when i test it there is no signal in the receiver portion and robot does not run too.

    Aug 28, 2016
  • Revanth's picture
    Revanth

    Upto what range it will work when u stand at a constant place

    Sep 09, 2016
  • Abhishek's picture
    Abhishek

    This question is already answered in above comments, please check. Further this RF module has approx 100 meter range when operated at max supply voltage (12v)

    Sep 20, 2016
  • bhargav's picture
    bhargav

    what are m11,m12,m21,m22 you used in the code?

    Sep 17, 2016
  • SANJITH .T's picture
    SANJITH .T

    hai i like this robot,but actually i am new to this gesture things. can ypu please give me the assembling of parts in both reciever and transmitter section as avideo

    Sep 18, 2016
  • SANJITH .T's picture
    SANJITH .T

    hiw to create the pcb board

    Sep 19, 2016
  • ahamedmaududi's picture
    ahamedmaududi

    When I did the project.The motor doesn't run when I apply gesture.But when I touch or change the resistance using screwdriver the motor runs.pls give the solution.

    Sep 20, 2016
  • Maddy's picture
    Maddy

    you first need to adjust all the 4 Variable resistor in stable position.

    Sep 21, 2016
  • ahamedmaududi's picture
    ahamedmaududi

    Sir then what I have to do sir.

    Sep 21, 2016
  • Himanshu prajapati's picture
    Himanshu prajapati

    Sie how u make transmitter connections..on PCB..it too complicated .....plz help me
    Ll

    Sep 25, 2016
  • Mano's picture
    Mano

    What will happen if A1-A7 pins are left as it is??(both in encoder and decoder)

    Sep 28, 2016
  • Abhishek's picture
    Abhishek

    A0-A7 pins should be identically configured. We have grounded them in both encoder and decoder. You can make many combinations like left A0 open in encoder and same in decoder, then this encoder will only respond for A0 opened decoder.

    Oct 06, 2016
  • ajay 's picture
    ajay

    i have made the all connection as shown in the circuit diagram nd same program but..its not working... led is also not glowing in the receiver circuit.. plzzz help ..i did not find the sollution yet ..plzz help me its urgent

    Oct 01, 2016
  • fatin's picture
    fatin

    what software do you used to simulate this circuit ??

    Oct 03, 2016
  • DINESH SEERVI's picture
    DINESH SEERVI

    can you please tell ,me how to simulate reciver circuit in proteus

    Oct 21, 2016
  • jay's picture
    jay

    I have made this robot bt in the transmitter section I have implemented the accelerometer in such a direction that yours x-y direction is mine y- x direction so what changes should I make in my program plzzzz help me

    Oct 22, 2016
  • Saeed Anwer's picture
    Saeed Anwer

    i make this project but cant run it is i need to programe HT12E AND HT12D
    I COMPLETE THE BOTH TRANSMITER ANS RECEIVER AND I USE H BRIDGE

    Oct 29, 2016
  • Sreekanth Bv's picture
    Sreekanth Bv

    I have connected all the components asper the circuit, but when I tilt the accelerometer forward and right the motors moves forward and right, but when the accelerometer is tilted left and backwards the motors aren't moving! please help me! What should I do

    Nov 15, 2016
  • vimal savani's picture
    vimal savani

    hi.
    my robot's motor does not run.. please help me

    Nov 16, 2016
  • Umarzaheer 's picture
    Umarzaheer

    Plz help me can I use the h.bridge instead of motor driver ic.

    Nov 16, 2016
  • Umarzaheer 's picture
    Umarzaheer

    Sir according table in forward 1 pin is high.but in program you write the two pins are high for forward.please explain it.plzplzplZ.which condition is true for forward and other

    Nov 21, 2016
  • Abhishek's picture
    Abhishek

    Table's D3,D2,D1,D0 are related to variables Temp1, temp2, temp3, temp4, not related with the Motors pins which you are talking about, please check carefully.

    Dec 01, 2016
  • IKRAM's picture
    IKRAM

    hey sir. can u help me. i cant find ht12e and ht12d in my library of proteus. do you have the library for that in proteus 8? can u email it to me or what do you use to draw the circuit and simulation

    Nov 25, 2016
  • Abhishek's picture
    Abhishek

    ht12e and ht12d are not there in Proteus you can try using IC M145026 and M145027. These ICs work same like ht12e and ht12d.

    Dec 01, 2016
  • Umarzaheer 's picture
    Umarzaheer

    Sir can I use diffrent conditin for left and right movment because my car is going only forward and backward.in program 1 pin high for left and right can i set 2 pins high.because it is very difficult to set the condition for left and right from variable resister.give me salution

    Dec 07, 2016
  • umar zaheer's picture
    umar zaheer

    thanks sir for guidess i copleted the project.my car is working.thanks sir

    Dec 14, 2016
  • Maddy's picture
    Maddy

    Hi Umar,
    We are glad that it worked for you.

    Dec 17, 2016
  • Asmita jagdale's picture
    Asmita jagdale

    Hey plz help me in m not getting the output...

    Jan 05, 2017
  • Cyriac's picture
    Cyriac

    Please give me the pcb layout of this ckt diagram

    Jan 06, 2017

Leave a comment