Hand Tracking using Infrared Compound Eye

In this project, I decided to explore using IR sensors to perform a simple motion tracking of a hand instead of using a camera as to simplify the tracking.  The location of the hand will then be represented by a circle & displayed on a program written with Processing.

After searching through the Internet for IR sensors, I found that there was a sensor that has 4 IR sensors mounted on a single piece of PCB: and that was just what I needed! This sensor is known as “Infrared Compound Eye”.

How it works?


Let’s now take a look on how this IR eye will track an object. First, the arduino will turn on 4 of IR LEDs, which will be shone onto the object. The IR receivers will then measure the amount of (IR) light reflected back into the sensors from the object, which will be sent back to the arduino board. Using the Serial.print() function, the respective values of each sensor will be printed in the Serial window in the Arduino IDE.

In order to determine the location of the object, we will have to compare the values of the IR sensors respectively in sections, mainly the horizontal axis (x-axis) & the vertical axis (y-axis) to determine the object’s location. The left & right IR sensor would be part of the horizontal section, and the top & bottom IR sensor would be part of the vertical section.


Taking the right & top as the positive, we will be able to obtain the X & Y location of the object by subtraction. To obtain the location in the X-axis, we will subtract the left IR value from the right, and for the y-axis, we will subtract the bottom IR values from the top. For this project, I did these calculations in processing instead of Arduino. The values of the respective sensors will then be read by Processing using the Serial monitor. [Please note that in order for Processing to read the Serial, the Arduino IDE Serial window have to be closed.] The respective values will then be mapped from its range (around 0 ~ 1000) to the range of 0 to either the height or the width of the program window. Calculations will then be done after mapping the values.

To visualise the location of the object, the Processing program will draw a ball to indicate the current location of the object, which will change according to where the object move, and the cross hair in the centre of the program to indicate the centre of the sensor. The program should look something like this:


For this project, it will only detect object one at a time.


Pin Configuration


Parts used

  • IR Compound Eye x 1
  • Arduino Uno x 1
  • Many Jumper wires




[Coming Soon…]