Introduction: Gesture Controlled Robot Using Arduino

Picture of Gesture Controlled Robot Using Arduino

This gesture controlled robot uses Arduino,ADXL335 accelerometer and RF transmitter-receiver pair.

We will divide the entire robot into 3 parts the transmitter,the receiver and the robot.

The different gestures that have been mapped to the direction of the bot are-

Hand parallel to the ground-stationary

Hand tilted forward-forward

Hand tilted backward-backward

Hand tilted right-right

Hand tilted left-left

I've made the transmitter on thermocol though it can also be made on a glove.

Note:For those of you looking to download all the code, schematics and other pictures at one place and would prefer to use GitHub ,look at the end of this instructable.

Step 1: Materials Required

Picture of Materials Required

For transmitter-

  1. Arduino Uno
  2. ADXL335 accelerometer
  3. 433 MHz RF transmitter
  4. Breadboard

For receiver and robot-

  1. Arduino Uno
  2. 433 MHz RF receiver
  3. L293D motor driver IC
  4. Chassis and wheels
  5. 2 DC motors
  6. Breadboard

Of course you will also need jumper wires and 9V batteries

Instead of using the Arduino and breadboard in transmitter like I did ,you may instead use an ATMega328p, which can be programmed from the Arduino board and solder it along with RF transmitter and ADXL335 on a perfboard.

The perfboard can then be attached to a glove.However here I've used a remote controller like setup with the gestures the same

Step 2: Assembling the Robot

Picture of Assembling the Robot

Fix the wheels on the chassis.

Mount the DC motors on the back wheels and use dummy wheels for the front.

Mount the L293D IC on the breadboard and place it on the chassis

Place the Arduino on the chassis and make the connections of L293D as follows

4,5,12,13 to GND

1,9,16 to VCC(5V)

3,6 to left motor(output)

11,14 to right motor(output)

2,7,10,15 to pins 8,9,10,7 of Arduino(inputs)

8 to 9V battery

Step 3: Determining the Direction of Robot

You can learn more about L293D from internet.

Basically ,the motor rotates when the inputs supplied are opposite.

For example high,low may rotate the motor in clockwise while low,high in anti clockwise.

If both inputs are same then motor does not rotate.

The following sketch in test.ino will help to determine for what inputs for the 2 motors will the robot move forward.Copy and paste it in Arduino IDE

In my case it was observed that the bot will move forward pin 9 of Arduino is high,pin 8 is low(for left motor),pin 10 is high,pin 7 is low(for right motor).Try different combinations till you get desired direction. Similarly for moving back the combination is high,low,low,high.The bot will go right if left motor is moving and right is stopped by giving same inputs.Similarly for left.

Step 4: Interfacing ADXL335 With Arduino

Picture of Interfacing ADXL335 With Arduino

Mount the ADXL335 and on the breadboard.

The connections to Arduino should be as follows.The Arduino should be different from the one used in step 2

ADXL335 ARDUINO

VCC 3.3 V

GND GND

X A0

Y A1

Z open

ST open

Now copy and paste the code and determine the threshold values for different gestures.

The code gives 2 values xval and yval which will have unique values for different gestures.

Determine the range of values of xval and yval when the hand is tilted forward,backward etc.

Step 5: Interfacing RF Transmitter With Arduino

Picture of Interfacing RF Transmitter With Arduino

Mount the RF transmitter on the breadboard in previous step and make connections as follows.

RF transmitter Arduino

GND GND

DATA D12

VCC 5V

Now download the VirtualWire library from the following link

http://www.pjrc.com/teensy/td_libs_VirtualWire.htm...

Extract the VirtualWire folder from the downloaded folder and paste it in arduino-1.6.1>libraries

Now use program the arduino of the transmitter with the code given in the text file.

Basically what the code does is to map the different threshold values (for gestures) obtained in step 4 to different letters (stationary-'s' forward -'f' etc) which are then transmitted through the RF transmitter.

This step completes the construction of the transmitter

Step 6: The Receiver

Picture of The Receiver

Mount the RF receiver on the breadboard of step 2.The connections to the Arduino used in step 2 are

RF receiver Arduino

VCC 5V

DATA D11

GND GND

Now program the Arduino with the code given in the file.

The code maps the different letters obtained from the receiver to the inputs for directions.

For instance if the receiver receives the letter "f" corresponding to the bot moving forward,it maps the letter "f" with the inputs low,high,high,low which are the required inputs for the bot to move forward.

Step 7: Run the Robot

Go to this repository to download the code and schematics.Click on the "Clone or Download" button (green in color on the right side) and select "Download ZIP" to download the zip file.Now extract the contents on your computer to get the code and schematics(in the schematics folder).

The gesture controlled robot is now complete.

Connect 9V batteries to both the Arduinos and the L293D motor supply and run the robot.

I've also added functionality by which the on board led on pin 13 of both the Arduinos is on when the bot is moving and off when it's stationary.You may add more such functionality.

Any doubts and connections be clarified by seeing the comments in the given code.

I've posted a video of the robot below.

If you have any queries please leave a comment or contact me through my website.

Comments

RupinderS3 (author)2017-09-10

anyone intrested in making this project i will help you contact at rupindersi234@outlook.com

Abidarian (author)2017-07-29

Dry it's sayyad.abid16@gmail.com

Abidarian (author)2017-07-29

Plz can I get the complete code plzplzplz on sayyad.abid@gmail.com
Plz send it me on given e mail

MathiasR3 made it! (author)2017-04-12

Thanks It was a wonderful project to work with .

AnirudhK32 (author)MathiasR32017-07-27

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

VenkatM16 (author)MathiasR32017-06-26

Please send me the final code it's very urgent

VenkatM16 (author)MathiasR32017-06-25

I need the code can u please send me to my email venkatamourya@gmail.com and library files for rf module how to upload it

MohammadS171 (author)2016-08-30

I need urgent completed code for this project that is seperate code for transmitter arduino and receiver arduino.Anyone help me please! my mail is shoaib7677195@gmail.com

testt15 (author)MohammadS1712017-06-26

bro did u get the final code . If so please mail me @ anderoidgamehackpro@gmail.com

zO4 (author)MohammadS1712017-04-27

did you get the code for Arduino? if so can I see it

Omar Shahjalal Shantonu made it! (author)2017-02-12

The tutorial was highly descriptive. Thank you so much for the steps. Learnt a lot while doing this project. To all the curious people, Arduino Nano can be used instead of Uno. However, for that you need to bring some changes in the code. I went ahead with Uno.
YouTube link: https://www.youtube.com/watch?v=xqbj_SCwMkk

can we dump the trasmitter code and accelometer code simultaneosly into arduinouno

can you please send the final code with full circuit diagram for the project jamalat1995@gmail.com

raja_karthick (author)2015-09-10

In the receiver code, you have mentioned that the RX data pin should be connected to pin 11 of arduino, but you have not used that pin anywhere else in the code???

Subhan95 (author)raja_karthick2015-09-11

Look in the link provided in the description

http://www.pjrc.com/teensy/td_libs_VirtualWire.html

Under configuration functions it is mentioned that the default receiver pin is pin 11 and default transmitter pin is pin 12

SherryS94 (author)Subhan952017-05-21

i am using l298n motor driver..... but it is not working... help pls

ShrijanK (author)2017-05-13

Instead of using 2 axis accelerometer, try using MPU6050. It works perfectly for me.

KutsalÖ (author)2017-03-19

firstly this project is wonderfull. I ask the question to you. Can I use nrf24L01

vijayk242 (author)2017-03-13

Transmitter is working and producing correct values in serial monitor.

data is not received in receiving end and motor is not running

What could be problem??

Sachin ManiBala (author)2017-01-25

Can u please mail me the final gesture movement code

Subhan95 (author)Sachin ManiBala2017-01-26

The codes are in the .ino files.

rupam222 (author)Subhan952017-03-09

can u plz tell me at the receiver code what is the meaning of (0*66)and all that are store in if for motor movement

Sachin ManiBala (author)Subhan952017-01-26

I find all .ino files then i made connection as what you did but i have a problem with data is not received in receiving end

shailesh agarwal qwerty (author)2017-01-28

Can we use arduino nano instead of arduino uno at the transfer section

anjalivarma1995 (author)2016-12-11

I have done exactly as told, but the transmitter only transmits data at irregular intervals and sometimes doesn't at all. why is this?

MishaalK (author)2016-11-17

hello,

i would like to have the final code ,i.e. the receiver's and the transmitter's.

Pls mail it to: mishaalhere@gmail.com

pls someone help me!

Sharath25N made it! (author)2016-09-10

Hi guys i made this robot, thanks to @Subhan95. I just fallowed the instruction and i did it. It was really cool. I used arduino uno at receiver and arduino nano at transmitter side. There was source issue with nano, but finally i figured it out and it worked perfectly.

SarasaS1 (author)Sharath25N2016-11-10

hey could u ps list circ diag of how u used rf transmitter and reciver and arduino code,psss pss help me i need help for my end sem project next week

abhijith6198 (author)2016-10-31

hi.. can i please get the final code???

abhijith6198 (author)2016-10-30

can i get the final code?

GudavalliA (author)2016-10-20

bro..!! programs r perfectly altright its uploading but bot nt moving

RupinderS3 (author)2016-09-12

its somehow wrong instructable may be in programming part some error is there also rf pair wont work directly with arduino

RupinderS3 (author)2016-09-07

in this you have to use encoder and decoder also because rf wont work parallely

Sharath25N (author)RupinderS32016-09-11

Hey i bought encoder and decoder but i didn't use it, i think its done internally by software. mine is working properly.

RupinderS3 (author)2016-08-24

my transmitter is working

but bot is not working its not moving on any gesture how would i know that my reciever is faulty or i have another fault and what is the length of anteena used in transmitter and reciever

ManjunathM10 (author)2016-08-19

bro I did asbu per instructions ...
by its not working ....

RupinderS3 (author)2016-08-16

while getting values from adlx335 i got differnet values from your one so do i need to change than in reciever code also although i have adjusted the values in transmitter coding .

my transmitter is working but reciver part(arduino l293d ) i.e whole bot is not moving on forward gesture

Ena KimR (author)2016-07-26

Is it possible to use only one arduino?

sak4 (author)Ena KimR2016-08-07

yes u can !!!

Myo MinA (author)2016-07-25

how to connect robotic chassis to drive with arduino and flysky i4 receiver.then their source code.

PratikK27 (author)2016-05-29

dude please send the detail info about the circuit connections.I am not getting the rf values sent by the transmitter to the receiver in serial monitor dialogue box.

PratikK27 (author)2016-05-29

dude please send the detail info about the circuit connections.I am not getting the rf values sent by the transmitter to the receiver in serial monitor dialogue box.

binaryhub (author)2016-05-25

Can I use here "Gear Motor",instead of "DC Motor" ??

RashapB (author)2016-05-20

Also can u tell in detail how to connect batteries to motor and arduino

RashapB (author)2016-05-20

Also can u tell in detail how to connect batteries to motor and arduino

RashapB (author)2016-05-20

Hey! It was a good way to make it.....i had a query:we have to program 2 arduinos;one in step 2 and other in step 5.the code for step 5 arduino is given in the link am i right

PiyushS24 (author)2016-04-30

Please upload a video

PiyushS24 (author)2016-04-30

Please upload a video

PiyushS24 (author)2016-04-30

There is no sample video

Sujeet Pa (author)2016-03-26

Can the 433 MHz RF transmitter and the 433 MHz RF receiver, be substituted with a 434 MHz RF transmitter and the 434 MHz RF receiver or should the program be changed, or the circuit? Please help because I only have 434 MHz RF transmitter and 434 MHz RF receiver.