Follow Me Robot

About This Project
Here, you will learn how to make an autonomous robot which will follow the object in front of it.
Project Info
Estimated Time Required: 2 Hrs
Programming Platform:
Difficulty:

Introduction

We will move forward and design our first autonomous robot. This robot will follow any object coming in front of it within a range of 5-10 cm. We will be using two IR sensors (proximity sensors), which will detect objects in front of them and send a signal to the robot. Both sensors will be attached in the front of the robot, one on the left side and one on the right side.FollowMeRobot

Components Required

ImageComponentQuantityAvailable in Kit
evive1
Acrylic Part: Base Plate1
BO Motor Mount2
Dual Shaft BO Motor2
M3 bolts of 8 mm Length7
M3 bolts of 25mm Length4
M3 bolts of 12mm Length7
M3 Nuts10
BO Wheel2
Caster Wheel1
IR Sensor2

Building Guide

Step 1: Assembly

The annotated base is shown on right. This is the bottom side. There is the evive logo on the top side for your reference. So be careful while using the base.chassis_base

  • Fix the motor mounting brackets to the chassis using M3 bolts of 8mm length and M3 nuts.motor mounting brackets
evive Alert
The motor wires should be inside, otherwise, they will collide with the wheel. Also, while assembling the robot, be careful about the holes you are using. Also, fasten all the nuts and bolts tightly for smooth functionality.
  • Attach the two motors, one to each bracket, side by side and fasten using M3 bolts of 25mm length and M3 nuts.attaching_motor
  • Now, fit the wheels into the protruding motor shafts.attaching_wheels
  • We’ll attach the Castor wheel now. First, we will mount the M3 standoffs (20 mm) on which the Castor will be attached. Fasten the standoffs to the chassis using M3 bolts of 8mm length.
  • Place the Castor on top of the standoffs in the configuration shown and fasten using M3 bolts of 12 mm length.attaching_castor
evive Notes Icon
Keep in mind, that what we have assembled so far (motors and castor) will be pointing downwards.
  • Flip the assembly and place evive on the top of the chassis.placing_evive
  • Using the holes on the back of evive fasten it to the chassis using M3 bolts of 12mm length.Fastening evive
  • We will now attach 2 IR sensors onto the front of the robot.
  • Screw the sensors onto the top side of the base as shown in the figure above using an M3 bolt of 12mm length and M3 nuts.attaching_IR_Sensor

Step 2: Circuitry of the Robot

Connect the motors and IR sensor wires as shown in the figure on the next page. Be careful while connecting the IR sensors (Note that VCC  is 5V).

Follow Me Robot Both Senors Circuit Diagram

Step 3: Calibrating IR Sensor

We are using an IR sensor to detect objects in front of the robot. An IR sensor has two small LED indicators. One is for power, which is ON all the time, the sensor is powered. The other LED is the signal LED which tells whether there is an object in front of it or not. There are two states for the sensor:

  • Signal LED is ON (Active): When the
    sensor detects the object in front of it.
  • Signal LED is OFF (Inactive): When the
    sensor does not detect the object.

IR sensorWe have to calibrate both the sensors, such that it can detect the object in front of it.

To calibrate your sensor, switch ON your evive. Keep everything at least 15 cm away from the sensors. If the signal LED is OFF, then your sensor is OK for now, otherwise gently turn the potentiometer knob on the sensor in anti-clockwise direction using a screwdriver, such that the LED turns OFF.

Place an object in front of the sensor at about 5cm. The signal LED should turn ON. If it is not ON, gently turn the potentiometer in a clockwise direction, such that the LED turns ON when the object is in front of it and stays OFF otherwise.

Step 4: Logic and Flowchart

Our robot can execute four actions:

  • Go Straight
  • Turn Left
  • Turn Right
  • Stop or Brake

Now, we have to decide how to make the robot follow any object. This will depend on the state of both the IR sensors.

If both the sensors are active (object in front), then the robot should move forward to follow the object. If only the left sensor is active (object on the left), then the robot should turn left. If only the right sensor is active (object on the right), then the robot should turn right. If both the sensors are inactive, the robot should be stopped (brake).

follow the enemy flowchart

 

Step 5: Scratch Script

We are now going to create Scratch Scripts to generate code.

evive Notes Icon
We will be using Arduino and evive Inbuilt function extension from the Robot Palette. So, make sure you have these in mBlock.
 
Let us follow the steps:
  • Create blocks GoStraight, TurnRight, TurnLeft and Brake.GoStraightTurnLeftBrake
  • Go to Robot palette, then evive Inbuilt function extension and drag-drop evive Program hat block into the scripting area.
  • Drag and snap the forever block from the Control palette below evive Program.
  • We will use the if-else block to perform an action depending on the state of both the sensors.
evive Notes Icon
When the sensor is active, the output received in evive is 0V or LOW otherwise the output is 5V or HIGH. Hence, we will use not block to reverse the state of the sensor i.e. if the sensor is active, then the not block gives HIGH.
 
  • Finally, snap a wait block with 0.05 secs value at the end of forever block to make the robot stable. The script is ready and you can directly upload it onto evive from Arduino mode.FollowMeRobot

Your robot is ready to follow you everywhere and anywhere you like!

Step 6: Debugging the Robot

At times, your robot will refuse to behave the way you are commanding it to. Let’s fix this. If upon pressing forward, your robot starts moving backward or starts turning, that means at least one motor is rotating in the wrong direction. You can fix this by reversing the direction of that motor.

Exchanging Wiring

Your forward-backward controls shall now work perfectly. If the robot turns left upon pressing left and right upon pressing right, your robot is good to go. If it turns right upon pressing left, you can fix this by exchanging wires of both the motors. Ask an elder for help, if you need.

Exchanging Motor Wiring

Step 7: Explore Starter Kit Courses

A series of exciting online courses through the world of STEM that cover not only the ‘whys’ but also the ‘hows’. They introduce you to the wonders of electronics, programming, science, latest technologies such as robotics, the Internet of Things, 3D printing, and many more!

Introduction to Electronics
ELECTRONICS
Introduction to Programming
PROGRAMMING
robotics img
ROBOTICS

Circuit Diagram

DescriptionCircuit Diagram

Connect the motors and IR sensor wires as shown in the figure on the next page. Be careful while connecting the IR sensors (Note that VCC  is 5V).

Code

DescriptionDownload Code
Follow Me Robot Scratch ProgramDownload
Share this Project
Facebook
Twitter
Google+
Pinterest
Reddit
Print
Related Projects
Featured Projects
Unique-Christmas-Tree

DIY Unique Christmas Tree

This project will show you how to make a unique DIY Christmas Tree for this year’s Christmas.

All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart

ATV Tank Small

Subscribe toour newsletter!

We publish new projects every Tuesday & Friday.
Be the first one to get notified.