Thursday, 21 November 2013

Object Tracking Robot

In this tutorial I am going to post the step-by-step procedure to make a simple Object Tracking Bot. The main aim of this Bot is to follow the objects which are shown to it in 3D space i.e., x, y and z – axis (horizontal, vertical and forward & backward). This bot behaves just like a little doggy. This bot tracks the objects with 2 DOF (Degree Of Freedom). The two motors provide the Horizontal, Forward and backward movement, The Servo Motor which holds the Compound Eye (Sensor) provides the Vertical movement. So, the Bot can follow the Object in 3D space. To sense the objects and track it this bot uses an IR Compound Eye sensor, which is built using four 5mm IR LED’s and eight 5mm Photodiodes. You can find the performance of the Object Tracking Bot from the below YouTube link

If you are interested to know how to make it and want to make a similar bot, then follow below steps.
Steps to make an Object Tracking Bot:
The steps involved in building an Object Tracking Bot are as follows –
  1. Gather the required materials.
  2. Making of Sensor (IR Compound Eye).
  3. Building Motor driver circuit.
  4. Programming the Arduino.
  5. Assembling the Bot and
  6. Testing.

Step-1: Acquire required Materials
Before start building the bot gather the required materials and tools. The list of materials and tools required are as follows –
  1. Arduino Microcontroller board
  2. IR LED’s (four)
  3. Photodiodes (eight)
  4. Servo motor (one)
  5. L239D Motor driver IC (one)
  6. Universal PCB
  7. Chassis
  8. DC geared Motors (two)
  9. Castor ball (one)
  10. Solid core wires (few)
  11. Soldering rod and soldering wire
  12. 9 Volt Batteries (two)
  13. Double sided tape or any adhesive
After gathering all the required materials and tools let’s move on to next step.
Step-2: Making of Compound Eye (sensor) –
The Compound Eye sensor used in this bot is built using four IR LED’s and eight Photodiodes. The idea and design of the compound eye sensor was taken from ……………………….. Here is the link to his site ………….. . You can buy this sensor from Stores or make it yourself. From the reference of above site I had made a similar sensor with some modifications, the circuit I had used for my sensor is different from the original one and I had used Photodiodes instead of Phototransistors.
The circuit diagram of my (modified) sensor is below –

The Compound Eye sensor consist of eight Wires to power the IR LED’s and Photodiodes. Four wires to power four IR LED’s, four wires to power four pairs of Photodiodes (in reverse bias), one wire for common ground terminal and four wires to take readings from four sides (four pair of photodiodes) of the sensor. You can find the connections of these wires to arduino Digital I/O pins from the above diagram. Don’t connect the wires of the sensor to Arduino at this time, Connect them during the Assembling step.
Here is my Compound Eye sensor (IR LED's and Photodiodes soldered on a Universal PCB).

Step-3: Motor driver –
The L239D is a motor driver IC which is used to control two DC motors with the help of four PWM pins of Arduino (you can use 4 Digital I/O pins instead of PWM pins if you don’t want to control the speed of motors). Don’t connect the motors directly to Microcontroller the sharp spikes (inverse EMF) from the motor may damage the Arduino. The L239D IC has 16 legs. The connections of L239D with Arduino and DC Motors are shown in the below picture.

Solder the IC on a Universal PCB. Then Connect the two Motors to 2,7 and 10,15 Pins of the IC. Don’t connect the IC to Arduino now. Connect them during the Assembling step.

Step-4: Programming the Arduino –


  1. This comment has been removed by the author.

    1. I will update the post with source code soon.

    2. hi Mr Kranthi Kumar, it is possible for you to post the source code, i want to try it myself. Very interesting project you have there. Really appreciate it if you can post the code. Thanks.

  2. Greeting sir,

    Are this blog still active? Can you post the source code, i wanna try it myself. Please sir, really appreciates your kindness. Thanks.

  3. Hi sir. If you can give me the project for the proper price
    Contact me on

  4. Hello,

    This looks cool.. Could you post the code please..
    Thanks a lot..

  5. can u detail me about making a object tracking bot using raspberry pi 3