Make: Projects

The Stalker ‘Bot

Using ultrasonic sensors and an Arduino microcontroller, learn to build a robot that can follow a moving object..or even a person!

The Stalker ‘Bot

Gather the parts and follow the basic instructions and you can have a robot capable of following moving objects! With basic coding experience, you can also change the distance at which the robot senses moving objects or the speed the robot moves.

In order to do this project, a basic robot must be built that runs off of two 3-wire VEX servos. A good robot to build is the VEX Squarebot. Instructions for building this can be downloaded from PDF here or with any VEX robotics kit.



Step #1: Attaching the Ultrasonic Sensors

The Stalker ‘BotThe Stalker ‘BotThe Stalker ‘BotThe Stalker ‘Bot
  • Attach the ultrasonic sensors to the front of the robot side by side
  • Use two screws per ultrasonic sensor, putting nuts on the back to hold the sensor onto the robot
  • Use an allen wrench to spin the screws in
  • Make sure the ultrasonic sensors are facing up with the VEX lettering on the bottom
  • By adjusting the distance between the sensors, you can adjust how big of an object the robot will follow (a larger distance follows a larger object)

Step #2: Attaching Electrical Components

The Stalker ‘BotThe Stalker ‘BotThe Stalker ‘Bot
  • Attach the following components to the robot, holding them down securely:
  • breadboard, Arduino, 6 AA Battery Holder, 1 9 Volt Battery
  • Tape can be used to hold these components to the robot
  • Place the Arduino and Breadboard next to each other to allow for wiring between them
  • For further guidance, see the StalkerBot_Diagram.pdf file in the Files section

Step #3: Wiring

The Stalker ‘BotThe Stalker ‘BotThe Stalker ‘Bot
  • The next step is wiring! Follow the wiring instructions exactly to get a functional robot.
  • Using the StalkerBot_Circuit.pdf file as a reference (available in the Files section), wire each component to the Arduino through the breadboard.
  • Push the tinned ends of the wires (known as jumper wires) into the specified pinhole

Step #4: Programming

The Stalker ‘BotThe Stalker ‘BotThe Stalker ‘Bot
  • Program the finished robot using the code provided in the Downloads section called "StalkerBot_Code.pdf"
  • Create a new Arduino program by going to "File" "New" in the Arduino application
  • Copy the StalkerBot_Code into the new Arduino program
  • Once the code has been moved to Arduino, connect a USB cable from the computer to the Arduino.
  • Click the upload button in the Arduino window to upload the code to the robot
  • be careful: the robot will start running the code as soon as it is uploaded

Step #5: The StalkerBot!

The Stalker ‘Bot
  • The robot is now ready to use!
  • To operate the robot without having a USB connection with the computer, connect the 9 Volt battery to the Arduino power input


After completing this project, you will now have a functioning stalker 'bot! To adjust the distance that it senses objects from, edit the inch values in the Robot Control if loops in the program.

  • Natalie Dennis

    where is the files section? i wanna make this for my electronics class.

    • Breezy

      did you ever find one?

  • Charley

    I am actually wondering the same thing as Natalie Dennis. Where are the “files section” files that he mentions? Does this have to do with Make moving to a new web platform for their projects?

  • Eric

    Does anyone know if there is a kit that i can buy to make this so that i don’t have to buy the parts from different places?

  • Vaibhhav

    pdf missing?!?

  • Tzofi Klinghoffer

    Hi all – I am sorry; apparently their was an error with the files section. I have created a Google Folder that can be accessed that has the code and the project diagram.

    Code & Diagram –

  • Essam

    Hey Tzofi! This is a great project – I’d like to attempt to make a Stalker Bot too! I’m new to and I can’t find the ‘files’ and ‘downloads’ sections. Could you please tell me where I can find them or just send me StalkerBot_circuits and StalkerBot_diagram pdfs you mention in the instructions? Thank you!

    • SuperDave

      In case you’re still on the wild goose quest to located the magical code, just google “StalkerBot_Code.pdf”. Thanks for the project Tzofi. Please put a resource link, asablief.

  • Tzofi Klinghoffer

    Sorry for the inconvenience.

    The related programming code and diagrams can be found here:

  • Quinton

    this has great instructions, i’m going to attempt it with 3 continuous rotation servos from bot brain and a completely different body. i barely got an Arduino board and this will be the first chip controlled robot i have ever made.

    • Arshiyan Tauheed

      Have you been able to construct it with continuous rotation servo motors? I want to know can it work with simple ultrasonic sensor and servo motor or not.

  • Andrew Shaw

    Could anyone help me, when I try to verify

    I get the following error

    120: error: expected declaration before ‘}’ taken ‘microsecondsToInches1’ was not declared in this scope.

    On line

    inches1 = microsecondsToInches1(duration1); //sets the inches1 object to the value of the duration converted to

    If anyone can asset I would be very grateful


  • Steve

    Is it possible to buy one already assembled and programmed? I need this for a project I am working on.

  • Arshiyan Tauheed

    Hi, I want to ask whether I can use just simple continuous servo motors for this projects or not?