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.
Previous article:Design of Remote Power Supply Monitoring System Based on AT89S52
Next article:MCS-51 MCU External Interrupt Software Programming
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Today is Arbor Day, happy holiday~~
- Learn electronics and Arduino from scratch: A beginner's guide to developing boards
- [NUCLEO-L452RE Review] +2.2-inch TFT display driver display
- C2000 CLA debugging and analysis
- [GD32L233C-START Review] 14. CAU encryption algorithm AES
- Setting the switching frequency of the switching power supply chip LTM4613
- Does the power layer of a four-layer board need to be made into a complete plane?
- [Register to enjoy gifts] element16 sincerely invites you to visit the 2019 Munich Shanghai Electronics Show
- I heard that every type of software has a chain of contempt...
- RSL-10 development environment construction