Abstract: TCS230 TAOS produced in the United States a programmable color light-to-frequency converter. Paper describes its principles and applications. The sensor has high resolution, programmable color selection and output calibration, single power supply and so on; output is digital, can be directly connected with the microprocessor. The paper also introduces the knowledge of shade and white balance, and use an example to introduce the TCS230 color identification process.
Key words: TCS230 color sensor to adjust the white balance color recognition
As the modern industrial production to high-speed, automatic direction of development, the production process has long played a leading role by human eyes the color of recognition will increasingly be replaced by the corresponding color sensor. For example: library use color-coded classification of the literature, can greatly improve the work of the Arrangement and statistics; in the packaging industry, product packaging, the use of different color or installed a different sulfur to express their nature or purpose. The current color sensor is usually covered by a separate photodiode amended red, green, blue filter, and then processing the output signal corresponding to the color signal identified; the two together, some, but output analog signal, you need a A / D sampling circuit, the signal for further processing in order to identify and increase the complexity of the circuit, and there is greater recognition error, affecting the recognition results. This article describes the company’s new U.S. TAOS Color Sensor TCS230. It not only enables the identification and detection of the color, the color of the sensor compared with the previous, but also has many excellent new features.
1 TCS230 chip block diagram and characteristics
TCS230 is TAOS (Texas Advanced Optoelectronic Solutions) has introduced a programmable color light-to-frequency converter. It can be configured into the silicon photodiode and current-frequency converter on a single CMOS integrated circuit at the same time on a single chip also incorporates a red, green and blue (RGB) of three filters, is the industry’s first to have digital-compatible interface The RGB color sensor. TCS230 output signal is digital, can drive TTL or CMOS standard logic input, so you can directly with the microprocessor or other logic circuits connected. Since the output is digital, and can achieve 10 bits per color channel than the conversion accuracy, and thus no longer need to A / D converter circuit, makes the circuit easier. TCS230 Figure 1 is a block diagram of the pin package and features.
Figure 1, TCS230 in 8-pin SOIC surface mount package, integrated on a single chip photodiode 64. The diode is divided into four types. 16 of the photodiode with a red filter, 16 green filter with a photodiode, the photodiode 16 with a blue filter, and the remaining 16 without any filter, the light through all the information. The photodiode array in the chip is a cross, and to minimize the inhomogeneity of the incident light radiation, thereby increasing the accuracy of color recognition; the other hand, the same color photodiode 16 is connected in parallel, uniform distribution in the diode array, the color of the position error can be eliminated. Work through two programmable pins to select the desired dynamic filter. The typical sensor output frequency range from 2Hz ~ 500kHz, users can also select two programmable pins to 100%, 20% or 2% of the output scale factor, or the power shutdown mode. Output scale factor output of the sensor to adapt to different measurement range and improve its capacity to adapt. For example, when using low-speed frequency counter, you can choose a small value of the scaling, so that the output frequency and the counter TCS230 match.
From the functional block diagram shows: When the incident light projected onto the TCS230 when, controlled by pin photodiode S2, S3 of the different combinations, you can choose different filters; through the current to frequency converter after the output of different frequency square wave (duty cycle than 50%), different colors and light intensity corresponding to different frequencies of square wave; calibration can also control the output pins S0, S1 to select a different output scale factor, output frequency range to be adjusted to suit different needs.
Below is a brief description of each pin function TCS230 chip and some of its combination of options.
S0, S1 for selecting the output scale factor or power shutdown mode; S2, S3 is used to select the type of filter; OE is the frequency output enable pin, you can control the output of the state, when there are several common micro-chip pin processor’s input pins, they can be used as chip select signal; OUT is the frequency output pin, GND is the chip ground pin, VCC operating voltage for the chips. Figure 2 S0, S1 and S2, S3 of available combinations.
TCS230 identify the principles of color
We can see from the above description, this programmable color light-to-frequency converter suitable colorimeter measurement applications, such as color printing, medical diagnostics, computer color monitor calibration, and paints, textiles, cosmetics and printing materials, process control and color match. In this paper, TCS230 color recognition in the liquid application, for example, introduced its specific use. In introducing TCS230 color identification before to understand some of the knowledge of light and color.
2.1 The three primary colors of the induction principle
Usually the color of objects seen, in fact, the surface absorbs the white light on it (the sun) in the part of the colored composition, which reflects a shade of another part of the response in the human eye. White is the frequency of visible light by a variety of mixed composition, that white light contains all colors in the shade (such as red R, yellow Y, Green G, blue V, blue B, purple P). According to the German physicist Helmholtz (Helinholtz) theory shows that the three primary colors, a variety of colors by the different proportions of the three primary colors (red, green, blue) mixture.
2.2 TCS230 identify the principles of color
The three primary colors by the induction principle above we can see, if you know the three primary colors to create various color values, we can know the color of the object being tested. The TCS230, when selected a color filter, it only allows a particular color through to prevent the passage of other colors. For example: When you select a red filter, the incident can only red, blue and green have been prevented, so that you can get the red light intensity; Similarly, choose other filters, you can get the blue light green light intensity. These three values can be analyzed to project the light to the TCS230 color sensor.
2.3 Principles of white balance and color recognition
White balance is to tell the system what is white. In theory, the white is the same amount of red, green and blue mixture; but in fact, white is not exactly equal in the three primary colors, and light sensor for the TCS230, it’s these three The sensitivity of the basic color is not the same, resulting in TCS230 the RGB output is not equal, so the test must be carried out before the white balance adjustment, making the TCS230 detection of the "white" in the three primary colors are equal. White balance adjustment is to prepare the follow-up color recognition. In this device, the specific steps and white balance adjustment as follows: the empty tube placed in the top of the sensor, test tube placed on top of a white light source, so that incident light can pass through the tube on the exposure to the TCS230; according to previously described method, followed by gating red, green and blue filters, were obtained from the red, green and blue values, then you can calculate the required three tuning parameters.
When identification with the TCS230 color to use these three parameters on the measured colors R, G and B to adjust. There are two ways to calculate the adjustment parameters: ? gated turn the filter of three colors, and then turn on the TCS230 output pulse count. When the counting to stop counting when 255 were used to calculate the time for each channel. These times correspond to the actual test, each filter TCS230 time base used in this period of time measured by the number of pulses that corresponds to the R, G and B values. ? Set the timer for a fixed period of time (eg 10ms), and then select three colors through the filter, calculate the output of this period the number of pulses TCS230, a scaling factor calculated by the scale factor can change the number of pulses 255. In the actual test, using the same time to count the number of pulses measured multiplied by the scaling factor obtained, and then you can get the corresponding R, G and B values.
3 TCS230 application
3.1 color recognition circuit
Based on the above analysis, using 89C51 and design of a medical liquid TCS230 color recognition device. The device has a simple structure, identifying the characteristics of high accuracy and efficiency, and the ability and the host computer communication, in order to identify the results of the real-time transmission to the host computer. Because it is the use of that TCS230, TCS230 below which recognition is given only to the circuit shown in Figure 3. Figure 3 using the P1 89C51 port pin to control the TCS230 several individual control pin, while the TCS230 output pin is connected to the 89C51 Timer / Counter 1 input (P3.5). Set 89C51 timer / counter for the corresponding work, 89C51 timer initialized to a fixed value, and then select the TCS230 output scale factor, enabling the output pin. 89C51 actual use value of the counter by reading to connect the three were calculated TCS230 output frequency and to determine the R, G, B value and color.
Combination of the above analysis is given in the corresponding software process, shown in Figure 4.
Process in the program: The system initialization is responsible for setting the 89C51 timer / counter work, select the TCS230 output scale factor, so that the output pin and the communication parameters can be set. Initialization is complete, testing the need for white balance adjustment. If so, call the white balance subroutine; Otherwise, go to the next step, testing the need for color recognition. If not, return; If you need color recognition, color recognition subroutine calls, until the color recognition is completed.
4 Application of the problems that need attention
color recognition when outside to avoid the interference of light, otherwise the results will affect the color recognition, the best the sensor, light source placed in a sealed, non-reflective of the box test;
no special requirements on the light, but light emitted light to try to focus, otherwise it will result in mutual interference between sensors;
When the first time when using the TCS230, TCS230 recognition module or restart, replace the light source, etc., will need to white balance adjustment.
The structural characteristics of the article from the TCS230 paper introduces the theory and color recognition of shade of knowledge, but also introduces the principles and white balance adjustment method. With a specific application, the corresponding hardware design circuits and software flow chart. The sensor described in the methods and culture to the other color recognition, but also a great help.