Share this

Development of a High-Precision Gas Sensor Testing System

2026-04-06 03:12:06 · · #1
Abstract: This paper introduces a high-precision parameter measurement system for a multi-channel gas sensor based on the high-speed 80C196 microcontroller. Serial communication is used between the computer and the microcontroller. Hardware and software measures are implemented to address interference caused by switching of the multi-channel digital circuits, improving measurement accuracy and safety. The computer can also quickly read, analyze, and save measurement data via the serial port. Keywords: Gas sensor, Filter, 80C196 1 Introduction Gas sensors have wide applications in industry and daily life, especially combustible gas sensors, which play a crucial role in fire and explosion prevention. These sensors are mainly used to measure the concentration of flammable gases in the environment, such as hydrogen, natural gas, and methane. They are typically used to make alarms to monitor the concentration of combustible gases in the air. When the concentration exceeds a certain level, the sensor outputs a warning signal to trigger the alarm device. The accuracy of sensor parameter calibration is very important, because if the calibrated parameters are deviated, the sensor will falsely alarm at non-specified concentrations. Alarms that are too early or too late are both undesirable. To accurately, quickly, and extensively calibrate the parameters of gas sensors, we developed a high-precision, high-speed, computer-communication-enabled multi-channel gas sensor parameter testing system using an 80C196 microcontroller combined with logic circuits. 2. Hardware Circuit Design The hardware circuit of the multi-channel gas sensor parameter tester is shown in Figure 1. The 80C196's built-in A/D converter is used to accurately measure standardized parameter voltages. Due to the large number of sensors to be measured at once, a channel switching control circuit was designed for time-sharing measurement. To improve the safety of testing personnel, the tester communicates with the computer remotely via a serial port, allowing for convenient remote operation of sensor testing and saving/printing of measurement results. [align=center] Figure 1 Hardware Schematic Diagram of Multi-channel Gas Sensor Parameter Tester[/align] The computer is mainly used to control the testing system and analyze, organize, and save the data. The testing section mainly consists of a main control circuit and eight auxiliary circuits. The basic structure of the test section is shown in Figure 2: [align=center] Figure 2 Circuit structure diagram of the test section[/align] The main control circuit includes: an 80C196 expansion circuit, a serial communication circuit, a voltage divider network, and other auxiliary circuits. The microcontroller receives commands from the computer via serial communication and then performs the specified operations: measuring the sensors and transmitting the measurement results. The main control circuit structure is shown in Figure 3: [align=center] Figure 3 Main control circuit structure diagram[/align] The auxiliary circuit structure is shown in Figure 4, which includes a switch network for channel switching. As shown in the figure, each 4051 logic switch has 8 input terminals, and one auxiliary circuit can connect 64 sensors simultaneously. Therefore, the entire system can measure the parameters of 512 sensors at once, greatly improving measurement efficiency. [align=center] Figure 4 Schematic diagram of the auxiliary circuit[/align] To eliminate spectral aliasing in the digital system and filter out the influence of high-frequency noise on the control system, a second-order low-pass anti-aliasing filter is designed at the front end of the sensor signal of the CNC system. The anti-aliasing filter uses a voltage-controlled voltage source second-order low-pass filter circuit as shown in Figure 5. Its transfer function is: [align=center] Figure 5 Anti-aliasing filter circuit schematic[/align] 3 Test System Software Design The microcontroller receives commands from the host computer via the serial port to perform specified operations. Its software flowchart is shown in Figure 6: [align=center] Figure 6 Software Flowchart[/align] Although the hardware circuit already has an anti-aliasing filter circuit, software filtering is added to further improve the accuracy of the test. An IIR digital low-pass filter is designed using the bilinear transform method. The transfer function of the digital filter required by the system is: where the result is calculated using MATLAB. 4 Host Computer Software Design The computer acts as the host computer, sending commands to the microcontroller via the serial port for measurement and reading operations. The software block diagram is shown in Figure 7: [align=center] Figure 7 Upper Computer Software Block Diagram[/align] The interface design is mainly from the user's perspective, including the following points: 1) The interface is self-explanatory, that is, the meaning of each part of the operation interface is clear. 2) The operation method is universal, adopting popular operation, that is, operation is achieved through menus, toolbars and buttons. 3) Illegal operation is prohibited by disabling controls, menus, etc. 4) The function is reminded to the operator by the tooltip when the mouse is placed. 5) A large number of dialog boxes are used to help the operator and prompt the current and subsequent work. To achieve the above requirements, VB is used for interface design, which can not only perform rapid measurement of the sensor, but also quickly display the measurement results on the interface and indicate whether the sensor is qualified. Data Reading and Saving The microcontroller saves the measurement results to its own storage area. The measurement results are temporarily stored in the microcontroller's external data storage area. The A/D conversion value is stored in 8000H-83FFH, a total of 1024 storage units. The lower 8 bits of the conversion value are stored in even units, and the higher 8 bits are stored in odd units. When the microcontroller receives a command to transmit the results, the microcontroller transmits the data to the computer via the serial port. The computer processes the measurement results and stores them in the database. 5 System Features (1) Large batch of sensors: 512 sensors can be measured quickly and accurately at one time. (2) Measurement accuracy: Several aspects that have a significant impact on the measurement results are: the setting of the reference voltage of the A/D converter, the contact resistance of the relay, and the impact on the sampling circuit when the whole system is sampling. The A/D converter of 80c196 is 10-bit, so the resolution for 0-5V is: 0.0049V, and the resolution for 0-12V is: 0.0049*12/5= 0.0117V. 4051, the voltage divider network and the contact resistance of the relay will affect the parameter voltage VRL, causing systematic error, which can be estimated by experimental methods. At the same time, there is also random error, which is unmeasurable. The measurement error can be compensated by debugging the tester. If the software and hardware are debugged correctly, the measurement accuracy of this tester can reach ±2%V. (3) Voltage divider network: In order to improve the measurement accuracy and adapt to a wider measurement range, a relay is used to switch the voltage divider network. The circuit is shown in Figure 8. [align=center] Figure 8 Voltage divider network circuit[/align] Software functions 1) Realize the automation of testing of 512-channel sensors. 2) Can detect the RAM of the microcontroller. 3) Can clearly display the measurement results. 4) Can quickly retest the specified sensors. 5) Can save the test results . 6 Conclusion After the multi-channel gas sensor tester was developed, it was proven by actual use that it has high measurement accuracy, fast measurement speed, simple hardware circuit, easy disassembly and installation, and overcomes the shortcomings of low accuracy and slow speed of manual measurement. At the same time, it can be connected to a computer, which is convenient to operate, has a high degree of intelligence, and can realize the plug-and-test function of sensors, which lays a good foundation for the automation of sensor parameter measurement. The innovation of this paper: the design of the switching network and the anti-interference processing of the signal. References: [1] Liu Furma, etc. 80~196 Single Chip Microcomputer and Its Application; China Science-Technology Publishing House, June, 1993 (Chinese) [2] Liu Lepu, Ye Jizhong, Hu Shengbin Microcomputer Interface Technology and Application. Wuhan: Huazhong University of Science and Technology Press, 1993 [3] Li Hongzheng Power Frequency Interference and Suppression Measures in Single-Chip Microcomputer Temperature Control System. Microcomputer Information, 2004, 7: 90-91 [4] N. Govind, “Digital Filter Design and Algorithm Implementation with Embedded Signal Processors,” in Proceedings of the 6th International Conference on Signal Processing Applications and Technology, Oct.95, DSP Associates, pp 551-555 [5] Fan Yizhi, Chen Liyuan, Visual Basic and RS232 Serial Communication Control, Beijing: Tsinghua University Press, 2002 [6] Gong Peizeng et al., Visual Basic Programming Tutorial, Beijing: Higher Education Press, 2000
Read next

CATDOLL 136CM Tami

Height: 136cm Weight: 23.3kg Shoulder Width: 31cm Bust/Waist/Hip: 60/54/68cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22