Principle and application of programmable color sensor TCS230

Publisher:吉州古玩斋Latest update time:2011-04-22 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
introduction

This article introduces the latest color sensor TCS230 launched by TAOS in the United States. It can not only realize color recognition and detection, but also has many excellent new features compared with previous color sensors.

1. Block diagram and features of TCS230 chip

TCS230 is a programmable color light to frequency converter launched by TAOS (Texas Advanced Optoelectronic Solutions). It integrates a configurable silicon photodiode and a current-to-frequency converter on a single CMOS circuit, and also integrates three red, green and blue (RGB) filters on a single chip. It is the industry's first RGB color sensor with a digital compatible interface. The output signal of TCS230 is a digital quantity that can drive a standard TTL or CMOS logic input, so it can be directly connected to a microprocessor or other logic circuit. Since the output is a digital quantity and can achieve a conversion accuracy of more than 10 bits for each color channel, there is no need for an A/D conversion circuit, making the circuit simpler. Figure 1 is the pin package and functional block diagram of TCS230.


In Figure 1, TCS230 uses an 8-pin SOIC surface mount package and integrates 64 photodiodes on a single chip. These diodes are divided into four types. Among them, 16 photodiodes have red filters, 16 photodiodes have green filters, 16 photodiodes have blue filters, and the remaining 16 do not have any filters and can transmit all light information. These photodiodes are cross-arranged in the chip, which can minimize the unevenness of the incident light radiation, thereby increasing the accuracy of color recognition; on the other hand, 16 photodiodes of the same color are connected in parallel and evenly distributed in the diode array, which can eliminate the position error of the color. When working, the required filter is dynamically selected through two programmable pins. The typical output frequency range of this sensor is from 2Hz to 500kHz, and the user can also select an output scale factor of 100%, 20% or 2%, or a power shutdown mode through two programmable pins. The output scale factor enables the output of the sensor to adapt to different measurement ranges, improving its adaptability. For example, when using a slow frequency counter, a small calibration value can be selected to match the output frequency of the TCS230 to the counter.

From the functional block diagram, we can see that when the incident light is projected onto TCS230, different filters can be selected through different combinations of the photodiode control pins S2 and S3; after passing through the current-to-frequency converter, square waves of different frequencies are output (the duty cycle is 50%), and different colors and light intensities correspond to square waves of different frequencies; different output proportional factors can also be selected through the output calibration control pins S0 and S1 to adjust the output frequency range to meet different needs.

The following is a brief introduction to the functions of each pin of the TCS230 chip and some of its combination options.

S0 and S1 are used to select the output scale factor or power-off mode; S2 and S3 are used to select the type of filter; OE is the frequency output enable pin, which can control the output state. When multiple chip pins share the input pins of the microprocessor, it can also be used as a chip select signal; OUT is the frequency output pin, GND is the ground pin of the chip, and VCC provides the operating voltage for the chip. Figure 2 shows the available combinations of S0, S1, S2, and S3.

2 The principle of TCS230 color recognition

From the above introduction, we can know that this programmable color light to frequency converter is suitable for colorimeter measurement applications, such as color printing, medical diagnosis, computer color monitor calibration, and process control and color matching of paints, textiles, cosmetics and printed materials. This article takes the application of TCS230 in liquid color recognition as an example to introduce its specific use. Before starting to introduce the color recognition of TCS230, let's first understand some knowledge about light and color.

2.1 The sensing principle of three primary colors

The color of an object that we usually see is actually the reaction of the object's surface absorbing a portion of the colored components of the white light (sunlight) that shines on it, and reflecting another portion of the colored light in the human eye. White is composed of visible light of various frequencies mixed together, that is, white light contains various colors of light (such as red R, yellow Y, green G, cyan V, blue B, purple P). According to the three-primary color theory of German physicist Helinholtz, various colors are mixed by different proportions of the three primary colors (red, green, and blue).

2.2 The principle of TCS230 color recognition

From the above three-primary color sensing principle, we can know that if we know the values ​​of the three primary colors that make up various colors, we can know the color of the tested object. For TCS230, when a color filter is selected, it only allows a certain primary color to pass through and blocks the passage of other primary colors. For example: when the red filter is selected, only red in the incident light can pass through, and blue and green are blocked, so that the intensity of red light can be obtained; similarly, by selecting other filters, the intensity of blue and green light can be obtained. Through these three values, the color of the light projected onto the TCS230 sensor can be analyzed.

2.3 White balance and color recognition principles

White balance is to tell the system what white is. In theory, white is a mixture of equal amounts of red, green and blue; but in reality, the three primary colors in white are not completely equal, and for the light sensor of TCS230, its sensitivity to these three basic colors is different, resulting in unequal RGB outputs of TCS230. Therefore, white balance adjustment must be performed before testing so that TCS230 is equal to the three primary colors in the detected "white". White balance adjustment is to prepare for subsequent color recognition. In this device, the specific steps and methods of white balance adjustment are as follows: Place an empty test tube above the sensor, and place a white light source above the test tube so that the incident light can pass through the test tube and illuminate TCS230; According to the method introduced above, select the red, green and blue filters in turn, measure the values ​​of red, green and blue respectively, and then calculate the three required adjustment parameters.

When using TCS230 to identify colors, these three parameters are used to adjust the R, G, and B of the measured color. There are two ways to calculate the adjustment parameters: ① Select the filters of the three colors in turn, and then count the output pulses of TCS230 in turn. Stop counting when the count reaches 255, and calculate the time used for each channel separately. These times correspond to the time base used by each filter of TCS230 during the actual test. The number of pulses measured during this period is the corresponding R, G, and B values. ② Set the timer to a fixed time (for example, 10ms), then select the filters of the three colors, calculate the number of output pulses of TCS230 during this period, and calculate a proportional factor. Through this proportional factor, these pulse numbers can be converted to 255. In the actual test, use the same time to count, multiply the measured number of pulses by the obtained proportional factor, and then you can get the corresponding R, G, and B values.

3 Applications of TCS230

3.1 Color recognition circuit

Based on the above analysis, a medical liquid color recognition device is designed using 89C51 and TCS230. The device has the characteristics of simple structure, high recognition accuracy and efficiency, and can communicate with the host computer to transmit the recognition results to the host computer in real time. Since the use of TCS230 is explained, only the TCS230 recognition circuit is given below, as shown in Figure 3. In Figure 3, several pins of the P1 port of 89C51 are used to control the various control pins of TCS230, and the output pin of TCS230 is connected to the input end (P3.5) of the timer/counter 1 of 89C51. Set the 89C51 timer/counter to the corresponding working mode, initialize the 89C51 timer to a fixed value, select the output scale factor of TCS230, and enable the output pin. In actual use, by reading the value of the 89C51 counter, the three output frequencies of TCS230 can be calculated respectively, and then the R, G, B values ​​and colors can be determined.

Now, based on the above analysis, the corresponding software flow is given, as shown in Figure 4.

In the program flow: System initialization is responsible for setting the working mode of the 89C51 timer/counter, selecting the output scale factor of TCS230, enabling the output pin and setting the communication parameters. After the initialization is completed, check whether white balance adjustment is required. If yes, call the white balance subroutine; otherwise, go to the next step to check whether color recognition is required. If no, return; if color recognition is required, call the color recognition subroutine until color recognition is completed.

4 Issues that need attention in application

① Avoid interference from external light during color recognition, otherwise it will affect the results of color recognition. It is best to place the sensor, light source, etc. in a closed, non-reflective box for testing;

② There are no special requirements for the light source, but the light emitted by the light source should be concentrated as much as possible, otherwise it will cause mutual interference between sensors;

③ When using TCS230 for the first time, or when the TCS230 recognition module is restarted or the light source is changed, white balance adjustment is required.

Conclusion

Starting from the structural characteristics of TCS230, this article introduces the knowledge of color light theory and color recognition, as well as the principle of white balance and the method of adjustment. Combined with a specific application, the corresponding hardware design circuit and software flow chart are given. This sensor and the method introduced in this article are also very helpful for other color recognition.

Reference address:Principle and application of programmable color sensor TCS230

Previous article:Principle of grating structured light sensor
Next article:Principle and application of high-resolution color sensor TCS230

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号