Human Following Robot

Human Following Robot

A human following robot is a type of mobile robot that can follow a designated person or object, typically using computer vision and advanced algorithms. This type of robot is becoming increasingly popular due to its potential to revolutionize the way people interact with technology, from providing assistance and security to performing tasks and making life easier.

The development of human following robots has been made possible by rapid advancements in technology, such as machine learning and computer vision. These advancements have allowed the creation of sophisticated algorithms that can analyze images and track a designated person or object, even in complex and cluttered environments.

One of the key components of a human following robot is its camera, which is used to capture images of the designated person or object. The images are then processed by the robot’s computer vision algorithms, which identify specific features, such as a person’s face or a particular object, and track their movement.

Human Following Robot

Once the designated person or object has been identified and tracked, the robot can then be programmed to follow them. This can be achieved through a combination of sensors and actuators, such as motors and wheels, which allow the robot to move and maintain a certain distance from the designated person or object.

Another important component of a human following robot is its ability to avoid obstacles. This can be achieved using sensors such as infrared or ultrasonic sensors, which can detect objects in the robot’s path and cause it to change direction or stop.

There are many potential applications for human following robots, from security and surveillance to healthcare and retail. For example, in a security setting, a human following robot could be used to follow and monitor a designated person, while in a healthcare setting, it could be used to assist and care for patients.

Circuit Diagram

Human Following Robot

Code

#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); 
}

Human Following Robot

In conclusion, human following robots represent an exciting new development in the field of robotics and have the potential to revolutionize the way people interact with technology. With the continued advancements in computer vision and machine learning, the development of human following robots will only continue to advance, providing us with new and innovative ways to interact with technology and make our lives easier.

Add a Comment

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