The LineBlock uses an Infrared LED and photodiode to detect how reflective a surface is.
The LED emits infrared light, which then bounces off a surface, if the surface is reflective (like white paper) then lots of light is reflected back to the photodiode that detects how much IR light it is receiving. When the sensor is placed near a dark or black object (or black line), then less light is reflected, and the photodiode reports a lower value.
The sensor can also be used as a distance sensor, since the further away an object is, the less light it reflects back to the sensor.
The part number of the sensor we will be using is TCRT5000, here is the datasheet for that part:
This sample program draws a live graph of the input from the analog sensor: