Skip to main content

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 ADXL345 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.

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.



Circuit Diagram for Transmitter Section

 

 

 Receiver

 


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

 code for gasture transmeter

  #include <VirtualWire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>

/* Assign a unique ID to this sensor at the same time */
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Accelerometer Test");
  vw_setup(2000);
  vw_set_tx_pin(13);

  if(!accel.begin())
  {
    /* There was a problem detecting the ADXL345 ... check your connections */
    Serial.println("Ooops, no ADXL345 detected ... Check your wiring!");
    while(1);
  }
}

void loop(void)
{
  /* Get a new sensor event */
  sensors_event_t event;
  accel.getEvent(&event);

  /* Display the results (acceleration is measured in m/s^2) */
  if(event.acceleration.x>2)
    {
   char *msg2 = "d";
   vw_send((uint8_t *)msg2, strlen(msg2));
   vw_wait_tx();
   Serial.println("d");
  }
  else if(event.acceleration.x<-2)
     {
   char *msg2 = "c";
   vw_send((uint8_t *)msg2, strlen(msg2));
   vw_wait_tx();
   Serial.println("c");
  }
  if(event.acceleration.y>2)
   {
   char *msg2 = "a";//send a to the receiver
   vw_send((uint8_t *)msg2, strlen(msg2));
   vw_wait_tx();
   Serial.println("a");
  }
  else if(event.acceleration.y<-2)
   {
   char *msg2 = "b";
   vw_send((uint8_t *)msg2, strlen(msg2));
   vw_wait_tx();
   Serial.println("b");
  }
  else
  {
   char *msg2 = "e";
   vw_send((uint8_t *)msg2, strlen(msg2));
   vw_wait_tx();
   Serial.println("e");
  }
  delay(300);
}


code for gasture reciver:


#include <VirtualWire.h>

const int motorPin1 = 9;   // Pin 9 of L293D
const int motorPin2 = 10;  // Pin 10 of L293D
const int motorPin3 = 11;  // Pin 11 of L293D
const int motorPin4 = 12;  // Pin 12 of L293D

void setup() {
  Serial.begin(9600);
  Serial.println("setup");

  vw_setup(2000);
  vw_set_rx_pin(8);
  vw_rx_start();

  pinMode(13, OUTPUT);

  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
  pinMode(motorPin3, OUTPUT);
  pinMode(motorPin4, OUTPUT);
}

void loop() {
  uint8_t buf[VW_MAX_MESSAGE_LEN];
  uint8_t buflen = VW_MAX_MESSAGE_LEN;

  if (vw_get_message(buf, &buflen)) {
    for (int i = 0; i < buflen; i++) {
      switch (buf[i]) {
        case 'a':  // Forward
          digitalWrite(13, HIGH);
          Serial.println("Forward");
          digitalWrite(motorPin1, LOW);
          digitalWrite(motorPin2, HIGH);  // FORWARD
          digitalWrite(motorPin3, LOW);
          digitalWrite(motorPin4, HIGH);
          break;
        case 'b':  // Backward
          digitalWrite(13, HIGH);
          Serial.println("Backward");
          digitalWrite(motorPin1, HIGH);
          digitalWrite(motorPin2, LOW);   // REVERSE
          digitalWrite(motorPin3, HIGH);
          digitalWrite(motorPin4, LOW);
          break;
        case 'c':  // Left
          digitalWrite(13, HIGH);
          Serial.println("Left");
          digitalWrite(motorPin1, LOW);
          digitalWrite(motorPin2, LOW);   // LEFT
          digitalWrite(motorPin3, LOW);
          digitalWrite(motorPin4, HIGH);
          break;
        case 'd':  // Right
          digitalWrite(13, HIGH);
          Serial.println("Right");
          digitalWrite(motorPin1, LOW);
          digitalWrite(motorPin2, HIGH);  // RIGHT
          digitalWrite(motorPin3, LOW);
          digitalWrite(motorPin4, LOW);
          break;
        case 'e':  // Stop
          digitalWrite(13, LOW);
          Serial.println("Stop");
          digitalWrite(motorPin1, LOW);
          digitalWrite(motorPin2, LOW);   // STOP
          digitalWrite(motorPin3, LOW);
          digitalWrite(motorPin4, LOW);
          break;
        default:
          break;
      }
    }
    Serial.println("");
  }
}




Building a Low-Cost Gesture-Controlled RC Car with Arduino | DIY Project:




Comments

popular posts

AX2358 Homemade 5.1 Remote Kit with 16x2 LCD

AX2358 Homemade 5.1 Remote Kit with 16x2 LCD                                               AX2358 is I used for this 5.1 remote kit project. It is Built-in 2-channel to 6-channel converter and 6-channel volume controller. It has 4 stereo inputs and one 6 channel input. Any stereo input terminals of AX2358 are selected, it will be directly converted to 6 channels and then output through volume adjustment but when the signal from the 6-channel input terminal is selected, it directly enters the volume adjustment and then outputs it without any processing. It has 6-channel individual volume control in this IC (0 to -79dB, 1dB/step). This IC working by I2C communication. The data are transmitted to the AX2358 via the SDA and SCL. So I need a microcontroller. I choose the microcontroller is Atmega328 for this. This microcontroller programmed with Arduino UNO.      ...

DIY Tutorial Resetting Toner Chip on Ricoh SP C250DN Printer in Simple Steps

  DIY Tutorial Resetting Toner Chip on Ricoh SP C250DN Printer in Simple Steps The RICOH SP 250DN printer toners have a chip that keeps track of the number of pages that have been printed. This is anoying because it will render a refill useless. In order to reuse this kind of toner, there are two things you need to do: refill the toner with ink (if needed) reset the toner chip (or replace it) There is plenty of information explaining how to refill the toner but little information on how to erase the toner chip. This document deals with the second point: how to dump the chip and reset it. It took me a while to get everything setup and to have my toner chip reset so I would like to share this process in order to help other to do the same with their printer toner cartridges. I will step through the process of understanding the problem, analysing the chip circuit, dumping the chip contents and writing back a pattern so the printer will be able to initialize the chip and set t...

DIY Metal Detector using Arduino A Simple Guide to Building Your Own at Home

  DIY Metal Detector using Arduino A Simple Guide to Building Your Own at Home How does a metal detector work? As we can see there are three things that are using to complete the whole project. Electronic circuit, Arduino, and a copper coil. here actually we are making a proximity sensor that detects the metal with a  metal detector  using Arduino . Here are the steps to build a DIY metal detector using an Arduino: Materials required: Arduino UNO Copper coil Diode 10nf capacitor Buzzer Led 220 ohm &  330 Ohm Resistor Jumper wires and a breadboard USB cable for uploading the code Circuit Diagram Arduino metal detector:-  Arduino UNO 10 nf Capacitor A2 Pin Terminal 1 GND Terminal 2 Arduino UNO Buzzer D6 Pin Positive GND  Negative Arduino LED 220 Ohm Resistor D5 Pin   Terminal 1   Anode Pin Terminal 2 GND Cathode Pin   Arduino UNO Copper coil Diode 330-ohm res   Terminal 1 Terminal 1 Terminal 1 A1 Pin     Terminal 2 A2 Pin ...

How to Calculate Inverter Battery Backup Time

  How to Calculate Inverter Battery Backup Time? Backup Time (in hours) = Battery Capacity (in Ah) X Input voltage (V) / Total Load (in Watts) Whenever you plan to buy an inverter battery, there is a desire to know some important information in your mind. Like how much will be the backup of the inverter battery, how many hours of backup will be available for how many ah batteries, etc. In this informative information, here you will know the backup time calculation formula.   Taking your inputs, you can calculate your total load, like: 3 tube led lights = 40 x 3 = 120 Watts 2 fans = 75 x 2 = 150 Watts 1 Bulb router = 1×20 Watts = 20 Watts So, the total load in your case is 120 + 150 + 20 = 290 Watts. Now, let us apply all these values in the above-said battery backup time formula.  Backup Time (in hours) = Battery Capacity (in Ah) X Input voltage (V) / Total Load (in Watts) Backup Time (in hours) = 150 x 12 / 290 = 6.2 So, your inverter battery will last around 6.2 hours ....

Wireless Joystick controlled Robot Car using Arduino, 433Mhz RF and L298N Motor Driver

    Wireless Joystick controlled Robot Car using Arduino – In this tutorial, you will learn how to control a Robot Car wirelessly using Arduino, L298N Motor driver, and  433 Mhz RF transmitter and Receiver . The robot control system can be activated and de-activated using the Built-in Joystick push Button. Arduino Uno Arduino Nano Mega 2560: Robot Car chassis kit: L298N motor driver: 2-Axis Analog Joystick 433 MHz Transmitter and Receiver Modules: DISCLAIMER: Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way! wireless joystick Interfacing: Watch this tutorial for the robot parts assembling and connections. All the connections are exactly the same as explained in my previous tutorial. The only modification that I did is the addition of the 433 Mhz RF receiver module…the VCC pin of the receiver module is connected with the 5 volts…the ground pin of the ...