Component · Sensor
IR Reflectance Sensor Array
An IR reflectance sensor array is how a line-following robot sees the line. How reflective infrared sensing works, how to calibrate it, and where it fails.
What it is
An IR reflectance sensor array is a strip of small infrared sensors mounted in a row, pointed at the ground. Each sensor pairs an infrared LED that shines light down with a phototransistor that measures how much of that light bounces back. Point it at a dark line on a light floor and the line reflects less—so the sensor over the line reads differently from the ones over the floor. Read the whole row and you know not just whether you are on the line, but where the line sits under the robot.
It is the eye of nearly every line-following robot, and the reason the line follower is such a good first project: the sensing is cheap, intuitive, and immediately visible.
How it works
Each channel is an emitter-detector pair. The IR LED emits invisible ~940 nm light; the phototransistor conducts more as more light returns. A white or light surface reflects strongly (high return); a black line absorbs the IR (low return). Two output styles exist:
- Analog — each channel reports a continuous value proportional to reflectance. This is richer: you can compute where between two sensors the line falls and get a smooth error signal for a PID controller.
- Digital — an on-board comparator reports a simple line/no-line per channel. Easier to read, but coarser.
To turn the array into a steering signal, you compute a weighted average of which sensors see the line. If the line drifts under the left sensors, the average shifts left, and that offset becomes the error your control loop corrects.
When to use it
Use a reflectance array whenever a robot must track a high-contrast path—a black line on white, or white tape on a dark floor. More channels give finer position resolution and let the robot handle curves and gaps more gracefully; five is enough to learn on, eight is comfortable for faster or twistier tracks.
It is the wrong tool for detecting objects, distance, or anything off the ground plane—that’s the job of an ultrasonic or time-of-flight sensor.
Calibration and gotchas
- Always calibrate. Ambient light, surface, and ride height all shift the readings. Before a run, sweep the array over both the line and the floor and record the min/max per channel, then scale readings between them. Skipping this is the number-one reason a line follower works on one table and fails on another.
- Height matters. Reflectance sensors have a narrow sweet spot (a few millimetres). Mount the array too high and contrast collapses.
- Ambient IR is noise. Sunlight and some lighting flood the detectors with infrared. Shroud the sensors or run indoors for consistent behaviour, and filter the signal—see taming sensor noise.
- Surface finish lies. Glossy black can reflect like white at the wrong angle; matte tape on matte floor is the reliable combination.
Explore the graph
Used in these builds
Projects, learning paths, and simulators that include the IR Reflectance Sensor Array.
Questions
IR Reflectance Sensor Array FAQ
What is a line follower sensor?
A line follower sensor is an infrared reflectance sensor that a robot points at the ground to detect a marked line. Each channel shines IR light down and measures how much bounces back, so a dark line (which reflects less) reads differently from the surrounding floor.
How does a line follower sensor work?
Each channel pairs an IR LED with a phototransistor. Light surfaces reflect strongly and dark lines absorb the infrared, so the sensor over the line reads low while the others read high. Reading the whole row tells the robot where the line sits underneath it.
How do you calibrate an IR sensor for a line follower robot?
Before a run, sweep the array over both the line and the bare floor and record the minimum and maximum reading per channel, then scale live readings between those limits. Skipping calibration is the top reason a line follower works on one surface and fails on another.
What is PID in a line follower?
PID is the control method that turns the sensor's position error into smooth steering. The proportional term reacts to how far off the line the robot is, the derivative term damps overshoot, and the integral term removes steady drift—so the robot tracks the line without wobbling. You can tune it live in our PID simulator.
What are the main components of a line follower robot?
A basic line follower needs four things: an IR reflectance sensor array to see the line, a microcontroller such as an Arduino Uno to run the control loop, a motor driver like the L298N, and two DC motors with wheels. A battery and chassis complete the build.
What is a line follower sensor array used for?
Beyond line-following robots, reflectance arrays are used for edge detection (stopping at a table edge), encoder-style position sensing, and simple surface or contrast detection in automation. Anywhere a robot must react to a high-contrast mark on a surface, a reflectance array is a cheap, reliable choice.
Further reading