Harish KAshwin S
Published © GPL3+

Gesture controlled robot

A robot that moves based on the hand gestures

BeginnerFull instructions provided4 hours16,502
Gesture controlled robot

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Arduino UNO
Arduino UNO
×1
Inertial Measurement Unit (IMU) (6 deg of freedom)
Inertial Measurement Unit (IMU) (6 deg of freedom)
×1
433Mhz RF Transmitter and Receiver
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
9V battery (generic)
9V battery (generic)
×1
Rechargeable Battery, Lithium Ion
Rechargeable Battery, Lithium Ion
×4
Breadboard (generic)
Breadboard (generic)
×1
Metal robot chassis small
×1
DC 12V geared motor
×2
Robot wheels
×2
Ball caster wheel
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Solder Flux, Soldering
Solder Flux, Soldering

Story

Read more

Schematics

Transmitter circuit

This circuit should be used for connecting the components in the transmitting side.

Receiver circuit

This circuit should be used to connect the components in the receiviing side.

Code

Transmitter code

Arduino
This code should be uploaded to the transmitting side Arduino.
//The Radiohead library for the RF transmitter and reciever can be downloaded from http://www.airspayce.com/mikem/arduino/RadioHead/
//The GY6050 library for the MPU6050 sensor can be downloaded from https://github.com/Freddrup/GY6050
//Extraxt the zip files into the Documents/Arduino/Libraries folder

#include <RH_ASK.h>
#include <Wire.h>
#include <GY6050.h>

GY6050 acc(0x68); //I2C address of MPU6050
RH_ASK driver;  //transmitter object
char* msg="100";

void setup()
{   
     acc.initialisation();   //initialize acc obj
     Serial.begin(9600);
     if (!driver.init())
     Serial.println("init failed");
}

void loop()
{
     const char *msg = "hello";
     int AcX=acc.refresh('A', 'X'); //Acccelration along X axis
     int AcY=acc.refresh('A', 'Y'); //Acccelration along Y axis
     delay(25); 
     if(AcX>=20 && AcX<=60)
     {
          msg="Front";
          Serial.println("Front");
     }
     else if(AcX<=-20 && AcX>=-60)
     {
          Serial.println("Back");
          msg="Back";
     }
     else if(AcY>=20 && AcY<=60)
     {
          Serial.println("Left");
          msg="Left";
     }
     else if(AcY<=-20 && AcY>=-60)
     {
          Serial.println("Right");
          msg="Right";
     }
     else
     {
          Serial.println("Stop");
          msg="Stop";
     }
     delay(100);
     
     driver.send((uint8_t *)msg, strlen(msg));  // transmits the data
     driver.waitPacketSent();
     delay(200);  
}

Receiver code

Arduino
This code should be uploaded to the recieving side Arduino
//The Radiohead library for the RF transmitter and reciever can be downloaded from http://www.airspayce.com/mikem/arduino/RadioHead/
//Extraxt the zip files into the Documents/Arduino/Libraries folder

#include <RH_ASK.h>
RH_ASK driver;
String str;

void setup()
{
    Serial.begin(9600); 
    if (!driver.init())
    Serial.println("init failed");
}

void loop()
{
    uint8_t buf[RH_ASK_MAX_MESSAGE_LEN]; //max size of the buffer
    uint8_t buflen = sizeof(buf);

    if (driver.recv(buf, &buflen))  //receive the message and store it in a buffer
    {
	      str=(char*)buf;  //copy the message from the buffer to a string
	      Serial.println(str);  //print the message in the serial monitor
    }
    delay(200);
    
    if(str=="Front")
    {
        digitalWrite(5,HIGH); //5,6 - Left Motor
        digitalWrite(6,LOW);
        digitalWrite(7,HIGH); //7,8 - Right Motor
        digitalWrite(8,LOW);
    }
    else if(str=="Back")
    {
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        digitalWrite(7,LOW);
        digitalWrite(8,HIGH);
    }
    else if(str=="Left")
    {
        digitalWrite(5,LOW);
        digitalWrite(6,HIGH);
        digitalWrite(7,HIGH);
        digitalWrite(8,LOW);
    }
    else if(str=="Right")
    {
        digitalWrite(5,HIGH);
        digitalWrite(6,LOW);
        digitalWrite(7,LOW);
        digitalWrite(8,HIGH); 
    }    
    else
    {
        digitalWrite(5,LOW);
        digitalWrite(6,LOW);
        digitalWrite(7,LOW);
        digitalWrite(8,LOW);
    }
}

Credits

Harish K

Harish K

1 project • 3 followers
Ashwin S

Ashwin S

1 project • 3 followers

Comments