You are on page 1of 15

Human following robot

Under supervision

Dr/ Mohamed Tawfik


Eng/ Bahy gabra
‫‪TEAM‬‬

‫‪sec‬‬ ‫‪ID‬‬ ‫‪Name‬‬ ‫‪Number‬‬

‫‪4‬‬ ‫‪210202‬‬ ‫محمود عاطف الكيالني‬ ‫‪1‬‬


‫‪4‬‬ ‫‪210214‬‬ ‫مصطفي احمد رمضان‬ ‫‪2‬‬
‫‪4‬‬ ‫‪210219‬‬ ‫مصطفي مدحت بدر‬ ‫‪3‬‬
‫‪3‬‬ ‫‪210198‬‬ ‫محمود ربيع عبدالعظيم‬ ‫‪4‬‬
‫‪4‬‬ ‫‪210238‬‬ ‫يوسف رمضان يوسف‬ ‫‪5‬‬
‫‪2‬‬ ‫‪210151‬‬ ‫علي حسن زكي‬ ‫‪6‬‬
‫‪3‬‬ ‫‪210165‬‬ ‫محمد خالد محمد‬ ‫‪7‬‬
‫‪2‬‬ ‫‪210121‬‬ ‫علي خالد محمد‬ ‫‪8‬‬
‫‪4‬‬ ‫‪210287‬‬ ‫هاني شوقي علي‬ ‫‪9‬‬
‫‪3‬‬ ‫‪210187‬‬ ‫محمد قرني محمد‬ ‫‪10‬‬
HUMAN FOLLOWING ROBOT

INTRODUCTION
In this high technology, a robot must be able to detect and follow humans. A robot that can detect
.” and follow human or obstacle within a specific range is called “ Human Following Robot
Robots are used to change people's lives and make people's life luxurious. A robot that can use
in shopping time which carries items, and follow human without any remote more useful.A
robot that can use in the hospital to bringing medicine with more accuracy and fast. The human
following robot has many works like work as trolley,strecture in hospital, and a small basket
.with a car and so on
METHOD OF INSTALLATION

we need only one rectangular plate, on which lower side should be glued the
engines, and on the upper surface are mounted other elements. You can use
discontinued L293D motor driver shield like in my case, but also and Adafruit
motor shield as is presented on the schematic diagram without any changes.

The principle of object detection and monitoring is based on data accepted by both
sensors. The ultrasonic sensor detects the presence of an object in front of it within
certain limits, in our case between 10 and 30 centimeters. If there is no object (for
example our hand) in this space, all four engines are idle.
METHOD OF INSTALLATION

At the moment when an object appears in this space, the data from the infrared
sensors are read, and based on the obtained data, commands are given to the
motors, whereby the robot moves in the desired direction. The distance to which the
infrared sensors respond is adjusted by a small triming potentiometer. This distance
should be adjusted so that it is slightly larger than the minimum distance to which
the ultrasonic sensor is set to respond, in our case it is more than 10 centimeters.
you can see what this looks like in reality, just to mention that the smooth
movement of the robot takes some time to adjust the distances in the code as well
as the way the hand moves.
COMPONENTS REQUIRED

 Arduino Uno  4 wheel


 Arduino Motor Driver shield  Chassis
 Jumper wires  Ultrasonic sensor
 4 BO motors  IR Sensor (2x)
 Hook up wires  on-off switch
 Li-on Battery 18650 (2x) 5000 mAh  servo motor
 Battery Holder 18650  Ultrasonic sensor holder
COMPONENTS REQUIRED
CIRCUIT DIAGRAM
HOW DOES IT WORK

When you come near to the robot starts to follow you there are 4 wheels in the robot and 4 motors
attached to the chassis. now there are three sensors on the robot one is an ultrasonic sensor and
two IR sensor which arranges like two sensors left and right to the ultrasonic sensor. and when
you put your hand near to the ultrasonic sensor the robot will start forward.
If you turn your hand to the left side the Arduino robot moves on the left side, and if you put
your hand in the right the robot will move in the right direction. so, how the whole system works
we will talk about this.
when you put your hand in from of the ultrasonic sensor then the sensor detects you and sends
this information to the Arduino. there is some distance prefix in the Arduino so if your hand is
away from the sensor it will not read that. and if your hand is near to the sensor it will read it.
HOW DOES IT WORK

Now Arduino knows that there is something in front of the sensor and Arduino send some
instruction to the motor driver and motor driver trigger the motors. and the Arduino robot
starts to move forward we need to run all motor forward.
Now, what about the sensors. Ir sensor works on infrared light which can also detect the
object near to it. so there is two IR sensor one is at the left side of ultrasonic sensor and
other is at the right side of the ultrasonic sensor. when anything comes near to the left
sensor Arduino got the information that there is something is near to the left sensors and
according to the code, the robot will turn to the left. and the same process for the right
sensor. so this is how the human following robot works.
Here are giving all the steps to make this awesome project.
STEPS

 Step 1: Collect All the Necessary Parts.


 Step 2: hot glue the motors and the wheels to the base and let them dry.
 Step 3: take the arduino uno and place it on top of the base and stick it . after
that take the motor driver and adjust the pins on top of the arduino board .
connect the wires from the motors to the motor driverleaving a gap of 1 space
between every motor on the side of the motor driver (see the photo above).
 Step 4: add the servo motor to the front of the base as shown in the above
picture.
 Step 5: take an acrylic piece and try to bend it using flame to make it in the
above shape and make two holes in the bottom.
STEPS

 Step 6: screw the acrylic piece to the servo motor top using screws and it
should look something like the above picture
 Step 7: now take an small rectangular acrylic sheet with big holes and add
the ultrasonic sensor into the hole and add the two infrared sensor to the
two sides of the rectangular sheet and it should look like the above picture
 Step 8: now add the battery case to to below portion of the base and
connect it to the arduino to power it up . use this circuit diagram to wire
them all properly and this code in arduino to activate it
 Step 9: now play with it as much as you want or wish to it will follow you
every where no matter where you go (except for the bathroom)
CODE

{
#include<NewPing.h> for(pos = 90; pos <= 180; pos += 1){
#include<Servo.h> myservo.write(pos);
#include<AFMotor.h> delay(15);
#define RIGHT A2 } for(pos = 180; pos >= 0; pos-= 1) {
#define LEFT A3 myservo.write(pos);
#define TRIGGER_PIN A1 delay(15);
#define ECHO_PIN A0 }for(pos = 0; pos<=90; pos += 1) {
#define MAX_DISTANCE 250 myservo.write(pos);
delay(15);
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); }
AF_DCMotor Motor1(1,MOTOR12_1KHZ); }
AF_DCMotor Motor2(2,MOTOR12_1KHZ); pinMode(RIGHT, INPUT);
AF_DCMotor Motor3(3,MOTOR34_1KHZ); pinMode(LEFT, INPUT);
AF_DCMotor Motor4(4,MOTOR34_1KHZ); }
Servo myservo; void loop() {
int pos =0; // put your main code here, to run repeatedly:
void setup() {
// put your setup code here, to run once: delay(50);
Serial.begin(9600); unsigned int distance = sonar.ping_cm();
myservo.attach(10); Serial.print("distance");
Serial.println(distance);
CODE

int Right_Value = digitalRead(RIGHT); Motor1.setSpeed(250);


int Left_Value = digitalRead(LEFT); Motor1.run(FORWARD);
Motor2.setSpeed(250);
Serial.print("RIGHT"); Motor2.run(FORWARD);
Serial.println(Right_Value); Motor3.setSpeed(150);
Serial.print("LEFT"); Motor3.run(BACKWARD);
Serial.println(Left_Value); Motor4.setSpeed(150);
Motor4.run(BACKWARD);
if((Right_Value==1) && (distance>=10 && }else if((Right_Value==1)&&(Left_Value==0)) {
distance<=30)&&(Left_Value==1)){ Motor1.setSpeed(150);
Motor1.setSpeed(160); Motor1.run(BACKWARD);
Motor1.run(FORWARD); Motor2.setSpeed(150);
Motor2.setSpeed(160); Motor2.run(BACKWARD);
Motor2.run(FORWARD); Motor3.setSpeed(250);
Motor3.setSpeed(160); Motor3.run(FORWARD);
Motor3.run(FORWARD); Motor4.setSpeed(250);
Motor4.setSpeed(160); Motor4.run(FORWARD);
Motor4.run(FORWARD);
}else if((Right_Value==0)&&(Left_Value==0)) {
}else if((Right_Value==0) && (Left_Value==1)) {
CODE

Motor1.setSpeed(150); }else if(distance > 1 && distance < 10) {


Motor1.run(FORWARD);
Motor2.setSpeed(150); Motor1.setSpeed(0);
Motor2.run(FORWARD); Motor1.run(RELEASE);
Motor3.setSpeed(250); Motor2.setSpeed(0);
Motor3.run(FORWARD); Motor2.run(RELEASE);
Motor4.setSpeed(250); Motor3.setSpeed(0);
Motor4.run(FORWARD); Motor3.run(RELEASE);
}else if((Right_Value==1)&&(Left_Value==1)) { Motor4.setSpeed(0);
Motor4.run(RELEASE);
Motor1.setSpeed(0); }
Motor1.run(RELEASE); }
Motor2.setSpeed(0);
Motor2.run(RELEASE);
Motor3.setSpeed(0);
Motor3.run(RELEASE);
Motor4.setSpeed(0);
Motor4.run(RELEASE);

You might also like