¿Cómo funciona?

The workings of a line follower robot are pretty straightforward. These robots have the capability to detect a black or dark line on a lighter surface depending on the contrast. They estimate whether the line underneath them is shifting toward their left or right as they move over them. Based on that estimation, they give respective signals to the motors to turn left or right so as to maintain a steady center with respect to the line.

These robots usually use an array of IR (infrared) sensors in order to calculate the reflectance of the surface beneath them. The basic criteria is that the black line has a lesser reflectance value (black absorbs light) than the lighter surface around it. This low value of reflectance is the parameter used to detect the position of the line by the robot. The higher value of reflectance will be the surface around the line. So in this linear array of IR sensors, if the leftmost or rightmost IR sensor presents the low value for reflectance, then the black line is toward the left or right of the robot correspondingly. The controller then compensates for this by signaling the motor to go in the opposite direction of the line.

Diagrama
Line Follower Block Diagram

The IR sensor array consists of individual IR LEDs and IR photodiodes. The IR light emitted by the LED strikes the surface and is reflected back to the IR photodiode. The photodiode then gives an output voltage proportional to the reflectance of the surface (high value for a light surface and low for a black or dark surface).

Sensor IR
IR Sensor Working

Making the Sensor Array for the Line Follower (Optional)

*Only if you don't want to buy the Pololu reflectance sensor.

To make an IR sensor array, take the six IR LEDs and connect them in parallel with each other. Now, take the IR photodiodes and place each of them just below the six IR LEDs. Wrap each pair together using black insulation tape and leaving their tips exposed. Take these six pairs of IR LEDs and photodiodes and join them in a straight line. Each pair should be 1.5cm apart from the next.