How Do Color Sensors Work?
Color sensors illuminate objects with white light and measure the intensity of the reflected light in the three spectral ranges red, green and blue. These intensities result in three digital signal values, which represent the physical strength of the received light in each channel. The ratio of these three channels describes the color reflected by the object. The intensities of the three channels are compared with each other and from these ratios a color profile is created, which is compared with previously learned references. On this basis, the sensor switches when a defined color is detected.
Why Do Color Sensors Work with White Light?
The white light LED generates a continuous spectrum. This light is reflected by the object and contains all parts relevant for color recognition. Thus, each color is illuminated under constant spectral conditions. A higher switching speed is also possible, as the sensor permanently emits the same light color and can evaluate it directly.
What Do RGB and HSL Stand for?
RGB Color Space h3>
RGB is the technical description of a color based on the measurable intensities of the three basic colors of visible light: Red, green and blue. Each visible color is created by combining these three colors, which is why we speak of an additive color space. When all three color channels are mixed at the same intensity, gray tones up to white are produced, while a dominant color channel results in a strong, saturated color.
HSL Color Space h3>
HSL is a transformation of RGB values into a form that is closer to human perception and therefore more intuitive to use. In the HSL color space, a color is described by color shade (hue), saturation (saturation) and brightness (lightness). The shade corresponds to the appropriate color angle in the color wheel, such as orange, green or blue, while the saturation describes, how intense a color appears, from a gray, desaturated tone to a bold, pure shade. Brightness indicates how light or dark a color is, from black to medium brightness to white.
How Are the Signal Values of Color Sensors to Be Understood?
The measured RGB channel signals are raw values of the sensor and are typically in the range of 0 to 1023. These values must be clearly distinguished from the standardized standard RGB colors (also sRGB colors), such as those used in the image display. Direct conversion is not possible because the signals depend on illumination, object distance, material and angle of incidence. RGB thus forms the technical basis for color recognition and describes what the sensor physically measures.
For further processing, these RGB raw data are converted into the HSL color space in the sensor. As a result, the color proportions can also be evaluated according to color shade, saturation and brightness. This conversion enables a perceptual interpretation of the measured values and simplifies parameterization: Instead of individual channel values, the color shade, color intensity and brightness can be set and evaluated in a targeted manner.
How Do Color Sensors Differ from Contrast Sensors with White Light?
| Color sensors | Contrast sensors with white light | |
|---|---|---|
| Switching speed | 8 kHz | up to 50 kHz |
| Number of switching outputs | 2, plus 6 digital | 1 |
| Color spaces | RGB, HSL | RGB |
| Color calibration | Yes | No |
|
Switching speed
|
|
|
Color sensors
8 kHz
|
Contrast sensors with white light
up to 50 kHz
|
|
Number of switching outputs
|
|
|
Color sensors
2, plus 6 digital
|
Contrast sensors with white light
1
|
|
Color spaces
|
|
|
Color sensors
RGB, HSL
|
Contrast sensors with white light
RGB
|
|
Color calibration
|
|
|
Color sensors
Yes
|
Contrast sensors with white light
No
|