Precise measurements are the key to color sensor sensitivity - Embedded.com

Precise measurements are the key to color sensor sensitivity

Although the human eye is very capable of differentiating colors,people will describe the same color differently. This makes verbaldescription inadequate in applications that require precise colordetection and management.

A better solution is to describe color in numeric terms usingadequately calibrated color-sensing devices -from expensive laboratory-grade spectrophotometers toeconomical RGB color sensors.

This article will provide some insight into color perception, measurementand specification, and how the data produced by color sensors isapplied.

Before going into the theory of how electronic devices sense colors,it is useful to understand how humans perceive color. Color is theresult of interaction between a light source, an object and anobserver. In the case of reflected light, light falling on an objectwill be reflected or absorbed depending on surface characteristics suchas reflectance and transmittance.

Figure1: A light-to-analog voltage color sensor comprises an array ofphotodiodes behind color filters and an integrated current-to-voltageconversion circuit.

For example, red paper will absorb most of the greenish and bluishpart of the spectrum while reflecting the reddish part of the spectrum,making it appear reddish to the observer. In the case ofself-illuminated objects, the principle is the same: the light willreach the human eye, be processed by the eye's receptors, andinterpreted by the nervous system and brain.

The human visual system can detect the electromagnetic spectrum fromabout 400nm (violet) to about 700nm (red), and can adapt to widelyvarying illumination levels and amounts of color saturation (theproportion of pure color to white).

The light sensor cells capable of working over a wide illuminationlevel and of providing quick response to changes are called rods.However, the rod cells are incapable of detecting color. Light sensorcells called cones provide high resolution color imaging.

There are three sets of cones with peak sensitivities at wavelengthsthat we identify as red (580nm), green (540nm) and blue (450nm). Lightat any wavelength in the visual spectrum will excite one or more ofthese three types of cone cells to varying degrees, with our perceptionof the color being that information as processed by our optic nerve andbrain.

Figure2: The color of reflected light depends on the colors that a surfacereflects and absorbs.

Apparently, humans with normal color vision basically perceive thesame color when shown light with the same mixture of wavelengths.Scientific experiments have shown that humans can discriminate betweenvery subtle differences in color, with estimates as high as 10 million;the problem is that we simply do not have enough words to name all thesubtly different colors.

Colorimetric andphotometricare two general types of measuring instruments. With thecolorimetric method, the device measures light from an object using asensor with three filters. Normally, the sensor profile is optimized sothat it will closely resemble the human eye response. The output willbe in terms of International Commission on Illumination inEnglish (CIE) tristimulus values X, Y, Z.

The photometric method uses amultiplicity of sensors to measure color over a large number of narrowwavelength ranges. The instrument's microcomputer then calculates thetristimulus values by integrating the resulting data.

The photometric method uses a multiplicity of sensors to measurecolor over a large number of narrow wavelength ranges. The instrument'smicrocomputer then calculates the tristimulus values by integrating theresulting data.

Figure3: The R, G and B outputs of the sensor are determined by the color oflight falling on the sensor.

Sensor operation
There are three types of color sensors:light-to-photocurrent, light-to-analog voltage and lightto- digital.The former usually represents only the input part of a practical colorsensor, since the raw photocurrents are of extremely low amplitude andinvariably require amplification to convert the photocurrents touseable levels.

Thus, most practical analog-output color sensors incorporate at aminimum a transimpedance amplifier and provide voltage outputs.

A light-to-analog voltage color sensor comprises an array ofphotodiodes behindcolor filters and an integrated current-to-voltageconversion circuit (usually a transimpedanceamplifier).

Light falling on each of the photodiodes is converted into aphotocurrent, the magnitude of which is dependent on both thebrightness and, due to the color filter, wavelength of the incidentlight.

Without a color filter, a typical silicon photodiode responds towavelengths ranging from the ultraviolet region through the visible,with a peak response region between 800nm and 950nm in the near-IR partof the spectrum. The red, green and blue transmissive color filterswill reshape and optimize the photodiode's spectral response.

Properly designed filters will result in a spectral response for thefiltered photodiode array that mimics that of the human eye. Thephotocurrents from each of the three photodiodes are converted toVRout, VGout and VBout using a current-to-voltage converter.

Figure4: Figure shows color sensing of a transparent medium such as a colorfilter, liquid or gas.

Reflective versus transmissivesensors
There are two color-sensing modes: reflective and transmissive. Inreflective sensing, the color sensor detects light re- flected from asurface or object, with both the light source and the color sensorplaced close to the target surface. Light from the light source bouncesoff the surface, and is measured by the color sensor.

The color of the light reflected off the surface is a function ofthe color of the surface. For example, white light incident onto a redsurface is reflected as red. The reflected red light impinges on thecolor sensor producing R, G and B output voltages.

By interpreting the three voltages, the color can be determined.Since the three output voltages increase linearly with the intensity ofthe reflected light, the color sensor also measures the reflectivity ofthe surface or object.

In transmissive sensings, the sensor is placed facing the lightsource. The filter-coated photodiode array of the color sensor convertsthe incident light into R, G and B photocurrents, which are amplifiedand converted to analog voltages. Since all three outputs increaselinearly with increasing light intensity, the sensor can measure bothcolor and total intensity of the light.

Transmissive sensing can be used to determine the color of atransparent medium, such as glass or transparent plastic, a liquid, ora gas. Light passes through the transparent medium before modes:reflective and transmissive.

In reflective sensing, the color sensor detects light re- flectedfrom a surface or object, with both the light source and the colorsensor placed close to the target surface. Light from the light sourcebounces off the surface, and is measured by the color sensor.

The color of the light reflected off the surface is a function ofthe color of the surface. For example, white light incident onto a redsurface is reflected as red. The reflected red light impinges on thecolor sensor producing R, G and B output voltages.

By interpreting the three voltages, the color can be determined.Since the three output voltages increase linearly with the intensity ofthe reflected light, the color sensor also measures the reflectivity ofthe surface or object.

In transmissive sensings, the sensor is placed facing the lightsource. The filter-coated photodiode array of the color sensor convertsthe incident light into R, G and B photocurrents, which are amplifiedand converted to analog voltages. Since all three outputs increaselinearly with increasing light intensity, the sensor can measure bothcolor and total intensity of the light.

Transmissive sensing can be used to determine the color of atransparent medium, such as glass or transparent plastic, a liquid, ora gas. Light passes through the transparent medium before impinging onthe color sensor. The color of the transparent medium is determined byinterpreting the color-sensor voltages.

Interpreting values
The three analog output voltages of the color sensor may be used todirectly control hardware or be converted to digital values so that adigital processor can analyze the data. The color and brightnessinformation is obtained from these digital values. There are twomethods of describing the color and brightness.

Matrix method. Thismethod is suitable if there are many colors to be distinguished. Themethod is based on the matrix equation given below:

Where X, Y, Z represent the CIE. The selection of which colortristimulus values and RGB the color-sensor digital values. A known setof reference colors are measured and the R, G and B sensor values areobtained for each standard X, Y and Z values.

The matrix coefficients C00, C01, C02, C10, C11, C12, C20, C21 andC22 are determined from these known standard values. Once these matrixcoefficients are determined, the X, Y and Z values of the unknown coloris calculated from the R, G and B digital sensor values.

Lookup tablemethod. This method is suitable if a few reference colors are tobe distinguished. First, the reference color sensor values, whichinclude brightness information, for each color are obtained duringcalibration.

A decision has to be made on whether brightness information isimportant or not. If brightness information is important, the actualcolor sensor values are used in interpretation. If brightness is notsignificant to an application, the ratio or proportion between red,green and blue sensor values are obtained for the reference colorsduring calibration and for the unknown color during testing.

The ratio is obtained by using one selected color channel as thebasis for all measurement sets. For example, if the green channel isselected, the ratio is obtained by dividing the sensor measurements bythe corresponding green channel value so that the resulting greenchannel value is always 1.

To demonstrate, if the set (RnS, Gn, Bn), n = 1, 2, 3 N, representsthe color sensor measurements of all the N reference colors, the ratiois given by the set:

Red or blue channel values can also be used as the divisor. channelto use is a matter of preference.

The unknown color is determined to be the reference color if theunknown color is the nearest to that particular reference color – i.e.if the distance between the unknown color and that particular referencecolor is the shortest among all other distances between the unknowncolor and all other reference colors.

The distance between the unknown color and reference color is givenby the equations below:

a) For the case wherebrightness is important,

b) For the case wherebrightness is not important,

Note:
1. (Ru, Gu, Bu) are the unknown colorsensor values.
2. (Rr, Gr, Br) are the referencecolor sensor values.
3. For the case where brightness isnot important, the value of one sensor channel (for example, the greenchannel) is used as a divisor.

A maximum distance limit is established for each reference color toavoid accepting colors that do not belong to the list of referencecolors. This maximum limit can be different for each reference color,depending on the accuracy required.

Benefits, trade-offs
A light-to-photocurrent converter consists of nothing more than aphotodiode, or a photodiode with a color filter, which converts lightto a photocurrent. External circuitry can be used to convert thephotocurrent to a proportional voltage output, and the voltage can thenbe converted to a digital format via a discrete ADC and fed to an MCU.

A light-to-photocurrent converter is suitable for applications thatrequire a short response time, customized gain and speed adjustment,and operate under varying light conditions.

Its key benefit is design flexibility. The gain and bandwidth of theamplifier, and the speed and resolution of the ADC can be tailored toindividual applications. On the other hand, the trade-offs includeadditional assembly cost and increased design complexity.

A light-to-analog voltage converter consists of an array ofphotodiodes coated with color filters and integrated withtransimpedance amplifiers. External circuitry is required to convertthe analog voltage into a digital output before being fed to a DSP.

The light-to-analog voltage converter is suitable for applicationsthat require a shorter design cycle, faster time-to-market,well-defined light conditions and space efficiency. It simplifiesperipheral circuit design, improves space efficiency and reducesassembly cost.

On the other hand, response time is predetermined by the built-incurrent-to-voltage converter, such as a transimpedance amplifier.Furthermore, an additional ADC is required to convert the voltageoutput into a digital format.

A light-to-digital voltage converter consists of an array ofphotodiodes coated with RGB filters, an ADC and a digital core forcommunication and sensitivity control.

The output allows direct interface to an MCU or other logic controlvia, for example, a two-wire serial interface for further signalprocessing without the need for any additional components.

The light-to-analog voltage converter is suitable for applicationsthat require a shorter design cycle, faster time-to-market,well-defined light conditions and space efficiency. It provides noiseimmunity, simplifies peripheral circuit design, improves spaceefficiency and reduces assembly cost.

On the other hand, direct interface to an MCU or PC is onlyavailable via two-wire serial interface mode. Also, response time ispredetermined by the built-in A/D circuits, while A/D resolution ispredefined.

Ng Joh Joh and Lim Khee Boon areproduct engineers and Kwong Yin Leong is Product Application Specialistat Avago Technologies.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.