fbpx

Gesture Controlled Robot

Gesture Controlled Robot uses the user gesture to control the robot action like move forward, reverse, left, right, stop. The robot uses the RF receiver to receive the gesture data from the user. The user uses Accelerator meter to detect the gesture action and transmit gesture data to the robot using an RF transmitter.

Block Diagram

Working

The accelerometer detects the hand gesture and produces the analog signal. This analog signal is given as input to Arduino and it will convert into a digital signal. Later the converted signal is transmitted by using RF transmitter. In the receiver section, RF receives the data and fed into Arduino, based on the received data robot performs the desired action.

  • If we tilt hand in forward then Robot moves in the forward direction.
  • If we tilt hand in backward then Robot moves in the Reverse direction.
  • If we tilt hand in left side then Robot moves in the left direction.
  • If we tilt hand in Right side then Robot moves in the right direction.
  • If we place hand parallel to the ground then Robot stops.

Required Components

  1. Bread Board.
  2. Connecting wires.
  3. Castor wheel.
  4. Robot Wheel.
  5. Robot Chasis.
  6. Motor Driver l293d.
  7. DC Geared or BO motor
  8. Arduino
  9. Battery
  10. LM7805
  11. Switch
  12. Capacitors 470uf & 100uf
  13. RF transmitter and receiver
  14. Accelerometer(ADXL335).

ADXL335

The gestures/motion made by hand is recognized by the acceleration measuring device called accelerometer (ADXL335).An accelerometer is a three-axis acceleration measuring device. It has 3 axes (X Y Z).

ADXL335 Pin description

  • Vcc – 5 volt supply should connect at this pin.
  • X-OUT – This pin gives an Analog output in the x-direction.
  • Y-OUT – This pin gives an Analog Output in the y-direction.
  • Z-OUT – This pin gives an Analog Output in the z-direction.
  • GND – Ground.

RF Transmitter & Receiver

CC2500 RF Module is a Transreceiver module which provides easy to use RF communication at 2.4 GHz.RF Module can be used for applications that need two-way wireless data transmission. The range is about 30 meters. The computer will be connected to a CC2500 module to transmit data. The robot also has a CC2500 module to receive data from the computer. The address of both modules should match for the data transmission.

LOGIC TABLE

Transmitter Logic Table

Receiver Logic Table

Receiver Circuit Pin Mapping

Between Arduino and L293D

Between Motor and L293D

Between Arduino And CC2500 (For Both Transmitter and Receiver Circuit)

Transmitter Circuit Pin Mapping

Circuit Diagram

Receiver Circuit:

Transmitter Circuit:

Flow Chart

Transmitter Flow chart

Receiver Flow chart

Software Requirements

  1. Arduino IDE

Program

Transmitter Code

int xaxis = 0;
int yaxis = 1;
void setup()
{
   Serial.begin(115200);
}
void loop()
{
 int xaxis_val = analogRead(xaxis);
 int yaxis_val = analogRead(yaxis);
 if ((xaxis_val > 370 && xaxis_val < 385) && (yaxis_val > 360 && yaxis_val < 380)) //stop(transmitter parallel to ground)   
{     
  Serial.print("S");   
}   
else   
{     
if ((xaxis_val > 395 && xaxis_val < 416) && (yaxis_val > 360 && yaxis_val < 380)) //forward(transmitter tilted forward)     
{       
  Serial.print("F");     
}     
if ((xaxis_val > 345 && xaxis_val < 365) && (yaxis_val > 365 && yaxis_val < 381)) //backward(transmitter tilted backward)     
{      
  Serial.print("B");     
}     
if ((xaxis_val > 370 && xaxis_val < 380) && (yaxis_val > 335 && yaxis_val < 355)) //left(transmitter tilted to left)     
{       
   Serial.print("L");    
}     
if ((xaxis_val > 370 && xaxis_val < 390) && (yaxis_val > 385 && yaxis_val < 395)) //right(transmitter tilted to right)
{
  Serial.print("R");
}
}
}

Receiver  code

#define RIGHT_MOTOR_ONE 4
#define RIGHT_MOTOR_TWO 5
#define LEFT_MOTOR_ONE 6
#define LEFT_MOTOR_TWO 7

char Received_Data;

void setup() 
{
/* Motor pin configuration */
pinMode(RIGHT_MOTOR_ONE, OUTPUT);
pinMode(RIGHT_MOTOR_TWO, OUTPUT);
pinMode(LEFT_MOTOR_ONE, OUTPUT);
pinMode(LEFT_MOTOR_TWO, OUTPUT);
}

void loop()
{
if (Serial.available())
{
Received_Data = Serial.read();
/* IF RECEIVED DATA IS "S" STOP THE ROBOT*/
if (Received_Data == 'S')
{
STOP_ROBOT();
}
/* IF RECEIVED DATA IS "L" MOVE ROBOT TO LEFT */
else if (Received_Data == 'L')
{
MOVE_ROBOT_LEFT();
}
/* IF RECEIVED DATA IS "R" MOVE ROBOT TO RIGHT */
else if (Received_Data == 'R')
{
MOVE_ROBOT_RIGHT();
}
/* IF RECEIVED DATA IS "F" MOVE ROBOT FORWARD */
else if (Received_Data == 'F')
{
MOVE_ROBOT_FORWARD();
}
/* IF RECEIVED DATA IS "B" MOVE ROBOT FORWARD */
else if (Received_Data == 'B')
{
MOVE_ROBOT_REVERSE();
}
}
}

/* MOVE ROBOT FORWARD */
void MOVE_ROBOT_FORWARD()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* MOVE ROBOT REVERSE */
void MOVE_ROBOT_REVERSE()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT LEFT */
void MOVE_ROBOT_LEFT()
{
digitalWrite(RIGHT_MOTOR_ONE, HIGH);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, HIGH);
}

/* MOVE ROBOT RIGHT */
void MOVE_ROBOT_RIGHT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, HIGH);
digitalWrite(LEFT_MOTOR_ONE, HIGH);
digitalWrite(LEFT_MOTOR_TWO, LOW);
}

/* STOP ROBOT */
void STOP_ROBOT()
{
digitalWrite(RIGHT_MOTOR_ONE, LOW);
digitalWrite(RIGHT_MOTOR_TWO, LOW);
digitalWrite(LEFT_MOTOR_ONE, LOW);
digitalWrite(LEFT_MOTOR_TWO, LOW);
} 

Leave a Reply

Your email address will not be published. Required fields are marked *