DIY Follow Me Robot

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

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.

Components Required

ImageComponentQuantityAvailable in Kit
evive1
PictoBlox1
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.

We will be writing the code in PictoBlox.

Let us follow the steps:
  • Create blocks GoStraight, TurnRight, TurnLeft and Brake.Go StraightTurn RightTurn LeftBrake
  • Select the Upload mode from menu bar.  Then, select evive as your Board and load the evive, Actuators, and Display extensions.
  • Drag and drop the evive starts up hat block into the scripting area. Drag and drop the forever block below it.
  • We will use if-else block to define actions depending on the state of both the sensors. Drag and drop an if-else block inside forever block. First, we will check if both sensors are active. We will use the not and and block from the operator palette for the same. Below the if arm, place the Go Straight block. Below the else arm, place another if-else block to check for further conditions.
  • In the second if-else block, we will check if only the left sensor is active. If the condition is true, the robot must turn left. For that, drag and drop the Turn Left block below the if arm. Drag and drop another if-else block below the else arm.
  • Now, we will check if only the right sensor is active. If this condition is true, the robot must turn right. For that, drag and drop the Turn Right block below this if arm. If none of the above conditions is true, the robot must stop. For that, drag and drop Brake block below the else arm.
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 to evive.Follow Me Robot

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.

 

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.

 

Step 7: Conclusion

With this, your new age pet is all set to accompany you wherever you go!

Did you know that we’ve reached 112% of our goal within a week into our campaign? Isn’t that amaaazing?! To know what’s making this campaign a huge success, visit HERE!

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 RobotDownload
Share this Project
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Featured Projects
Arcade-Basketball-Game

DIY Arcade Basketball Game

Introduction“We don’t stop playing because we grow old; we grow old because we stop playing.”…
All articles loaded
No more articles to load
Close Menu
×

Cart