Infrared Line Detecting Module


Infrared Line Detecting Module [Product Link] is able to return both digital and analog values, making it highly useful in differentiating colors, when used in Line Followers.


Infrared Line Detecting Module
Infrared Line Detecting Module
  • Color Detection: Black and White
  • Potentiometer for adjusting sensitivity.
  • Analog and Digital Output.
  • Small sized IR LEDs protected with covering.
  • Fixed bolt hole for convenient installation


This module has 4 pins- Vcc (+5V), DO (Digital Output), AO (Analog Output), GND.

During experiments, at 10mm distance, analog values returned for white and bright colored objects was 40 (Digital 0) and above, while for black and dark colored objects was in the range of 800 (Digital 1).

When the distance of an object is greater than the threshold, set using the potentiometer, the digital output returns a high value.

The IR Transmitter and Receiver LEDs are free from interference from each other due to the protective covering and the range at which this sensor can detect objects is limited to about 10mm.

// Code by Jasmeet Singh for
int Dpin0=5; //Digital Pin 5
int Apin0=1; //Analog Pin 1
int Apinval;

void setup()
pinMode(Dpin0, INPUT);

void loop()
Serial.print("D0 Value:");
Serial.println(digitalRead(Dpin0)); // Read Digital Pin
Serial.print("A0 Value:");
Apinval=analogRead(Apin0); // Read Analog Pin
Serial.print("A0 Voltage:");
Serial.println((Apinval*5)/1024); // Convert Analog Pin value to Voltage

Possible Application Areas

1. Line Follower/Edge Avoider Robot [Link]
2. Line Follower with Object Detecting Robot [Link]

Did you create a project using this product? Leave details/links below!


So empty here ... leave a comment!

Leave a Reply

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