Pepperl+Fuchs Blog

Color Sensors vs. Contrast Sensors

Posted by Michael Turner on Tue, Jan 08, 2013

Can I use a contrast sensor rather than a color sensor? It is cheaper, isn’t it?

Generally, a contrast sensor is much cheaper than a color sensor; however, the fundamental principles of operation between a contrast sensor and a color sensor differ drastically.

I’m definitely all for saving money. Unfortunately, in nearly all cases, a contrast sensor cannot and should not be used to replace a color sensor. To back up this statement, let’s examine why this is the case.

Contrast sensors

A contrast sensor is a high-efficiency device used to detect a difference between two colors. These colors are commonly referred to as mark and background. The detection process evaluates the brightness, or light level received, from a sample presented to the sensor. For each new sample presented, the sensor compares the new sample value to what it was taught, to determine if it is more like the mark or more like the background. For even better performance, most contrast sensors use a variable-color LED that allows the detection of very slight contrasts. The color of the emitted light is automatically selected based on the sensor’s taught conditions.

Color sensors

A color sensor separates light reflected from a sample into several portions of the visible spectrum and returns an intensity value for each of these sub-spectra. The distribution of these values reveals the spectral properties—and thus the color—of the target.

Color sensorA typical industrial color sensor lets you teach one to several colors to the sensor’s memory. In many instances, you can manipulate the switching threshold or tolerance for each color. For example, if you teach a red sample, then how close to the taught value of red is “red enough” after another sample is presented to the sensor? 

Some sensors may allow threshold tolerances in a few discrete choices, such as fine, medium, and coarse. Fine tolerance meaning a sampled red must be almost identical to the taught red, and coarse tolerance meaning a sampled red may be dark red, pink, reddish orange, etc. … and still be considered red. Other sensors may allow for multiple samples to be taken for one specific color.

Back to the original question

From above, we know that after programming a contrast sensor, samples are evaluated and based on the light level received. The sensor draws a line in the sand, so to speak. This means that the logic of a contrast sensor is very “black and white.” There is no middle ground. With each sample presented to the sensor, the only thought running through the contrast sensor’s brain is “Is it more like the mark or is it more like the background?”

To further illustrate this concept, let’s look at an example. Using various colors as a guide, we’ll assume that the sensor is programmed to recognize midnight blue as the mark and mango as the background.

Colors sensors vs contrast sensorsTherefore, we can conclude that when the sensor sees another midnight blue sample, it will easily say, “Mark!”  And when mango is presented, the sensor will having no trouble in telling you, “Background!”

Easy enough, but what happens when you have a tangerine, beachy peachy, or grapetastic sample?

Not as easy of a scenario to predict, but we can make a few assumptions that may help to get us in the vicinity. Remember, the contrast sensor evaluates the light level received from the sample and compares it to the taught conditions. There are only two possible outcomes, mark or background. We know that midnight blue (mark) is a fairly dark color and mango (background) is very bright. This means that the contrast sensor associates any dark color with the mark and any light color with the background.

  1. Grapetastic is a very dark color. Guess: mark.
  2. Tangerine appears to be almost as bright as mango. Guess: background.
  3. Beachy peachy appears to be slightly brighter than mango. Guess: background.

The outcome isn’t necessarily as important as the underlying meaning. Contrast sensors are designed to efficiently distinguish between two colors. All other colors presented are evaluated as being either the mark or the background.

A color sensor, on the other hand, should have little or no trouble distinguishing between multiple colors, even if multiple samples are presented.


A contrast sensor is built for speed, not for differentiating between multiple color samples. The simple, internal evaluation process combined with superfast hardware allows for high switching speeds and lightning-fast response times. This translates to faster line speeds in the application, saving you money.

Common applications for contrast sensors

  • Detect colored print marks, even with low contrast and reflective surfaces
  • Monitor presence of bottle cap seals
  • Verification of glue strip presence on carton flaps
  • Detect expiration dates on containers or printed lot codes on pill bottles
  • Monitor small marks on motor shafts for speed control

A color sensor is a deep thinker and built for detecting minute color variations, not for high speeds. Depending on the specified tolerance, a color sensor can easily differentiate between multiple colors with incredible precision. This translates to less product waste in the application, again, saving you money.

Common applications for color sensors

  • Detect color variations in products
  • Presence monitoring of colored labels
  • Identify inconsistencies in printed media
  • Efficiently count specific products based on color
Color or Contrast Sensors Questions?  Get the Quick Select Product Guide

Topics: Photoelectric Sensors, Ask an Expert

Subscribe to Email Updates

Search our blog!

Loading Google Custom Search.....

Follow Me