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.
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.
Previous article:Principle of grating structured light sensor
Next article:Principle and application of high-resolution color sensor TCS230
- Popular Resources
- Popular amplifiers
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University Hall----Switching power supply design technology and application examples
- Altium Designer 19 DRC check, it is clearly connected but it still shows Un-Routed Net, and NetAntennae via
- iTOP3399 development board Debian system settings boot auto-start script
- Technical issues with RF IC (A7105)
- MSP430F5529 general I/O port settings
- About equipment electrostatic protection
- Introduction to WiFi DFS and WiFi Adaptive
- Should the external ADC not use the same power supply as the microcontroller?
- Various filters used in circuits,,,
- EEWORLD University Hall ---- IoT Moment: When Intelligence is No Longer Intelligent