SlideShare a Scribd company logo
1 of 6
Download to read offline
IOSR Journal of Engineering (IOSRJEN) www.iosrjen.org
ISSN (e): 2250-3021, ISSN (p): 2278-8719
Vol. 05, Issue 05 (May. 2015), ||V1|| PP 06-11
International organization of Scientific Research 6 | P a g e
Petroleum products color detecting system using RGB color sensor
Song Jinbo, Duan Zhiwei
School of electric and information engineering, Northeast Petroleum University,Daqing 163318,China
Abstract: - In this project we are going to study petroleum products color detection system, which is based on
colorimetry and color measurement theories. We use the RGB color sensor TCS320 as the color acquisition unit,
enhanced 51 series microcontroller STC12C5A60S2 as the control unit. In order to increasing the system
accuracy and reliability, we use the software processing methods such as white balance adjustment and
instrument zero calibration. Experiment proof that the system has the advantages of simple hardware structure
and strong anti-interference capacity.
Key words: - TCS320, color detection, microcontroller STC12C5A60S2
I. INTRODUCTION
With the development of colorimetry and relative theories, color recognition technology is widely used
in different industries. For example, in the petrochemical industry we can preliminary analysis the colloid
content by observing the color of the petroleum products, but in the lube oil there are some additives which has
its own color, so, it is not authoritative to determine the high quality just by observing the color of the products.
So we need to measure the color of the petroleum products carefully so that to distinguish the composition of the
color. There are two methods used for color measurement, spectrophotometry and photoelectric integrating
method. The spectrophotometry is a kind of indirect measurement method, it not measure the color of the object
to be measured directly, but measure the light energy of the reflected or transmission light from the object
indirectly, and then calculate the tristmulus values of the color form spectral characteristics analysis. The
photoelectric integrating method is a kind of direct measurement method, it measure the spectrum energy of the
object directly, so that to get the tristmulus values of the color of the object. In this project we are going to study
a petroleum products color detection system, use the RGB color sensor for tristmulus values acquisition, then
compare the data with the color values defined by CIE, so that to make sure the color of the petroleum products.
The system can not only detect the color of the petroleum products, but also preliminary analysis the colloid
content according to the color measurement results.
II. TRISTIMULUS VALUES MEASURING PRINCIPLE
If we want to get a new color such as C, we need a process called color matching, in which match the three
primary colors (red, green, and blue) together quantificationally, the quantity of the three colors is called
tristimulus values. So we can express any color C as follow:
)()()()( BBGGRRCC  (1)
Here the symbol” ”means color matching. In addition, different color also can be expressed as )( (called
color stimulation function). It thus appease that color measurement in fact is solving the function )( of the
object by mathematical means.
Petroleum products color detecting system using RGB color sensor
International organization of Scientific Research 7 | P a g e
The stimulation function )( of transparent objects is related to both the spectral distribution )(S of the
lighting source and the spectral transmission factor )(T of the object, it is expressed as:
)()()(  TS  (2)
The stimulation function )( of non-transparent objects is related to both the spectral distribution )(S of
the lighting source and the spectral reflectance transmission factor )(R of the object, it is expressed as:
)()()(  RS  (3)
According to the tristimulus value formula, the relation between color stimulation function )( and the
tristimulus values of the color is listed in below.



















dzKZ
dyKY
dxKX
)()(
)()(
)()(
(4)
Where )(x , )(y , )(z are the spectral tristimulus values defined by CIE, can be obtained through the
look-up table, K is a normalization coefficient of the lighting source or illuminate object, it is calculated
according to the formula:



 dyS
K
)()(
100
(5)
The tristimulus values X Y Z of the color under test can be calculate from the formula. Then we can determine
the color of the object.
III. DESIGN OF COLOR DETECTING SYSTEM
Since the petroleum products are always liquid, according to the Beer-Lam-bert law, for the liquid color
measurement, transmission method is recommended, so that to get more reliable spectral power distribution
curve and then indentify the color of the liquid accurately. We adopt the transmission method in this project.
Petroleum products color detecting system using RGB color sensor
International organization of Scientific Research 8 | P a g e
The functional modules of the system are as follow: LED lighting units, RGB color sensor units, control units
and color information display units. Fig1 is the structure of the overall detecting system in block diagram.
IV. HARDWEAR DESIGN
4.1 Lighting units
The lighting source and collimating system constitute the lighting units. The lighting source is made up
of six white patch type high brightness LED, which distribute uniformly on a diameter of about 3cm
circumference. The collimating system adopts double cemented lens, then we place the LED lighting source at
the focus of the collimating system. After the system is powered on, open the lighting source, then the
collimating system converts the unparallel nouniform LED light intensity to a parallel and uniform light
intensity, so that facilitate the application.
4.2 Measurement and control units
This design adopts RGB color sensor TCS230 produced by TAOS, it can convert the colorful input light to
frequency signal as output, since the TCS230 chip integration with 3 kinds(red, green and blue) of color filter.
TCS230 is the first RGB color sensor chip compatible with digital interface. Fig2 and fig3 are the soic package
and functional block of TCS230
Fig2 Soic package of TCS230
Fig3 Functional block diagram of TCS230
The microprocessor adopts industrial-grade microcontroller STC12C5A60S2. It is a new generation of 8051
single chip, compare with the traditional 8051, it has the advantages of high speed, low power consumption and
strong anti-interference, its instruction code is fully compatible with traditional 8051, but faster than the
traditional 8051 8`12times.
The operation mode of the filter in the color sensor is controlled by the two I/O ports P12 and P13
during the color measurement. When the sensor TCS230 color filter in a state of selecting module, it passes
through only the specific primary color, but remove the other two primary colors, so that we can obtain the
output frequency of the primary colors within the stipulated time. The power off mode or the value of
output-scale-factor is controlled by the two I/O ports P10 and P11, since different output-scale-factor
corresponding to different measurement range. The frequency output of the TCS230 is connected with the I/O
S0 S1 OES2 S3
Photodiode
Array
Current-to-frequency
Converter
Light
Output
Petroleum products color detecting system using RGB color sensor
International organization of Scientific Research 9 | P a g e
port P14 in the MCU. Table 1 list the combing control signal in MCU.
Table1 Selectable options of single chip control signal
P12 P13 Photodiode type P10 P11 Frequency scaling
0 0 red 0 0 powered off
0 1 blue 0 1 2%
1 0 Clear(no filter) 1 0 20%
1 1 green 1 1 100%
4.3 Color detection circuit design
The hardware circuit design of the system includes color sensor circuit, MCU smallest system and 12864LCD
display circuit. Since the output of the TCS230 is digital signal, it is not necessary for the system to have A/D
convertor, so we can simply connect the color sensor to the MCU. In the MCU smallest system, the reset circuit
adopts manual reset, the crystals adopts external clock circuit. In this project we enhance the driving capability
of P0 port by connecting externally 4.7 k pull-up resistor RB1, since the structure of P0 port in the MCU is
open-collector. In fact we can adopt inner crystals and power-on reset to simple the circuit design. The display
circuit adopts the back light character type 12864 LCD, the power voltage is 5 volts, the tristimulus values are
displayed on it. Fig4 is the color detection circuit of the system.
P1 0
1
P1 1
2
P1 2
3
P1 3
4
P1 4
5
P1 5
6
P1 6
7
P1 7
8
INT1
13
INT0
12
T1
15
T0
14
EA/VP
31
X1
19
X2
18
R ESET
9
R D
17
W R
16
P0 0
39
P0 1
38
P0 2
37
P0 3
36
P0 4
35
P0 5
34
P0 6
33
P0 7
32
P2 0
21
P2 1
22
P2 2
23
P2 3
24
P2 4
25
P2 5
26
P2 6
27
P2 7
28
R XD
10
TXD
11
ALE/P
31
PS EN
29
STC1 2C 5A60S 2U1
S0
1
S1
2
S2
7
S3
8
OUT
6
OE
3
VCC
5
GND
4
TC S2 30
R 5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
12 864
J1
1
2
3
4
5
6
7
8
9
R B1
C 3
C 2
Y1
C RYSTAL
+
C 1
S1
P1 4
P1 5
VCC P1 4
P1 5
VCC R ST
VCC
R ST
VCC
P0 0
P0 1
P0 2
P0 3
P0 4
P0 5
P0 6
P0 7
P2 0
P2 1
P2 2
R 2
VCC
VCC
P2 0
P2 1
P2 2
P0 0
P0 1
P0 2
P0 3
P0 4
P0 5
P0 6
P0 7
VCC
VCC
VCC
Fig4 Color detection circuit of the system
V. SOFTWARE DESIGN
White is the mixture of the three primary colors in equal proportion according to the color matching
theory. The experiments proved that the proportion of three primary colors is not equal for white color products
detected by TCS230, since the discordance of the sensor sensitive to the three primary colors. It is necessary to
do white balance adjustment before color measuring, so that the three primary colors in equal proportion when
measure white color used TCS230.
After the system is powered on, first adjust the white balance, and then execute the oil color tristimulus values
measurement task. The products color tristimulus values measurement process is as follow: gate on the three
color filter of TCS230 in order, using the timer T0 of microcomputer time the same interval of each channel
respectively, then using the timer T1 count the number of the impulse in each channel, so the tristimulus values
Petroleum products color detecting system using RGB color sensor
International organization of Scientific Research 10 | P a g e
R, G, B can be calculated by the number of impulses in each channel. The program flow chart of the system is as
Fig5.
Fig5 Flow chart of the system
VI. EXPERIMENTAL PROCESS ANALYSIS
Before color measuring, we need calibrate the device so that to reduce the system error and improve the
measuring accuracy. The calibration process was done in a dark room that enclosed totally. The tristimulus
values at zero point are R0 G0 B0 which measured by TCS230 in the dark room, then during the following
products color detection process, we got the color tristimulus values by subtracting the T0 G0 B0 from values
measured after white balance process R G B. The tristimulus values of 7 kinds of lubricating oil was measured
by the system, and the results as table 2.The measuring scale is 0-255, the results of the measurement is present
by positive number, and the values at zero point is R0 G0 B0.
Table2 Selectable options of single chip control signal
Oil sample R G B
1 205 130 65
2 241 230 145
3 255 220 170
4 240 165 96
5 212 85 30
6 160 70 45
7 140 100 20
We found from the experimental that the color of the lubricate oil without additive is from faint yellow to dark
brown, and the pectin content in the oil become higher, the color of the oil become darker. From table2 we
System initialization
White balance
R/G/B switch gate
Timer T0 and counter T1
T0 time out?
Close timer T0
Data processing
finish
Measure Finish
Count number storage
Data display
N
Y
Y
N
Petroleum products color detecting system using RGB color sensor
International organization of Scientific Research 11 | P a g e
found that the system we designed can be used for detecting the color of different petroleum products, and have
higher accuracy. Compare the measured values with the specified values of different colors cited by CIE, we can
get the color of the oil product determinately.
VII. CONCLUSION
The petroleum products color detection system based on microcomputer STC12C5A60S2 and color
sensor TCS230 has the advantages of simple construction and ease of handling. Experimental results show that
the system has good effects on the oil products color detection, and measuring results are accurate and reliable.
The application and generalization of the system may have certain practical value on the analysis of petroleum
products.
REFERENCES
[1] Parichat Kinnaree, Singthong Pattanasethanon, Somsak Thanaputtiwirot, Somchat Boontho.
RGB Color Correlation Index for Image Retrieval[J]. Procedia Engineering, 2011, Vol.8 , pp.36-41
[2] Chen Jiasheng. Portable liquid color test instrument[J]. Journal of sensor technology,2006,19(1):253-255.
[3] Hu Jianmin. Color detection circuit with color sensor TCS230[J]. Journal of sensor
technology,2003,16(4):32-35.
[4] Lu Chuanying, Yu Haocheng, Sun Jinghui. Color detection system based on TCS230[J]. Jorunal of Jilin
University. 2008,26(6):621-626
[5] Zhao Xiaofeng,Tang Xinzhong, Luan Lixin etc. The application of petroleum products color tester in
gasoline analysis[J]. Chemical Engineer. 2011,(12):70-71.

More Related Content

Similar to B05510611

RGB colour analyzer without a programmming device.
RGB colour analyzer without a programmming device.RGB colour analyzer without a programmming device.
RGB colour analyzer without a programmming device.Isuru Lakmal Wickramasuriya
 
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEW
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEWMeasurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEW
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEWIOSR Journals
 
Colour Detector and Separator Based on Microcontroller
Colour Detector and Separator Based on MicrocontrollerColour Detector and Separator Based on Microcontroller
Colour Detector and Separator Based on Microcontrollerijtsrd
 
Color Sorting Robotic Arm
Color Sorting Robotic ArmColor Sorting Robotic Arm
Color Sorting Robotic ArmIRJET Journal
 
Similarity and Variance of Color Difference Based Demosaicing
Similarity and Variance of Color Difference Based DemosaicingSimilarity and Variance of Color Difference Based Demosaicing
Similarity and Variance of Color Difference Based DemosaicingRadita Apriana
 
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...IJERA Editor
 
Direct digital synthesis based cordic algorithm a novel approach towards digi...
Direct digital synthesis based cordic algorithm a novel approach towards digi...Direct digital synthesis based cordic algorithm a novel approach towards digi...
Direct digital synthesis based cordic algorithm a novel approach towards digi...eSAT Journals
 
Light sensing robot
Light sensing robotLight sensing robot
Light sensing robotsvsembedded
 
Lecture 3 (ADSP).pptx
Lecture 3 (ADSP).pptxLecture 3 (ADSP).pptx
Lecture 3 (ADSP).pptxHarisMasood20
 
Color
ColorColor
ColorFNian
 
PulseOxymetry_AN_Finalv3p1
PulseOxymetry_AN_Finalv3p1PulseOxymetry_AN_Finalv3p1
PulseOxymetry_AN_Finalv3p1Ahmed Ghouri
 
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINA MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINijistjournal
 
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINA MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINijistjournal
 
Spatialization Parameter Estimation in MDCT Domain for Stereo Audio
Spatialization Parameter Estimation in MDCT Domain for Stereo AudioSpatialization Parameter Estimation in MDCT Domain for Stereo Audio
Spatialization Parameter Estimation in MDCT Domain for Stereo AudioCSCJournals
 
quantization and sampling presentation ppt
quantization and sampling presentation pptquantization and sampling presentation ppt
quantization and sampling presentation pptKNaveenKumarECE
 
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...University of Malaya (UM)
 
Secured transportation of quantum codes using integrated panda adddrop and td...
Secured transportation of quantum codes using integrated panda adddrop and td...Secured transportation of quantum codes using integrated panda adddrop and td...
Secured transportation of quantum codes using integrated panda adddrop and td...University of Malaya (UM)
 

Similar to B05510611 (20)

RGB colour analyzer without a programmming device.
RGB colour analyzer without a programmming device.RGB colour analyzer without a programmming device.
RGB colour analyzer without a programmming device.
 
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEW
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEWMeasurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEW
Measurement of Pulse rate and SPo2 using Pulse Oximeter developed using LabVIEW
 
Colour Detector and Separator Based on Microcontroller
Colour Detector and Separator Based on MicrocontrollerColour Detector and Separator Based on Microcontroller
Colour Detector and Separator Based on Microcontroller
 
Color Sorting Robotic Arm
Color Sorting Robotic ArmColor Sorting Robotic Arm
Color Sorting Robotic Arm
 
Similarity and Variance of Color Difference Based Demosaicing
Similarity and Variance of Color Difference Based DemosaicingSimilarity and Variance of Color Difference Based Demosaicing
Similarity and Variance of Color Difference Based Demosaicing
 
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...
Correlated Color Temperature and Total Luminous Flux Influenced by Electrical...
 
Direct digital synthesis based cordic algorithm a novel approach towards digi...
Direct digital synthesis based cordic algorithm a novel approach towards digi...Direct digital synthesis based cordic algorithm a novel approach towards digi...
Direct digital synthesis based cordic algorithm a novel approach towards digi...
 
Light sensing robot
Light sensing robotLight sensing robot
Light sensing robot
 
Lecture 3 (ADSP).pptx
Lecture 3 (ADSP).pptxLecture 3 (ADSP).pptx
Lecture 3 (ADSP).pptx
 
FinalReport
FinalReportFinalReport
FinalReport
 
Chapter 4 plc
Chapter 4 plcChapter 4 plc
Chapter 4 plc
 
Colour sensor vivek
Colour sensor   vivekColour sensor   vivek
Colour sensor vivek
 
Color
ColorColor
Color
 
PulseOxymetry_AN_Finalv3p1
PulseOxymetry_AN_Finalv3p1PulseOxymetry_AN_Finalv3p1
PulseOxymetry_AN_Finalv3p1
 
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINA MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
 
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVINA MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
A MEDIAN BASED DIRECTIONAL CASCADED WITH MASK FILTER FOR REMOVAL OF RVIN
 
Spatialization Parameter Estimation in MDCT Domain for Stereo Audio
Spatialization Parameter Estimation in MDCT Domain for Stereo AudioSpatialization Parameter Estimation in MDCT Domain for Stereo Audio
Spatialization Parameter Estimation in MDCT Domain for Stereo Audio
 
quantization and sampling presentation ppt
quantization and sampling presentation pptquantization and sampling presentation ppt
quantization and sampling presentation ppt
 
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...
Secured Transportation of Quantum Codes Using Integrated PANDA-Add/drop and T...
 
Secured transportation of quantum codes using integrated panda adddrop and td...
Secured transportation of quantum codes using integrated panda adddrop and td...Secured transportation of quantum codes using integrated panda adddrop and td...
Secured transportation of quantum codes using integrated panda adddrop and td...
 

More from IOSR-JEN

More from IOSR-JEN (20)

C05921721
C05921721C05921721
C05921721
 
B05921016
B05921016B05921016
B05921016
 
A05920109
A05920109A05920109
A05920109
 
J05915457
J05915457J05915457
J05915457
 
I05914153
I05914153I05914153
I05914153
 
H05913540
H05913540H05913540
H05913540
 
G05913234
G05913234G05913234
G05913234
 
F05912731
F05912731F05912731
F05912731
 
E05912226
E05912226E05912226
E05912226
 
D05911621
D05911621D05911621
D05911621
 
C05911315
C05911315C05911315
C05911315
 
B05910712
B05910712B05910712
B05910712
 
A05910106
A05910106A05910106
A05910106
 
B05840510
B05840510B05840510
B05840510
 
I05844759
I05844759I05844759
I05844759
 
H05844346
H05844346H05844346
H05844346
 
G05843942
G05843942G05843942
G05843942
 
F05843238
F05843238F05843238
F05843238
 
E05842831
E05842831E05842831
E05842831
 
D05842227
D05842227D05842227
D05842227
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

B05510611

  • 1. IOSR Journal of Engineering (IOSRJEN) www.iosrjen.org ISSN (e): 2250-3021, ISSN (p): 2278-8719 Vol. 05, Issue 05 (May. 2015), ||V1|| PP 06-11 International organization of Scientific Research 6 | P a g e Petroleum products color detecting system using RGB color sensor Song Jinbo, Duan Zhiwei School of electric and information engineering, Northeast Petroleum University,Daqing 163318,China Abstract: - In this project we are going to study petroleum products color detection system, which is based on colorimetry and color measurement theories. We use the RGB color sensor TCS320 as the color acquisition unit, enhanced 51 series microcontroller STC12C5A60S2 as the control unit. In order to increasing the system accuracy and reliability, we use the software processing methods such as white balance adjustment and instrument zero calibration. Experiment proof that the system has the advantages of simple hardware structure and strong anti-interference capacity. Key words: - TCS320, color detection, microcontroller STC12C5A60S2 I. INTRODUCTION With the development of colorimetry and relative theories, color recognition technology is widely used in different industries. For example, in the petrochemical industry we can preliminary analysis the colloid content by observing the color of the petroleum products, but in the lube oil there are some additives which has its own color, so, it is not authoritative to determine the high quality just by observing the color of the products. So we need to measure the color of the petroleum products carefully so that to distinguish the composition of the color. There are two methods used for color measurement, spectrophotometry and photoelectric integrating method. The spectrophotometry is a kind of indirect measurement method, it not measure the color of the object to be measured directly, but measure the light energy of the reflected or transmission light from the object indirectly, and then calculate the tristmulus values of the color form spectral characteristics analysis. The photoelectric integrating method is a kind of direct measurement method, it measure the spectrum energy of the object directly, so that to get the tristmulus values of the color of the object. In this project we are going to study a petroleum products color detection system, use the RGB color sensor for tristmulus values acquisition, then compare the data with the color values defined by CIE, so that to make sure the color of the petroleum products. The system can not only detect the color of the petroleum products, but also preliminary analysis the colloid content according to the color measurement results. II. TRISTIMULUS VALUES MEASURING PRINCIPLE If we want to get a new color such as C, we need a process called color matching, in which match the three primary colors (red, green, and blue) together quantificationally, the quantity of the three colors is called tristimulus values. So we can express any color C as follow: )()()()( BBGGRRCC  (1) Here the symbol” ”means color matching. In addition, different color also can be expressed as )( (called color stimulation function). It thus appease that color measurement in fact is solving the function )( of the object by mathematical means.
  • 2. Petroleum products color detecting system using RGB color sensor International organization of Scientific Research 7 | P a g e The stimulation function )( of transparent objects is related to both the spectral distribution )(S of the lighting source and the spectral transmission factor )(T of the object, it is expressed as: )()()(  TS  (2) The stimulation function )( of non-transparent objects is related to both the spectral distribution )(S of the lighting source and the spectral reflectance transmission factor )(R of the object, it is expressed as: )()()(  RS  (3) According to the tristimulus value formula, the relation between color stimulation function )( and the tristimulus values of the color is listed in below.                    dzKZ dyKY dxKX )()( )()( )()( (4) Where )(x , )(y , )(z are the spectral tristimulus values defined by CIE, can be obtained through the look-up table, K is a normalization coefficient of the lighting source or illuminate object, it is calculated according to the formula:     dyS K )()( 100 (5) The tristimulus values X Y Z of the color under test can be calculate from the formula. Then we can determine the color of the object. III. DESIGN OF COLOR DETECTING SYSTEM Since the petroleum products are always liquid, according to the Beer-Lam-bert law, for the liquid color measurement, transmission method is recommended, so that to get more reliable spectral power distribution curve and then indentify the color of the liquid accurately. We adopt the transmission method in this project.
  • 3. Petroleum products color detecting system using RGB color sensor International organization of Scientific Research 8 | P a g e The functional modules of the system are as follow: LED lighting units, RGB color sensor units, control units and color information display units. Fig1 is the structure of the overall detecting system in block diagram. IV. HARDWEAR DESIGN 4.1 Lighting units The lighting source and collimating system constitute the lighting units. The lighting source is made up of six white patch type high brightness LED, which distribute uniformly on a diameter of about 3cm circumference. The collimating system adopts double cemented lens, then we place the LED lighting source at the focus of the collimating system. After the system is powered on, open the lighting source, then the collimating system converts the unparallel nouniform LED light intensity to a parallel and uniform light intensity, so that facilitate the application. 4.2 Measurement and control units This design adopts RGB color sensor TCS230 produced by TAOS, it can convert the colorful input light to frequency signal as output, since the TCS230 chip integration with 3 kinds(red, green and blue) of color filter. TCS230 is the first RGB color sensor chip compatible with digital interface. Fig2 and fig3 are the soic package and functional block of TCS230 Fig2 Soic package of TCS230 Fig3 Functional block diagram of TCS230 The microprocessor adopts industrial-grade microcontroller STC12C5A60S2. It is a new generation of 8051 single chip, compare with the traditional 8051, it has the advantages of high speed, low power consumption and strong anti-interference, its instruction code is fully compatible with traditional 8051, but faster than the traditional 8051 8`12times. The operation mode of the filter in the color sensor is controlled by the two I/O ports P12 and P13 during the color measurement. When the sensor TCS230 color filter in a state of selecting module, it passes through only the specific primary color, but remove the other two primary colors, so that we can obtain the output frequency of the primary colors within the stipulated time. The power off mode or the value of output-scale-factor is controlled by the two I/O ports P10 and P11, since different output-scale-factor corresponding to different measurement range. The frequency output of the TCS230 is connected with the I/O S0 S1 OES2 S3 Photodiode Array Current-to-frequency Converter Light Output
  • 4. Petroleum products color detecting system using RGB color sensor International organization of Scientific Research 9 | P a g e port P14 in the MCU. Table 1 list the combing control signal in MCU. Table1 Selectable options of single chip control signal P12 P13 Photodiode type P10 P11 Frequency scaling 0 0 red 0 0 powered off 0 1 blue 0 1 2% 1 0 Clear(no filter) 1 0 20% 1 1 green 1 1 100% 4.3 Color detection circuit design The hardware circuit design of the system includes color sensor circuit, MCU smallest system and 12864LCD display circuit. Since the output of the TCS230 is digital signal, it is not necessary for the system to have A/D convertor, so we can simply connect the color sensor to the MCU. In the MCU smallest system, the reset circuit adopts manual reset, the crystals adopts external clock circuit. In this project we enhance the driving capability of P0 port by connecting externally 4.7 k pull-up resistor RB1, since the structure of P0 port in the MCU is open-collector. In fact we can adopt inner crystals and power-on reset to simple the circuit design. The display circuit adopts the back light character type 12864 LCD, the power voltage is 5 volts, the tristimulus values are displayed on it. Fig4 is the color detection circuit of the system. P1 0 1 P1 1 2 P1 2 3 P1 3 4 P1 4 5 P1 5 6 P1 6 7 P1 7 8 INT1 13 INT0 12 T1 15 T0 14 EA/VP 31 X1 19 X2 18 R ESET 9 R D 17 W R 16 P0 0 39 P0 1 38 P0 2 37 P0 3 36 P0 4 35 P0 5 34 P0 6 33 P0 7 32 P2 0 21 P2 1 22 P2 2 23 P2 3 24 P2 4 25 P2 5 26 P2 6 27 P2 7 28 R XD 10 TXD 11 ALE/P 31 PS EN 29 STC1 2C 5A60S 2U1 S0 1 S1 2 S2 7 S3 8 OUT 6 OE 3 VCC 5 GND 4 TC S2 30 R 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 12 864 J1 1 2 3 4 5 6 7 8 9 R B1 C 3 C 2 Y1 C RYSTAL + C 1 S1 P1 4 P1 5 VCC P1 4 P1 5 VCC R ST VCC R ST VCC P0 0 P0 1 P0 2 P0 3 P0 4 P0 5 P0 6 P0 7 P2 0 P2 1 P2 2 R 2 VCC VCC P2 0 P2 1 P2 2 P0 0 P0 1 P0 2 P0 3 P0 4 P0 5 P0 6 P0 7 VCC VCC VCC Fig4 Color detection circuit of the system V. SOFTWARE DESIGN White is the mixture of the three primary colors in equal proportion according to the color matching theory. The experiments proved that the proportion of three primary colors is not equal for white color products detected by TCS230, since the discordance of the sensor sensitive to the three primary colors. It is necessary to do white balance adjustment before color measuring, so that the three primary colors in equal proportion when measure white color used TCS230. After the system is powered on, first adjust the white balance, and then execute the oil color tristimulus values measurement task. The products color tristimulus values measurement process is as follow: gate on the three color filter of TCS230 in order, using the timer T0 of microcomputer time the same interval of each channel respectively, then using the timer T1 count the number of the impulse in each channel, so the tristimulus values
  • 5. Petroleum products color detecting system using RGB color sensor International organization of Scientific Research 10 | P a g e R, G, B can be calculated by the number of impulses in each channel. The program flow chart of the system is as Fig5. Fig5 Flow chart of the system VI. EXPERIMENTAL PROCESS ANALYSIS Before color measuring, we need calibrate the device so that to reduce the system error and improve the measuring accuracy. The calibration process was done in a dark room that enclosed totally. The tristimulus values at zero point are R0 G0 B0 which measured by TCS230 in the dark room, then during the following products color detection process, we got the color tristimulus values by subtracting the T0 G0 B0 from values measured after white balance process R G B. The tristimulus values of 7 kinds of lubricating oil was measured by the system, and the results as table 2.The measuring scale is 0-255, the results of the measurement is present by positive number, and the values at zero point is R0 G0 B0. Table2 Selectable options of single chip control signal Oil sample R G B 1 205 130 65 2 241 230 145 3 255 220 170 4 240 165 96 5 212 85 30 6 160 70 45 7 140 100 20 We found from the experimental that the color of the lubricate oil without additive is from faint yellow to dark brown, and the pectin content in the oil become higher, the color of the oil become darker. From table2 we System initialization White balance R/G/B switch gate Timer T0 and counter T1 T0 time out? Close timer T0 Data processing finish Measure Finish Count number storage Data display N Y Y N
  • 6. Petroleum products color detecting system using RGB color sensor International organization of Scientific Research 11 | P a g e found that the system we designed can be used for detecting the color of different petroleum products, and have higher accuracy. Compare the measured values with the specified values of different colors cited by CIE, we can get the color of the oil product determinately. VII. CONCLUSION The petroleum products color detection system based on microcomputer STC12C5A60S2 and color sensor TCS230 has the advantages of simple construction and ease of handling. Experimental results show that the system has good effects on the oil products color detection, and measuring results are accurate and reliable. The application and generalization of the system may have certain practical value on the analysis of petroleum products. REFERENCES [1] Parichat Kinnaree, Singthong Pattanasethanon, Somsak Thanaputtiwirot, Somchat Boontho. RGB Color Correlation Index for Image Retrieval[J]. Procedia Engineering, 2011, Vol.8 , pp.36-41 [2] Chen Jiasheng. Portable liquid color test instrument[J]. Journal of sensor technology,2006,19(1):253-255. [3] Hu Jianmin. Color detection circuit with color sensor TCS230[J]. Journal of sensor technology,2003,16(4):32-35. [4] Lu Chuanying, Yu Haocheng, Sun Jinghui. Color detection system based on TCS230[J]. Jorunal of Jilin University. 2008,26(6):621-626 [5] Zhao Xiaofeng,Tang Xinzhong, Luan Lixin etc. The application of petroleum products color tester in gasoline analysis[J]. Chemical Engineer. 2011,(12):70-71.