EBot8 Object Following Robot

Have you ever wondered to make a robot that follows wherever you go? But just couldnā€™t?

Wellā€¦ Now you can! We present you the object following robot! Go for this tutorial,like and vote and maybe you can do it too!!

Step 1: Gather the Materials

To make this amazing simple project. We need the following parts to proceed:

  • Ebot8 Board
  • Programming cable
  • Female to male Jumper cables
  • Ultrasonic Sensors.
  • Chassis{w/ chassis}
  • 2 DC Motors

All of these materials can be found overĀ here.

Step 2: Wiring

After you have collected the materials fromĀ here.Now connect the Ultrasonic Sensors to the EBot Board{A0-A1} color coded properly. If you have done that, Letā€™s get on with codinā€™.

Step 3: Debugging

Now to make sure our Infrared sensors are working perfectly we need to debug it which means to identify and remove errors from (computer hardware or software).

  1. Open up your EBot Blockly app on your computer.
  2. Select Input Readings/Debug.
  3. Select from the drop down list- ā€˜Infrared Sensorā€™.
  4. Select the pin in which your first Infrared Sensor is fitted upon. (P.S. you can only check one sensor at a time.)
  5. Click ā€˜Debugā€™.
  6. Do the same for the second sensor.
  7. After the downloading is complete and showing values from both the sensors, we can proceed with coding.

(Note:
If the debugging encountered with an error, try again, check the connection. If not, then replace the sensor and try again.)

Step 4: Coding

Now you can simply go ahead and copy our code from here or copy the blockly code. Though we recommend the blockly method as shown n the picture as its easier to understand

//Code_for_object_following_robot

#define ultrasound(x) ({analogRead(x)*0.833}/4)<br>
#include "Ebot.h"
void setup{}
{
    //Initialisations
    ebot_setup{};
        
    //Pin Modes
    pinMode {A0, INPUT};
    pinMode {A1, INPUT};
} 
void loop{}
{
    if(ultrasound(A0)>=30 && ultrasound(A0)<=200)
    {
      LMotor_1(0);
      RMotor_1(0);
    }
    else
    {  LMotor_1(10);
       RMotor_1(-5);
    }
    if(ultrasound(A1)>=30 && ultrasound(A1)<=200)
    {
      LMotor_1(0);
      RMotor_1(0);
    }
    else
    {  LMotor_1(-5);
       RMotor_1(10);
    }

Step 5: Demo

Did you like it? Yes, I know. We will continue to make more interseting & fun projects just for you guys!

https://youtu.be/FLRjK51FsZY

Feel free to comment any ideas in the comments section and we will surely respond.

Source: EBot8 Object Following Robot


About The Author

Muhammad Bilal

I am a highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Leave a Comment

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

Scroll to Top