Color sensor provides color screening capabilities to the robot. Color sensor provides three unique functions – distinguishes between six colors; works as a light sensor detecting light intensities, and color lamp emitting red, green or blue light. The color sensor detects the surface color of anything range between 5-6 cms. A simple usage of color sensor can be a robot to go slow on yellow traffic light, and stop on red traffic light.
A color sensor is not much different in principle than a regular light intensity sensor. To understand the color sensor let’s look at how a basic light intensity sensor works.
The sensor picks up the light falling on it and reports it in terms of intensity of light. The main component that differentiates color sensor is the inclusion of a multicolored light emitter (RGB LED). The color sensor module uses this light emitter to light up the test object in various colors and measures the intensity of the reflected light coming from the object for each of those colors. An object reflects the most light when the light shone on it is the same color as the object itself. Using this principle the color sensor is able to determine for which color of the light emitter the object reflected most light and subsequently deduce the color of the object.
Very close to Color Sensor is Light Sensor. Light sensor provides the vision capabilities to robot. Using the NXT Brick, it enables robot to distinguish between light and dark, as well as determine the light intensity in a room or the light intensity of different colors. A simple usage of light sensor can be to perform gray scale sorting.