The Pololu QTR-1A 1 Channel Analog IR Infrared Reflectance Sensor can be used to detect edges, follow lines and sense nearby objects.
This package includes two tiny sensor modules. Each individual module provides a single infrared LED and phototransistor pair. At only 0.5" x 0.3", these small reflectance sensors can be mounted just about anywhere.
The module's IR LED will produce an invisible infrared light while its phototransistor detects the amount that reflects back to the sensor. An analog voltage output is used to indicate the amount of reflection that is detected.
Usage
Connect the power input (VIN) and ground (GND) pins to a 5V power supply and the analog output (OUT) pin to an analog input on your robot's microcontroller brain. A lower output voltage indicates a greater amount of reflected light. For example, when used for line detection, the black line of a maze will reflect less light than the white surface it's drawn on.
This package includes two Pololu QTR-1A sensor modules and a set of optional header pins that require soldering.
Documentation