Project tutorial
Gesture Controlled Robot Using Arduino & Android-App

Gesture Controlled Robot Using Arduino & Android-App

A simple 2WD-Robot which can be controlled by just tilting your Android-device in desired direction.

  • 6 views
  • 0 comments
  • 1 respect

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
61pby065esl  sx679  tnr8syww5d
HC-05 Bluetooth Module
×1
09670 01
SparkFun Dual H-Bridge motor drivers L298
×1
Battery - 18650 - 7800mAh- 3.7V
×1
56t2029 40
Battery Holder, 18650 x 2
×1
Tens70
9V battery (generic)
×1
Adafruit industries ada80 image 75px
9V to Barrel Jack Connector
×1
BO Motor - Straight - 300rpm
×1
11026 02
Jumper wires (generic)
×1
Ball Caster Wheel
×1
Chasis - Eg. Plastic Box Cover, Acrylic Sheet, Metal Sheet
×1
4314603
Toggle Switch, (Off)-On
×1

Necessary tools and machines

Apps and online services

About this project

  • Step 1: Assemble the circuit as shown in the schematic given below. You can use the battery pack for powering driver circuit which I have mentioned in the components section or you could try out some other battery pack, but keep it mind it should deliver between 7-12V and atleast 3500mAh. Also, use different battery/battery-packs for powering Arduino and the Motor-Driver module, but ensure they share a common ground. Battery is one of the most important thing in this project !
  • Step2: Compile the code given below in the Arduino-IDE and hit upload, but before that make sure you have disconnected RX of Arduino from TX of Bluetooth Module (HC-05).
  • Step 3: Install the application on your Android device through a link provided below.
  • Step 4: Pair your Android device and HC-05 over Bluetooth. Now, open the app and click on connect-icon and select your device from the list.
  • Step 5: Now you have gone through all the hard work ! Just sit back and relax and tilt the Android-device to move the robot in your desired direction.

Code

Gesture Controlled Robot Using Arduino & Android-AppC/C++
Download/Copy-Paste and compile+upload it using Arduino IDE.
int x,y,tempX,tempY; // Variables To Store X-Y Coordinates
const int r1=13,r2=12,l1=11,l2=10; // Motor Control Pins
void setup() 
{
  Serial.begin(9600); // Set Baud-Rate At 9600
  pinMode(r1,OUTPUT); // Set Motor Control Pins As O/P
  pinMode(r2,OUTPUT);
  pinMode(l1,OUTPUT);
  pinMode(l2,OUTPUT); 
}
void loop() 
{
 while(Serial.available()>0)
  {
   x= Serial.parseInt(); // Capture X Coordinate
   y= Serial.parseInt(); // Capture Y Coordinate
   tempX = map(x,-100,100,0,200); // Map Value Of X Coordinate
   tempY = map(y,-100,100,0,200); // Map Value Of Y Coordinate
   if(tempX<90)
   {
    if (tempY>90 && tempY<110)
    {
       foward(); // Move Forward
    } 
   }
   
   if(tempX>110)
   {
    if (tempY>90 && tempY<110)
    {
       reverse(); // Move Backward
    } 
   }
   
   if(tempX>90 && tempX<110)
   {
    if (tempY>110)
    {
     left(); // Turn Left
    } 
    else if (tempY<90)
    {
     right() ; // Turn Right
    }
   }

   if (tempX>90 && tempX<110)
   {
    if (tempY>90 && tempY<110)
    {
    brake(); // Stop
   }
   }
  }
}
void foward ()
{
 digitalWrite(r2,HIGH); 
 digitalWrite(r1,LOW);
 digitalWrite(l2,HIGH); 
 digitalWrite(l1,LOW);
}
void reverse()
{
 digitalWrite(r2,LOW); 
 digitalWrite(r1,HIGH);
 digitalWrite(l2,LOW); 
 digitalWrite(l1,HIGH);
}
void right()
{
 digitalWrite(r2,LOW); 
 digitalWrite(r1,HIGH);
 digitalWrite(l2,HIGH); 
 digitalWrite(l1,LOW);
}
void left()
{
 digitalWrite(r2,HIGH); 
 digitalWrite(r1,LOW);
 digitalWrite(l2,LOW); 
 digitalWrite(l1,HIGH);
}
void brake()
{
 digitalWrite(r2,LOW); 
 digitalWrite(r1,LOW);
 digitalWrite(l2,LOW); 
 digitalWrite(l1,LOW);
}

Schematics

Gesture Controlled Robot Using Arduino & Android-App
Connect them and get going !
Capture y8a38pbdo9

Comments

Similar projects you might like

Simple Gesture Controlled Robot Using Arduino

Project tutorial by Jithin Sanal

  • 8,163 views
  • 1 comment
  • 30 respects

Hand Gesture Controlled Robot

Project tutorial by Mayoogh Girish

  • 81,237 views
  • 86 comments
  • 95 respects

How to Make a Gesture Control Robot at Home

Project tutorial by Shubham Shinganapure

  • 12,364 views
  • 17 comments
  • 67 respects

Gesture Controlled Trainable Arduino Robot Arm via Bluetooth

Project tutorial by KureBas Robotics

  • 27,936 views
  • 58 comments
  • 177 respects

Gesture Control Robot

Project tutorial by Raunak Oberai

  • 17,124 views
  • 18 comments
  • 37 respects
Add projectSign up / Login