Algorithm Design of Carbon Monoxide Gas Detector

Publisher:轻松自在Latest update time:2011-06-06 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
Carbon monoxide (CO) is the most common toxic, harmful, flammable and explosive gas, which brings great harm to industrial safety production. Therefore, it is very necessary to develop a gas detector that can accurately measure the concentration of carbon monoxide gas in real time. At present, the main detection methods used for carbon monoxide gas are gas chromatography, optical interferometry, semiconductor gas sensor, infrared spectrum absorption, etc. The above four carbon monoxide gas concentration measurement methods have their own advantages and disadvantages. However, the infrared spectrum absorption method shows more advantages. The basic principle of infrared spectrum absorption is: align the wavelength of the narrow-band light source with a certain absorption peak of the measured gas, modulate the laser wavelength with a sinusoidal signal, and the modulated laser passes through the measured gas. Due to the absorption effect of the gas, the wavelength modulation is converted into intensity modulation. When the central wavelength of the laser is aligned with the center of the gas absorption peak, the output light contains the second harmonic signal of the modulation frequency, and the signal amplitude is proportional to the concentration of the gas. By extracting the second harmonic of the absorption signal, the gas concentration can be measured. Compared with the differential absorption method, the harmonic detection method has higher resolution. This paper uses infrared spectral absorption to measure the concentration of carbon monoxide gas. In the design process of carbon monoxide gas detector, the Lagrange interpolation idea is applied to data processing. This paper mainly studies the design of the algorithm in the carbon monoxide gas detector and optimizes the data.

1 The significance of Lagrange interpolation
The basic principle of infrared spectroscopy technology is the Beer-Lambert law. The relationship between the outgoing light intensity I and the incident light intensity Io is I=Ioexp[-a(v)CL], where a(v) is the absorption coefficient of the gas at a certain frequency v; C is the gas concentration; L is the path length of the gas absorption. Since a(v) is a function of the ambient temperature and pressure, the value of a(v) can be obtained as long as the temperature and pressure in the environment are measured. However, the analytical expression of this function is quite complicated and inconvenient to process and calculate. It is impossible to accurately calculate the value of a(v) in real time, and it is also impossible to calculate the concentration of the measured gas. Therefore, designing an algorithm to accurately calculate the value of a(v) will become a key link in carbon monoxide measurement. After calculating the carbon monoxide gas absorption coefficient, the algorithm can be used to measure the carbon monoxide gas concentration according to the Beer-Lambert law.
This paper adopts the Lagrange interpolation algorithm to process the absorption coefficient a(v), and uses the program to accurately calculate the value of the absorption coefficient a(v). Here we can get many absorption coefficients of carbon monoxide gas at different temperatures and pressures through experiments, but they are some isolated and discrete points and are discontinuous. Then use the Lagrange interpolation idea to process it. Since the absorption coefficient a(v) of carbon monoxide is related to the two parameters of temperature and pressure, this paper uses the two-dimensional Lagrange interpolation algorithm to implement it.
When designing the carbon monoxide gas concentration measurement algorithm, the Lagrange interpolation algorithm is used for relevant processing, which can accurately calculate the concentration of carbon monoxide gas. It can be seen that it is very necessary to design an algorithm for carbon monoxide gas detectors. This Lagrange interpolation algorithm idea will have a great application prospect in gas detection.

2 Lagrange interpolation principle
2.1 Lagrange interpolation
Lagrange interpolation is generalized from linear interpolation and parabolic interpolation. It generalizes the interpolation of n=1 and n=2 to the general case. Consider the interpolation polynomial Ln(x) passing through (n+1) points, (xi, f(xi))(i=0,1,2,…,n), so that Ln(xi)=f(xi)i=0,1,2,…,n.
Using the interpolation basis function method, we can get:
1.JPG [page]

2.2 Two-dimensional Lagrange interpolation
First, the principle of two-dimensional Lagrange interpolation is explained. Assume that the function value of f(x, y) is given at the nodes of a rectangular grid on the plane xOy, that is, the value defined at the node is fi,j=f(xi, yj). A double interpolation consists of two steps, each of which uses a one-dimensional interpolation.
The first step is to interpolate in the y direction and find the interpolation values ​​of points E and F:
2.JPG
3.JPG
The second step is to perform linear interpolation between fE and fF:
4.JPG
The bilinear region of the two-dimensional region is shown in Figure 1.

5.JPG


By writing these two steps into a formula, we can get:
4.JPG
The above part uses the two-dimensional linear interpolation method to process the data. This method still has some shortcomings for data processing. According to the same data processing idea mentioned above, the two-dimensional Lagrange interpolation algorithm can be used to achieve the same function and make the data processing effect better.

3 Lagrange interpolation algorithm design
3.1 Lagrange interpolation algorithm implementation method
This algorithm uses the Lagrange interpolation formula to perform group interpolation on two-dimensional unequally spaced observation data to calculate the absorption coefficient. Different node numbers n can be selected to implement interpolation. There are observation series (x1, y1), (x2, y2), ..., (xn, yn), and x1 7.JPG
Where: j is the largest number among the n interpolation nodes taken during moving interpolation, and is taken as follows:
8.JPG
m is the number of sample points in the observation sequence.
Through the processing of the two-dimensional Lagrangian interpolation algorithm, the absorption coefficient can be calculated more accurately, and then the concentration of the measured carbon monoxide gas can be inferred according to the Beer-Lambert law I=Ioexp[-a(v)CL] 9.JPG , where a(v) is the absorption coefficient; I(t), Io can be measured by a laser detector; L is the absorption path length, which is set by the designer. [page]

3.2 Steps to implement the Lagrangian interpolation algorithm
The steps to implement the Lagrangian interpolation algorithm are:
(1) Give the required input quantity, give the interpolation node control number n, the interpolation point sequence (xi, yi), i=0, 1, 2, ..., n, and the point x to be calculated.
(2) Design the Lagrangian interpolation function (pseudocode form)
10.JPG
Step 3: Output the calculation result fx of ln(x)

4 Experimental results
After correction using the Lagrangian interpolation algorithm, the concentration of several groups of measured gases at different temperatures and pressures was measured experimentally, and compared with the experimental given sample gas concentration value, and the difference between the measured result and the standard concentration was obtained. The performance of the gas detector can be known from the measured difference. The data is shown in Table 1:

11.JPG


Through experiments, we know that the temperature and pressure of the measured gas are unknown. The temperature and pressure measured by the sensor may not exist in the data table. For these non-existent temperature and pressure points, the Lagrange interpolation algorithm can be used to process them and accurately measure the concentration of the measured gas in real time. It can be seen that it is very necessary to design an algorithm for carbon monoxide gas detectors. This Lagrange interpolation algorithm idea will have a great application prospect in gas detection.

5 Conclusion
This paper uses the Lagrange interpolation idea based on the infrared spectrum absorption principle to realize the data processing of carbon monoxide gas detectors. It explains in detail the idea of ​​Lagrange interpolation and the practical significance of using the Lagrange interpolation algorithm, and uses the Lagrange interpolation algorithm to realize the measurement of the concentration of the measured gas. Freescale microcontroller is used as the processor, Code Warrior is used as the development platform, and C language is used to implement the Lagrange interpolation algorithm. Experiments show that the system is based on the principle of infrared spectral absorption and uses the Lagrange interpolation algorithm to measure the carbon monoxide concentration in the environment. Compared with previous gas detectors, this design method reduces the hardware structure, optimizes system performance, saves costs, shortens the development cycle, and makes the detection results more accurate.

Reference address:Algorithm Design of Carbon Monoxide Gas Detector

Previous article:Research and development of fault diagnosis instruments for air-to-air missile test equipment
Next article:Design of Waveform Recording Analyzer Based on LabWindows

Latest Test Measurement 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号