IR Line tracking sensor


The Maze tracking robot also comes with 3 IR  Line Tracking Sensors.  These sensors just follows lines, or the light reflected on a surface. In the picture above are 3 of those.

I haven’t found any information about them in the Internet,  but their operation and programming should not be difficult.

The sensor has IR light emitter and detector. The sensor returns the status of the IR light reflected from a surface as ON or OFF.  The LED shows the status of the sensor. It should be needed be calibrate the sensor to set the threshold between light and dark.

The sensor also has a potentiometer knob to adjust. I’ll make some tests with that and post them here.

The connections are simple:

Sensor Arduino
V+ Vcc
S PIN 10

For our litle test, we’ll connect the 3 ‘S’ (from each sensor) PINs to Arduino PINs 8, 9 and 10.
Connect all the sensors and open Arduino IDE

* Verifies the IR Line tracking output
* Free to share ! 
void setup() {

 Serial.begin (9600);
     pinMode (10,INPUT);
     pinMode (9,INPUT);
     pinMode (8,INPUT);
void loop() {
     //read the input
     int L = digitalRead(10); //left sensor
     int C = digitalRead(9); //center sensor
     int R = digitalRead(8); // right sensor

     //print the values
     Serial.print (L);
     Serial.print (C);
     Serial.println (R);

The result, as shown, when not detecting anything, is 1 and when detecting is 0.  When covering the sensor, the light turns ON and the sensor reports 0.

linesensor2 linesensor1