Skip to main content

GESTURE CONTROLLED ROBOT USING ACCELEROMETER AND ARDUINO

How to Make Gesture Controlled Robot:

Have a look at the video to view the Robot in action.......




Now you would be curious to know how to make one yourself. So here we will tell you step by step guide to make one such robot yourself.

STEP 1:
To begin with, you need to collect the components required to make the robot. The desired components are listed below. You can buy the components buy visiting the links given infront of them:
1. Arduino Mega: Arduino Mega


2. Accelerometer: Accelerometer


3. L293D Motor Driver or Motor Driver Shield: Motor Driver Shield


4. Robot Car Chassis. Robot Chassis


5. Connecting Wires. Connecting Wires


6. Nuts and Bolts: Nuts and Bolts


7. Battery. 9V Battery


8. RF Module: RF Module RF Module Circuit


9. Potentiometer. Potentiometer


10. LM324N IC. LM324N IC


STEP 2:
After collecting the components, Assemble the robot chassis firmly.  The robot chassis should be rigid enough so that the robot car follows the straight line path while in motion.

STEP 3:
after assembling the chassis you need to connect the circuit of the motor driver as well as the RF Module together. The pin diagram for L293D is given here. Connect the wires accordingly to make the circuit.

The sample circuit is shown here:




Now connect the RF Module circuit together so that it helps to transfer the data from the accelerometer to the arduino.




The completed circuit is shown here:




To connect accelerometer, you need LM324N IC and potentiometers to tune the output. The circuit is shown below:



Now all the circuits are completed. Now we need to connect the input received by receiver to the arduino.



STEP 4:
Now connect the pins to the arduino. I selected the following pins for Connections:

Arduino Pin 2                                     L293D Input 1
Arduino Pin 3                                     L293D Input 2
Arduino Pin 4                                     L293D Input 4
Arduino Pin 5                                     L293D Input 5

Arduino Pin 8                                     RF Receiver Pin 1
Arduino Pin 9                                     RF Receiver Pin 2
Arduino Pin 10                                   RF Receiver Pin 3
Arduino Pin 11                                   RF Receiver Pin 4

After the connections are made, power the circuit with 9V batteries. Thus your electrical arrangement for the robot is complete.

STEP 5:
Arduino Coding:

void forward()  // function to move the bot forward
{
  digitalWrite(2,150);
  analogWrite(3,0);
  analogWrite(4,0);
  analogWrite(5,150);
}

void backward() // function to move the bot backward
{
  analogWrite(2,0);
  analogWrite(3,150);
  analogWrite(4,150);
  analogWrite(5,0);
}

void left()
{
  analogWrite(2,0); // function to move the bot left
  analogWrite(3,0);
  analogWrite(4,150);
  analogWrite(5,0);
}

void right()  // function to move the bot right
{
  analogWrite(2,0);
  analogWrite(3,150);
  analogWrite(4,0);
  analogWrite(5,0);
}
void stopp()  // function to stop the bot
{
  analogWrite(2,0);
  analogWrite(3,0);
  analogWrite(4,0);
  analogWrite(5,0);
}

void setup() {

pinMode(8,INPUT); // reading input from the rf receiver
pinMode(9,INPUT);
pinMode(10,INPUT);
pinMode(11,INPUT);
digitalWrite(8,LOW);    // writing low on the input pins.
digitalWrite(9,LOW);
digitalWrite(10,LOW);
digitalWrite(11,LOW);
pinMode(2,OUTPUT);    // output pins for motors
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}

void loop() {

if(digitalRead(8)==0 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==1)
{
  while(digitalRead(8)==0 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==1)
  {
  left();// moves bot left till the input is received
  }
}
else if(digitalRead(8)==1 && digitalRead(9)==0 && digitalRead(10)==1 && digitalRead(11)==1)  
{
  while(digitalRead(8)==1 && digitalRead(9)==0 && digitalRead(10)==1 && digitalRead(11)==1)
  {
   right();//same as above
  }
}
else if(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==0 && digitalRead(11)==1)  
{
  while(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==0 && digitalRead(11)==1)
  {
  forward();  // same as above
  }
}
else if(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==0)
{
  while(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==0)
  {
  backward(); // same as above
  }
}
else if(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==1)
{
  while(digitalRead(8)==1 && digitalRead(9)==1 && digitalRead(10)==1 && digitalRead(11)==1)
  {
  stopp();  // same as above
  }
}
}// loop ends

Upload the above given code onto your Arduino board and your Robot is ready to Run.

Enjoy making your own robot and Happy Learning. Do share the video is it was helpful to you. :)

Comments

Popular posts from this blog

HOW TO MAKE A ROBOTIC BIRD | FLAPPING MECHANISM | GEARBOX DESIGN | ORNIT...

The following video aims at designing the flapping wing mechanism for a robotic bird (Ornithopter). The robotic bird can be controlled with a Remote Control. The design is made in solidworks software and the motion study of the mechanism is also done on the same software.

��HOW TO INTERFACE IR SENSOR WITH ARDUINO | VISITOR COUNTER | ARDUINO TUT...

(via  https://www.youtube.com/watch?v=lkbPh8IV1t HELLO EVERYONE. TODAY WE WILL LEARN HOW TO INTERFACE IR SENSOR WITH ARDUINO AND HOW TO MAKE VISITOR COUNTER WITH IT.  TO START WITH, AN IR SENSOR HAS 3 PINS, NAMELY FOR VCC, GND, AND DATA. THROUGH THE DATA PIN, WE TAKE IN THE INPUT AND DETECT WHETHER THESE IS SOME OBSTACLE IN FRONT OR NOT. IR SENSOR WORKS ON THE PRINCIPLE OF REFLECTION OF LIGHT WAVES. BY USING THE DIGITAL READ FUNCTION, WE CAN READ THE VALUE OF INPUT TO BE 1 OR 0, AND DO COMPUTATION ACCORDINGLY. TO MAKE THE PROJECT THE COMPONENTS REQUIRED ARE: 1. ARDUINO 2. LCD MODULE. 3. IR SENSOR MODULE. 4. BREAD BOARD. 5. POTENTIOMETER. 6. RESISTORS. 7. CONNECTING WIRES. CONNECTIONS: FOR LCD CONNECTION, YOU CAN VISIT MY PREVIOUS VIDEO AT:  https://youtu.be/Li-ZkPfosvE NOW CONNECT THE DATA PIN OF THE IR SENSOR TO THE ANALOG PIN A0, OF THE ARDUINO. NOW YOU CAN PERFORM BOTH DIGITAL AND ANALOG READ FUNCTION ON THIS PIN, DEPENDING UPON YO...

��HOW TO MAKE DOOR LOCK SYSTEM USING ARDUINO | ARDUINO TUTORIALS | INTERF...

HELLO EVERYONE, TODAY WE WILL LEARN HOW TO MAKE A DOOR LOCK SYSTEM USING ARDUINO, KEYPAD, LCD, AND A SERVO MOTOR. TO BEGIN WITH, LET'S HAVE A LIST OF COMPONENTS THAT WE REQUIRE FOR THIS PROJECT: 1. ARDUINO MEGA. 2. LCD MODULE. 3. KEYPAD MODULE. 4. BUZZER. 5. RGB LED. 6. BREADBOARD. 7. CONNECTING WIRES. 8. RESISTORS. 9. POTENTIOMETER. ONCE, THE COMPONENTS ARE COLLECTED, WE NEED TO SETUP THE CIRCUIT, AS PER THE SCHEMATICS GIVEN IN THE VIDEO. ALSO YOU CAN SETUP INDIVIDUAL COMPONENTS LIKE 1. LCD: https://youtu.be/Li-ZkPfosvE 2. KEYPAD: https://youtu.be/nex5usOycSM 3. RGB LED: https://youtu.be/NLr56HLcWWk 4. SERVO MOTORS BY VISITING THE CORRESPONDING LINKS GIVEN ABOVE. AFTER THE CIRCUIT IS COMPLETE, YOU NEED TO UPLOAD THE CODE: #include<Keypad.h> // KEYPAD LIBRARY FOR KEYPAD INTERFACING #include<LiquidCrystal.h> // LIBRARY FOR LCD INTERFACING #include<Servo.h>// LIBRARY FOR SERVO MOTOR //#include<String.h> #define buzzer 10 // DEFININ...