How to make Human Following Robot or Object Following Robot

 

Are you are a Robotics Lover?

Robotics is an interdisciplinary sector of science and engineering dedicated to the design, construction and use of mechanical robots. Our guide will give you a concrete grasp of robotics, including different types of robots and how they're being applied across industries.
 
 
What is a Robot?
 
Robots are used more and more to change people's life. In recent times, some robots have found their place in houses. Those robots are specific ones as for example robotic vacuum cleaners. The next step in robotics' evolution is to make people live with robots in everyday life. 

 

 

Having a robot assistant surely seems like a dream for most of us. A robot that can help us carry items, accompany us at shopping malls, or during a jogging session at the park. A
robot that can help nurses at hospital, or bringing the medical supplies during war to injured soldiers. There are so many advantages of having such robot, that in the future, it will most likely be the trends.
 
 

What is Human Following Robot?

This project attempts to make a robot that will follow the human or objects. For this Infrared sensors are used to move robot left and right and ultrasonic sensor is used to move robot forward and backward.

 

The brain of this robot is microcontroller Arduino Uno. The robot is driven by DC gear motors to control the movement of the wheels. The Arduino Uno interface is used to perform and implement algorithms to control the speed of the motors, steering the robot to travel smoothly.
 

The main motive of designing such type of robot is that technology can be made so much convenient that it will makes our lives better. If we utilize this technology in the car or any conveyance it will automatically sense the obstacles, then it will take a side of the available free space and we can drive safely.

 

 


 

 
If you want to simulate this Human Following Robot on Proteus then watch this video :  

 

 


 

 

Watch the whole video to make this project at home.

It used 2 IR sensors and an ultrasonic sensor. IR sensors used to follow the human or object and ultrasonic sensor is used to move back the robot.

 

 


 

 

Give me feedback or suggestions you want to give to my YouTube channel.

https://studio.youtube.com/channel/UCaXI2PcsTlH5g0et67kdD6g


If you want to buy components, visit Amazon India links:-


Parts List:-


1. Arduino Uno :https://amzn.to/3p2Ez2B
 
2. IR sensors : https://amzn.to/2zMRwID
 
3. Ultrasonic sensor : https://amzn.to/2BpUTW5
 
 
5. servo motor : https://amzn.to/2V2CWnL
 
6. L293D motor driver shield : https://amzn.to/37HvbZk
 
7. Jumper wires : https://amzn.to/2YPOYBY
 
8. 18650 Battery ( 2 pieces ) : https://amzn.to/3p5a5wO



📌Circuit Diagram :-

 

 


 

 

💻Code


 

// www.YouTube.com/Electronics is Fun //


#include<Servo.h>

#include<AFMotor.h>

#define LEFT A0

#define echopin A1 // echo pin

#define trigpin A2 // Trigger pin

#define RIGHT A3


AF_DCMotor Motor1(1,MOTOR12_1KHZ);

AF_DCMotor Motor2(2,MOTOR12_1KHZ);

AF_DCMotor Motor3(3,MOTOR34_1KHZ);

AF_DCMotor Motor4(4,MOTOR34_1KHZ);


Servo myservo;

 

int pos =0;

long time;


void setup(){


Serial.begin(9600);

myservo.attach(10);


for(pos = 90; pos <= 180; pos += 1){

myservo.write(pos);

delay(15);

}

 

for(pos = 180; pos >= 0; pos-= 1) {

myservo.write(pos);

delay(15);

}


for(pos = 0; pos<=90; pos += 1) {

myservo.write(pos);

delay(15);

}


pinMode(RIGHT, INPUT);

pinMode(LEFT, INPUT);


pinMode(trigpin, OUTPUT);

pinMode(echopin, INPUT);


}


void loop(){

unsigned int distance = read_cm();


int Right_Value = digitalRead(RIGHT);

int Left_Value  = digitalRead(LEFT);


Serial.print("R= ");

Serial.print(Right_Value);

Serial.print(" L= ");

Serial.print(Left_Value);

Serial.print(" D= ");

Serial.println(distance);


     if((Right_Value==1) && (distance>=10 && distance<=30)&&(Left_Value==1)){forword();}

else if((Right_Value==0) && (Left_Value==1)){turnRight();}

else if((Right_Value==1) && (Left_Value==0)){turnLeft();}

else if((Right_Value==1) && (Left_Value==1)){stop();}

else if(distance > 5 && distance < 10){stop();}

else if(distance < 5){backword();}


delay(50);

}


long read_cm(){

  digitalWrite(trigpin, LOW);

  delayMicroseconds(2);

  digitalWrite(trigpin, HIGH);

  delayMicroseconds(10);

  time = pulseIn (echopin, HIGH);

  return time / 29 / 2;

}


void forword(){// turn it on going forward

Motor1.setSpeed(120);

Motor1.run(FORWARD);

Motor2.setSpeed(120);

Motor2.run(FORWARD);

Motor3.setSpeed(120);

Motor3.run(FORWARD);

Motor4.setSpeed(120);

Motor4.run(FORWARD);

}


void backword(){ // the other way

Motor1.setSpeed(120);

Motor1.run(BACKWARD); 

Motor2.setSpeed(120);

Motor2.run(BACKWARD);

Motor3.setSpeed(120);

Motor3.run(BACKWARD); 

Motor4.setSpeed(120);

Motor4.run(BACKWARD); 

}


void turnRight(){ // the other right

Motor1.setSpeed(200);

Motor1.run(FORWARD);

Motor2.setSpeed(200);

Motor2.run(FORWARD);

Motor3.setSpeed(100);

Motor3.run(BACKWARD);

Motor4.setSpeed(100);

Motor4.run(BACKWARD);

}


void turnLeft(){ // turn it on going left

Motor1.setSpeed(100);

Motor1.run(BACKWARD);

Motor2.setSpeed(100);

Motor2.run(BACKWARD);

Motor3.setSpeed(200);

Motor3.run(FORWARD);

Motor4.setSpeed(200);

Motor4.run(FORWARD);

}


void stop(){ // stopped

Motor1.setSpeed(0);  

Motor1.run(RELEASE);

Motor2.setSpeed(0);

Motor2.run(RELEASE);

Motor3.setSpeed(0);

Motor3.run(RELEASE);

Motor4.setSpeed(0);

Motor4.run(RELEASE);  

}

 
If you have any query regarding this project, Contact me from below :

Telegram +919557024177
Instagram id : eif.08
Facebook page  : EIF08
 

Post a Comment

1 Comments

  1. This is not the code you used during simulation, right?

    ReplyDelete