The Track Sensor Module contains an IR Infrared reflection sensor that can be used for line following and edge detection.
This sensor is uses one TCRT5000 infrared reflection sensor to detect black lines drawn onto a white surface. Use a few of these modules to enable your robot to follow a line. This module has an adjustable threshold that triggers a digital output. An LED indicator is provided to assist with debugging.
Although this track sensor is intended for detecting lines, it can also be used to detect nearby obstacles and avoid table edges. This module is compatible with both 3.3V and 5V robot microcontrollers.
Connect your power supply to the Voltage (V) and Ground (G) pins. Read the digital output from the Signal (S) pin. The output signal will be LOW when a line or object is detected and HIGH otherwise. Adjust the level potentiometer to vary the threshold.