Development of Multi-parameter Gas Detector Based on AT89S51

Publisher:BlissfulWhisperLatest update time:2010-03-09 Source: 微计算机信息 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction

The concentration of oxygen, carbon dioxide, carbon monoxide, hydrogen sulfide and methane in the underground working environment directly affects the safe production of coal mines and the life safety of miners. At the same time, with the development and use of various natural gases, coal-to-gas, and liquefied gas, various combustible gases are emitted in the workplace and people's lives. Therefore, it is extremely important to continuously and directly detect toxic gases and combustible gases in the working environment and living environment. At present, most gas detection uses a single gas detection method, that is, a measuring instrument is required for each gas measurement. The development trend of gas detectors is to develop an instrument that can detect multiple different gases at the same time, that is, to perform multi-parameter measurement and multiple gas detection, to realize the identification of multiple gas types and the judgment of concentration, so as to more comprehensively reflect the characteristics of the measured gas in a specific environment.

This paper introduces the design and implementation of a multi-parameter gas detector based on AT89S51 single-chip microcomputer control.

1 Function and measurement principle of multi-parameter gas detector

1.1 System Function

The functions of the system are shown in Figure 1.

Figure 1 System functional block diagram

As shown in Figure 1, the system consists of 8 functional modules: air intake filtration system (including sampling pump, filter membrane, air chamber, inlet and outlet pipes), sensor and signal processing unit (infrared sensor, electrochemical sensor), main control circuit board (microprocessor, communication interface, data management, etc.), LCD display, human-computer dialogue unit (combination function keys, indicator light board), power supply unit (DC regulated power supply, battery pack, voltage stabilization circuit) and clock input unit.

1.2 System Detection Principle

The system detection principle is shown in Figure 2.

Figure 2 System detection principle diagram

Infrared gas sensors and electrochemical sensors detect five gases, namely oxygen, carbon monoxide, carbon dioxide, hydrogen sulfide and methane. Among them, carbon dioxide and methane are detected by infrared sensors, and oxygen, carbon monoxide and hydrogen sulfide are detected by electrochemical sensors. The signals generated when the measured gas passes through the two types of sensors are amplified and A/D converted, and then collected, calculated and processed by the microprocessor AT89S51 to generate concentration result data, and the data results are compared for over-limit. When the concentration of the measured gas exceeds the alarm limit set by the instrument, the instrument generates an audible and visual alarm, and displays the alarm status, fault status, time parameters and other data information on the display screen, and saves the data results at the same time.

In the air intake filtration system, at least one I/O port is required to control the operation of the sampling pump; in the sensor and signal processing unit, the A/D conversion circuit converts the information about the gas concentration generated by the sensor into a digital signal that can be recognized by the single-chip microcomputer, and the ADC0809 chip with 8 inputs is selected; in the display module, the KS0713 LCD display is used, and the single-chip microcomputer needs to provide 3 I/O control ports; the clock display system uses the DS12887 chip to communicate with the single-chip microcomputer, which requires 1 interrupt input and 1 I/O control port; because the system needs to store at least 500 sets of test information, and the AT89S51 single-chip microcomputer has only 128KB of RAM, we expand the external data storage 6264 by 8K; because the system can set the alarm limit and change time, 5 keyboard interfaces are required to control the setting, rising, falling, right shifting and printing, which uses 5 I/O interfaces; because the interface of the AT89S51 single-chip microcomputer is limited, the I/O interface is expanded using 8255A.

2 Hardware Circuit Design

The hardware circuit mainly includes: sensor and signal processing part, A/D conversion part, clock calibration input part, I/O expansion (keyboard input, micro-print output), LCD display system, sound and light alarm system and suction pump control.

2.1 Sensor sampling circuit design

This article introduces the design of the sampling circuit of the electrochemical sensor for measuring CO. The CO sensor is a 7E/F three-electrode electrochemical sensor produced by Beijing Compaer Technology and Trade Development Co., Ltd. This type of sensor has a wide output linear range, stable linearity, a rated output of 0.1uA/ppm, a minimum resolution of 0.5ppm, and a minimum and maximum measurement range of 0-20ppm and 0-1000ppm respectively. The measurement range of CO is 0-150mg/m︿3, and the maximum measurement range of CO converted to ppm is: Ymax=150/1.25=120 (ppm)

The maximum current converted to sensor output is: Imax=0.1*120=12 (uA)

The output current resolution is: Ii=0.1*0.5=0.05 (uA)

It can be concluded that the detection accuracy is: ε = 0.5ppm/120ppm*100%=0.42%

2.2A/D and clock circuit design

ADC0809 is used as the A/D converter chip.

The system needs to detect and record the gas quality of the environment. The concentration of various gases in the recorded information is a key information. While recording the data, the relevant time information must be saved so that the user can analyze the data and take correct countermeasures. The system expands a DS12887 to provide a time base for the system.

2.3 Display circuit design and I/O expansion

The system uses KS0713 LCD display.

The KS0713 LCD module has 24 command control words. By writing different control words, the initial conditions of the LCD and various operating conditions are set to realize the operating state and operating mode of the LCD.

The I/O expansion uses the 8255A chip.

Use the I/O expansion chip 8255A to connect the keyboard and the micro printer. 8255A is set to work mode 0, and the 5 keyboard inputs are connected to PA0-PA4 as input ports; the printer's data port is connected to the PB port of 8255A as an output port, and the printer's status signal is input to PC0. When the printer is busy, BUSY=1. The data input of the printer uses strobe control, and PC4 is connected to the STB terminal of the printer. When STB has a negative jump, data is input.

2.4 Driving circuit design

Adopt NPN transistor for driving, when the port voltage is high, the voltage of load can reach the maximum. The performance of the vacuum pump used in the system is very good, it only needs DC +5V to work reliably. For the light-emitting diode, a current of 10-20mA is required, and its junction voltage drop and the emitter voltage drop of the transistor are both 0.7V, then the voltage divider value of its voltage divider resistor is 3.6V, from which its resistance value is about 180-360 ohms, and this design uses a 310 ohm resistor as its voltage divider resistor.

3 System Software Design

The system software is compiled in a modular way, and the system main program flow chart is shown in Figure 3.

Figure 3 Main program flow chart

The keyboard scanning subroutine flow chart is shown in Figure 4.

Figure 4 Keyboard scanning subroutine flow chart

After being reset, AT89S51 runs its internal program, selects the analog channel of the first gas and starts A/D conversion, sends the conversion result to the single-chip microcomputer, and starts the conversion of the other four gases in turn in the same way. Since each conversion requires at least 100us of conversion time, the conversion data of the previous gas is compared with the over-limit value set in the program during the conversion of the next gas. If it exceeds the range, an audible and visual alarm is issued. If it is within the range, wait for the next set of measurement results. After the last set of data is converted, the gas concentration information on the display is updated, and then the 5 sets of measurement data together with their gas type and time information are written into the external data storage.

4. Conclusion

The development of multi-parameter gas detector solves the problem that only a single gas can be detected in China, and the detection accuracy is less than ±5% (full scale). In the software design, self-checking program and digital filter program design are adopted to further optimize the detection data and enhance the anti-interference ability of the detector. It is light in weight, easy to maintain, repair and carry, and can also monitor gas concentration by online fixed point sampling.

The author's innovation: the electrochemical principle multi-parameter selection combination method can simultaneously detect the concentration of oxygen, carbon dioxide, carbon monoxide, hydrogen sulfide and combustible gas, solving the problem that only a single gas can be detected at present. According to different industry requirements, different monitoring points, and different detection parameters, different sensors can be replaced to monitor different types of gases, and different monitoring concentrations and resolutions can be set for different gases.

Reference address:Development of Multi-parameter Gas Detector Based on AT89S51

Previous article:Design of Remote Power Supply Monitoring System Based on AT89S52
Next article:MCS-51 MCU External Interrupt Software Programming

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号