Introduction: How to Make Gesture Control Robot || #MadeWithArduino.

About: YouTube Content Creator πŸ“½οΈ Robotics Enthusiast / Maker πŸ€– Learn to make robots that are beyond your imagination πŸš€

Hey Guys, welcome to my Instructables article. So guys today we are going to make a " Table Edge Avoiding Robot ".

Let me first tell you about the main working principle of this robot:

This car uses a very easy working principle as follows:

The transmitter of the car contains gyroscopic sensors which track our hand's gestures and transmit the signal to the receiver of the car and then the car works accordingly to it. Like when I turn my hand left, the car will go towards the left, similarly, when I turn my hand forward, the car goes forward and it goes so on...

If you have not understood its working principle then take a look at the whole tutorial you might then understand it...

Special thanks to PCBWay for providing me with their high quality PCBs.

So let's get started with the project :-)

Step 1: β€‹πŸš€ Materials Required:

International:

(Amazon)

β€’ Arduino Uno: https://amzn.to/3zJpqrU

β€’ L298D Motor Driver Ic: https://amzn.to/3lYOohe

β€’ MPU 6050: https://amzn.to/3m0P061

β€’ Arduino Nano: https://amzn.to/3Gz1tXR

β€’ nRF24Lo1+: https://amzn.to/3N56FFp

β€’ Gear Motor: https://amzn.to/3zJpqrU

β€’ Rubber Wheel: https://amzn.to/3zJpqrU

β€’ Battery Holder: https://amzn.to/3zJpqrU

β€’ Battery: (Get it in old power bank)

India:

(Quartz Components)

β€’ Arduino Uno: https://bit.ly/3cOLKX2

β€’ L298D Motor Driver Ic: https://bit.ly/38w2eEA

β€’ MPU 6050: https://bit.ly/3GygIQY

β€’ Arduino Nano: https://bit.ly/3lYIyMO

β€’ nRF24Lo1+: https://bit.ly/3t4A4Ym

β€’ Gear Motor: https://bit.ly/3cOLKX2

β€’ Rubber Wheel: https://bit.ly/3cOLKX2

β€’ Battery Holder: https://bit.ly/3cOLKX2

β€’ Battery: https://bit.ly/3cOLKX2

Step 2: Making of the Chassy :

~ So for making the chassis I am using cardboard which is cut into the size of 10*14 cm.

~ Then we need a gear motor 4pcs.

~ We will stick the motor with the cardboard using the hot glue gun.

~ We move into the wiring of the motors, the wiring will go in this way, we will solder the wires to the motors "+" and "-" terminals. As shown in the above image.

~ We will require a rubber wheel (4pcs) for the motor.

~ Put the rubber wheel in the gear motors. As shown in the above images.

~ Then our chassis is ready.

let's move into the next step...

Step 3: Making of the Circuit and Then Converting It Into PCB.

In this project, I am using a custom-designed circuit board to give more professional touch. So I choose PCBWay to design and order the custom-designed PCB for this project.

β€’ Circuit Schematic & Gerber File (Transmitter): https://bit.ly/3z9FzZQ

β€’ Circuit Schematic & Gerber File (Receiver): https://bit.ly/3lZOOUI

About PCBWay:

With more than a decade in the field of PCB prototype and fabrication, They are committed to meeting the needs of their customers from different industries in terms of quality, delivery, cost-effectiveness, and any other demanding requests. As one of the most experienced PCB manufacturers in China, They pride themselves to be the best business partners as well as good friends in every aspect of our PCB needs.

They provide 2 layers of PCB just for $5, they also provide 4-6 layers of PCB manufacturing as well as SMT and STENCILS Service at very low cost and their other services are CNC and 3D Printing.

Make sure to visit their website PCBWay.com .

Step 4: Mounting the Components to the PCB:

In this step, we will mount the component to the PCBs that we ordered from PCBWay.com .

β€’ Mount the nRF24Lo1+, L298D Motor driver IC and 7805 Voltage Regulator to the Receivers PCB.

β€’ Mount the nRF24Lo1+, Arduino nano, and MPU 6050 to Transmitter PCB.

β€’ Then mount the receiver's PCB to Arduino Uno as shown on the image.

So, that's all in this step, lets's move forward with the next step...

Step 5: Mounting the Transmitter PCB to the Chassy and Connecting the Motor Wire to PCB

Follow to steps:

β€’ In this step, you need to mount the transmitter PCB to the Chassy, and

β€’ then you need to connect the Motors wires to the Transmitter PCB as shown in the image.

let's move to the next step...

Step 6: Mounting the Battery Holder and ​Receive PCB;

Follow to steps:

β€’ Now in this step, you need to mount the Battery Holder to the Chassy of the car as shown in the image.

β€’ Now we will mount the Transmitter PCB with the double-sided tape to the Cardboard-made wristwatch as shown in the image.

let's move to the next step...

Step 7: Time to Upload the Sketch.

~ Now connect the USB cable to the Arduino Nano.

~ Then upload the following code to Arduino nano using Arduino IDE:

//Arduino Gesture control Transmitter Code
//Created By DIY Burner
//Contact me here <a href="https://www.instagram.com/diy_burner/" rel="nofollow"> https://www.instagram.com/diy_burner/
</a>
//You need to include MPU6050.h and I2CDEV.h library before uploading the sketch, otherwise you'll get compilation error message.

#include <SPI.h>        //SPI library for communicate with the nRF24L01+
#include "RF24.h"       //The main library of the nRF24L01+
#include "Wire.h"       //For communicate
#include "I2Cdev.h"     //For communicate with MPU6050
#include "MPU6050.h"    //The main library of the MPU6050


MPU6050 mpu;
int16_t ax, ay, az;
int16_t gx, gy, gz;

//Define packet for the direction (X axis and Y axis)
int data[2];

//Define object from RF24 library - 9 and 10 are a digital pin numbers to which signals CE and CSN are connected.
RF24 radio(8,9);

//Create a pipe addresses for the communicate                                    
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void){
  Serial.begin(9600);
  Wire.begin();
  mpu.initialize();              //Initialize the MPU object
  radio.begin();                 //Start the nRF24 communicate     
  radio.openWritingPipe(pipe);   //Sets the address of the receiver to which the program will send data.
}

void loop(void){
  
  //With this function, the acceleration and gyro values of the axes are taken. 
  //If you want to control the car axis differently, you can change the axis name in the map command.
  mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

  //In two-way control, the X axis (data [0]) of the MPU6050 allows the robot to move forward and backward. 
  //Y axis (data [0]) allows the robot to right and left turn.
  data[0] = map(ax, -17000, 17000, 300, 400 ); //Send X axis data
  data[1] = map(ay, -17000, 17000, 100, 200);  //Send Y axis data
  radio.write(data, sizeof(data));
}<br>

~ Now connect the USB cable to the Arduino Uno.
~ Then upload the following code to Arduino Uno using Arduino IDE:

//Arduino Gesture control Receiver Code
//Created By DIY Burner
//Contact me here https://www.instagram.com/diy_burner/
//You need to include RF24.h library before uploading the sketch, otherwise you'll get compilation error message.

#include <SPI.h>      //SPI library for communicate with the nRF24L01+
#include "RF24.h"     //The main library of the nRF24L01+

//Define enable pins of the Motors
const int enbA = 2;
const int enbB = 7;

//Define control pins of the Motors
//If the motors rotate in the opposite direction, you can change the positions of the following pin numbers
const int IN1 = 3;    //Right Motor (-)
const int IN2 = 4;    //Right Motor (+)
const int IN3 = 5;    //Left Motor (+)
const int IN4 = 6;    //Right Motor (-)

//Define variable for the motors speeds
//I have defined a variable for each of the two motors 
//This way you can synchronize the rotation speed difference between the two motors
int RightSpd = 130;
int LeftSpd = 150;

//Define packet for the direction (X axis and Y axis)
int data[2];

//Define object from RF24 library - 9 and 10 are a digital pin numbers to which signals CE and CSN are connected
RF24 radio(8,9);

//Create a pipe addresses for the communicate
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(){
  //Define the motor pins as OUTPUT
  pinMode(enbA, OUTPUT);
  pinMode(enbB, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
  
  Serial.begin(9600);
  radio.begin();                    //Start the nRF24 communicate            
  radio.openReadingPipe(1, pipe);   //Sets the address of the transmitter to which the program will receive data.
  radio.startListening();             
  }

void loop(){
  if (radio.available()){
    radio.read(data, sizeof(data));

    if(data[0] > 380){
      //forward            
      analogWrite(enbA, RightSpd);
      analogWrite(enbB, LeftSpd);
      digitalWrite(IN1, HIGH);
      digitalWrite(IN2, LOW);
      digitalWrite(IN3, HIGH);
      digitalWrite(IN4, LOW);
    }
    
    if(data[0] < 310){
      //backward              
      analogWrite(enbA, RightSpd);
      analogWrite(enbB, LeftSpd);
      digitalWrite(IN1, LOW);
      digitalWrite(IN2, HIGH);
      digitalWrite(IN3, LOW);
      digitalWrite(IN4, HIGH);
    }
     
    if(data[1] > 180){
      //left
      analogWrite(enbA, RightSpd);
      analogWrite(enbB, LeftSpd);
      digitalWrite(IN1, HIGH);
      digitalWrite(IN2, LOW);
      digitalWrite(IN3, LOW);
      digitalWrite(IN4, HIGH);
    }

    if(data[1] < 110){
      //right
      analogWrite(enbA, RightSpd);
      analogWrite(enbB, LeftSpd);
      digitalWrite(IN1, LOW);
      digitalWrite(IN2, HIGH);
      digitalWrite(IN3, HIGH);
      digitalWrite(IN4, LOW);
    }

    if(data[0] > 330 && data[0] < 360 && data[1] > 130 && data[1] < 160){
      //stop car
      analogWrite(enbA, 0);
      analogWrite(enbB, 0);
    }
  }
}<br>

Step 8: All Set, Now It's Time to Test It.

After done with uploading the code. Just put the battery into the Battery Holder and 9v Battery to the receiver PCB and enjoy the project.

Watch our YouTube video to see its testing video. Watch Now!

Step 9: We're Done Now:

We're Done Now. I hope you like my project and if you have any queries then leave your comments here, I will surely help you with it or if you have any idea of any new type of project then please comment here I will be definitely making it.

I'll keep updating this instructable.

For Business or Promotion Query e-mail me on: Email

Thanks for watching the project, I hope you liked this project, if you did then please follow me I'll keep posting awesome new projects. Also, don't forget to SUBSCRIBE to my YouTube channel. (YouTube: DIY BURNER)