Indoor Harmful Gas Monitoring System Based on AT89C52 Single Chip Microcomputer

Publisher:reaper2009Latest update time:2011-10-28 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction
The current situation of environmental protection in China is becoming more and more severe. Environmental pollution and ecological damage have seriously restricted economic development to a certain extent and increasingly threatened the health and safety of modern people. Among them, the economic losses caused by air pollution and the increase in the incidence of the population are very alarming. Air pollution here is a broad concept. It refers to both atmospheric pollution in the usual sense and indoor air pollution. It also refers to the high risk of air environment in certain specific production industries such as coal mining and smelting. In any case, the cause is that the content of harmful gases in the air exceeds or even greatly exceeds its minimum allowable concentration.
Harmful gases refer to various gases that pose a threat to human health or life safety, such as toxic gases that can poison people, non-toxic but suffocating gases, explosive or flammable gases, and those that destroy the ecology and endanger the human living environment, such as greenhouse gases.

1 System working principle and structure
The system is designed to achieve online detection of harmful gas concentrations. It is a real-time analysis instrument that uses the Lambert-Beer law as the basis for quantitative analysis and calculates the concentration of the measured gas by measuring the absorbance of harmful gases to infrared light. The whole system is divided into three parts according to its functions: (1) monochromatic infrared light emission system; (2) data acquisition system; (3) single-chip microcomputer control system. The monochromatic light emission system includes a mid-infrared light-emitting diode array and its driving circuit. The data acquisition system includes an infrared detector and its bias circuit, a signal amplification circuit and an analog/digital conversion circuit. The single-chip microcomputer control circuit includes a logic control circuit and a display and alarm circuit.
Figure 1 is the overall block diagram of the system. Although the whole system is divided into several modules according to its functions, it works in a unified manner under the control of an external clock and a single-chip microcomputer, realizing the real-time measurement of harmful gases.

a.jpg


The harmful gas detection system designed in this paper is based on the infrared absorption principle of light. The mid-infrared light emitting diode used in the monochromatic light source is an infrared light source that is very suitable for gas analysis and detection, ensuring that both good monochromaticity and large emission power can be obtained in the mid-infrared region. In addition to having a wide spectral range (2μm~7μm), the new indium antimonide (InSb) infrared detector also has a fast response speed (time constant <1μs), and its high detection sensitivity ensures the accuracy of detection. By studying the absorption peak positions of several major harmful gases in the mid-infrared region, such as: methane-3.35 μm, carbon dioxide-4.65 μm, carbon dioxide-4.26 μm, formaldehyde-3.5 μm, nitrogen oxide-5.25 μm, ammonia-3.03 μm. The system selects a group of mid-infrared diodes as infrared light sources, and the entire hardware circuit is designed around the infrared light source and the single-chip microcomputer. The external independent pulse not only drives the current source of the light-emitting diode but also serves as the synchronous clock of each functional module of the system. In order to obtain the accurate value of the weak signal after photoelectric conversion, a DC signal amplification circuit is designed. The A/D conversion circuit controlled by the single-chip microcomputer realizes automatic data collection, and the LCD screen reflects the system status and measurement results in real time. The system software adopts a modular design, which is not only easy to debug and maintain, but also can meet the function upgrade of the system.

2 System hardware composition
Since this system is an automated detection instrument with a single-chip microcomputer as the core, its data processing task is not very heavy for small-scale signal detection, so the AT89C52 of ATMEL is selected here. Compared with 89C51, AT89C52 has richer on-chip resources. For example, there are 8 k bytes of on-chip EEP-ROM and 256 bytes of on-chip RAM, which are sufficient for the control program of this system, so the off-chip program memory and off-chip RAM can be omitted, reducing costs and simplifying the control circuit. AT89C52 has 3 16-bit clocks (counters), and all 32 I/O lines are programmable, and the clock can be as high as 24 M. Compared with 89C51, it is more flexible to use. This article only designs the external control, display and alarm modules of the single-chip microcomputer system.
[page]

3 System software design
The system workflow is as follows: the infrared gas sensor installed in the room obtains the original signal of the measured object, and obtains the corrected matching signal after temperature compensation and sampling amplification. After sampling and holding, it enters A/D conversion to obtain the digital signal of the measured object, and then the single-chip microcomputer processes the data to obtain the final indoor harmful gas concentration value, which is displayed through the digital tube and saved in the data buffer. At the same time, it is judged whether the environmental concentration exceeds the standard according to the limit parameters set by the system.
The main program flow chart is shown in Figure 2.

b.jpg


3.1 Flowchart and design of concentration display subroutine
The shift register 74LS164 only has serial input and parallel output functions and no decoding function.
Therefore, before writing the display driver, it is necessary to first calculate and write out the LED segment selection code corresponding to this circuit, and then send it to the serial input end of 74LS164 through the P3.0 port of 80C52, and then output it in parallel to the segment selection end of the LED. Figure 3 is the flow chart of the concentration display subroutine.

c.jpg


3.2 Alarm subroutine flow chart and design
When the indoor harmful gas concentration exceeds the alarm setting value, the alarm will sound. To prevent false alarms, the gas concentration is quickly and repeatedly detected and the alarm is delayed in the program design. Figure 4 is the alarm subroutine flow chart.

4 Conclusion
Gas detection has important value in environmental protection and industrial applications. Due to the characteristics of the infrared region, the infrared absorption method is a feasible and advantageous measurement method for detecting gas in this band. Compared with the traditional wet chemical method, it has the characteristics of short response time, simple operation and high precision. This paper focuses on the overall idea of ​​designing a new and convenient gas detector using the infrared absorption method, and introduces the overall structure and working principle of the system in detail.
The detection method for indoor environmental pollution proposed in this paper needs to be further improved and improved in practical application. For example, the use of more advanced micro-signal detection technology can improve the accuracy, and the introduction of neural network, wavelet transform and other theories can realize multi-component gas detection, etc., so as to provide a scientific basis for improving the indoor environmental quality.

Reference address:Indoor Harmful Gas Monitoring System Based on AT89C52 Single Chip Microcomputer

Previous article:Design of single chip microcomputer timing counter circuit
Next article:Design of electronic piano circuit based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号