Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 11, No. 3, 2025 131 Design of Automobile Exhaust Emission Detection and Alarm System Jinrong Luo, Wenzhuo Liao, Meishi Chen College of Intelligent Manufacturing, Chengdu Jincheng College, Chengdu Sichuan, 611731, China Abstract: The number of automobiles has increased dramatically, and vehicle exhaust has a serious impact on air quality, which has become a major factor of urban air pollution. The automobile exhaust emission detection and alarm system designed in this paper is firstly based on the circuit simulation test built in Proteus software, using STC89C52RC microcontroller as the core control element, and AD software to build the hardware circuit of the system, to realize the detection of exhaust, as well as adjusting the threshold, acoustic and visual alarm and display functions. Secondly, through the debugging and testing of the physical object, it realizes the more accurate detection of carbon monoxide, nitrogen oxides, methane and air quality. Finally, the detection value is displayed via LCD and an alarm is issued when the detection value exceeds the set threshold. The function of this detection and alarm system is in line with the initial design concept, and it has certain theoretical value and practical significance for automobile exhaust emission detection and environmental protection. Keywords: Microcontroller; Sensor; Automobile Exhaust Gas Detection; Alarm System. 1. Introduction As the number of vehicles continues to rise, the problem of exhaust pollution is becoming more and more prominent and has become a hotspot of public concern. Vehicle exhaust emissions have become the main factor of urban air pollution. The coordination between environmental protection and the development of automobile industry has become crucial. Therefore, the development of an easy-to-detect, cost- effective, data-accurate, feature-rich and stable vehicle tailpipe emission detection and alarm system to monitor and analyze vehicle emissions contributes to the mitigation of air pollution and supports the national “13th Five-Year Plan” strategy of energy conservation and emission reduction, which has great benefits for both socioeconomic and environmental development The monitoring and analyzing of automobile exhaust emission is of great benefit to both social economy and environmental development. For the exploration of automobile exhaust emission laws and regulations as well as detection device technology, scholars at home and abroad have carried out a lot of research work. The automobile emission standards implemented in the United States mainly improved the pollutant emission standards in the 1970s, and in the 1980s, they put forward requirements for engines and newly formulated gasoline as a way to reduce the pollution of automobile exhaust. In Europe, starting in 1993, the limits for harmful emissions were expanded and a new statistical approach to quality monitoring was established. In 1996, the EU required on-board diagnostic equipment to be installed in every light-duty vehicle[1]. By 2013, Europe introduced Euro 6 standards, mandating a 67% reduction in NOx emissions from diesel engines and limiting fine particulate emissions from gasoline engines. Japan introduced the world's most stringent regulations for diesel exhaust vehicles to date in 2005. Today, the JC08 model adopted in Japan is an innovative standard generated on the basis of the original judging criteria, which is closer to the normal driving environment and the requirements are more realistic[2]. By 2000, China's automobile exhaust emission standards had reached the level of the early 1990s in Europe.In 2009, researchers at the Beijing Academy of Aerospace Industry developed a labview-based automobile exhaust detection system[3], which accomplished the data from input to output, and realized the collection of the detection parameters, analysis and processing of the data, etc.In 2014, a research team from Jilin University, with the the use of infrared spectral absorption technology, a new type of CO concentration measurement system was successfully developed[4].In 2015, researchers from Jilin University designed an innovative embedded system based on the ASM detection method.2022, researchers from Zhejiang University explored a more effective method of detecting automobile exhaust by applying computer vision and deep learning to the detection of automobile exhaust[5]. This design of automobile exhaust emission detection and alarm system can realize the detection of exhaust gas, as well as adjusting the threshold value, sound and light alarm and display function. In designing the automotive exhaust emission detection and alarm system with STC89C52RC microcontroller as the core control element, AD software was used to build the hardware circuit of the system. It also involved the selection and integration for the display components, gas sensor and buzzer modules to ensure that these components are connected and work together properly. Once the system design was completed, the circuit simulation was tested using the Proteus software platform. On the software side, keil5 was used as the development environment and C language was used to design the system functions. Finally, through the debugging and testing of the physical object, the results show that this design can realize a more accurate detection of carbon monoxide (CO), nitrogen oxides (NOx), methane (CH4), and air quality, and display the detection value through the LCD. The threshold size can be set by pressing the button, and an alarm is generated when the detection value exceeds the threshold. The realization of the detection and alarm system functions, in line with the original design concept, for automotive emissions detection has a certain theoretical value and practical significance. 132 2. System Design 2.1. Overall System Design and Hardware Selection According to the analysis of system functional requirements, as shown in Figure 1, the overall architecture of the car exhaust emission detection and alarm system block diagram. It mainly includes three major parts: microcontroller, display and sensor. Among them, the STC89C52RC chip as the core control part, the use of multi-bit key control, indicator microcontroller for serial communication, according to the customized value to perform the detection of the corresponding sensors, and return the data surface microcontroller receives the control signals, and at the same time external LCD display for the display of detection results. Figure 1. Architecture diagram of tail gas detection system As the main control chip in the center of the system detection module, it carries the data collection, transmission and processing work, but also responsible for the management of various types of external devices [6]. The selection of the main control chip needs to take into account for the selected chip can realize the functions required to achieve the design; taking into account the cost, the final choice of STC89C52RC microcontroller as the main control chip. At the same time, a comprehensive analysis of the final choice of LCD1602 liquid crystal as a display module. The sensor part needs to choose different models according to the detection of different gases such as CO, CH4, NOx, etc. The CO detection module requires a long service life of the sensor, high stability, cost-effective and extremely sensitive to CO, and selects tin dioxide (SnO2) as the gas-sensitive material of the MQ-7 sensor, the conductivity of SnO2 in pure air is very low, but when it detects CO, its conductivity will increase with the increase of CO concentration. will increase with the increase of CO concentration; CH4 detection module choose MQ-4 gas sensor, can realize the accurate measurement of gas concentration, at the same time has a high sensitivity to methane, long service life, inexpensive and simple drive circuit; NOx detection module can be measured through the measurement of the size of the current to determine the concentration of nitrogen oxides in the exhaust gas of the automobile (NOx), the sensor is in the oxygen-rich environment, the sensor will reach the internal area of the sensor. When the sensor is in an oxygen-rich environment, oxygen ions will arrive at the sensor's internal region and NOx chemical reaction to generate electrons, thus generating a current signal, the size of this signal is measured to determine the concentration of NOx in the exhaust, so the selection of NX1 nitrogen-oxygen sensor as a NOx detection module. Air quality detection module sensor using tin dioxide (SnO2) as a gas-sensitive material, in the non-polluted air, its conductivity is low, in the polluted environment, with the increase in the concentration of polluted gases, its conductivity will increase accordingly.MQ-135 gas sensors have the above characteristics, can accurately detect and effectively respond to the polluted gases in the environment, and therefore choose MQ-135 gas sensor as the air quality detection module. MQ-135 gas sensor is chosen as the air quality detection module. In order to realize the sound and light alarm function, the electronic buzzer (buzzer) with integrated structure is used as the alarm module[7]. The active buzzer is much easier to control in the program, only need to supply the voltage and current required for its normal operation, can easily realize the sound and light alarm function. 2.2. Hardware System Design The hardware system of the exhaust gas detection and alarm system mainly includes the power supply circuit, display circuit, buzzer circuit, key circuit, and the most core minimum system. As shown in Figure 2, the minimum system mainly includes the reset circuit (upper left part of the figure), the clock circuit (lower left part of the figure) and the external power supply for the chip. Among them, the reset circuit part of the exhaust gas detection system due to external environmental interference caused by the program error, you can press the reset button so that the program inside the microcontroller automatically re-run from the initial position, RESET pin is a dedicated 51 microcontroller, when the pin access to a high level and hold two machine cycles, the microcontroller will enter a reset state until the RESET pin 133 level drops to a low level; the clock circuit for the microcontroller system to provide a standardized clock. The clock circuit supplies a standardized clock for the microcontroller system, in the STC89C52RC microcontroller, pins 18 and 19 pins are crystal pins, in order to ensure the stability and reliability of the microcontroller plus a 11.0592M crystal and two 30pF capacitors; power supply circuit has the function of protecting and stabilizing the circuit, if the voltage is too high, it may trigger chip damage, as shown in Figure 3, the power supply port of the design for the TYPE-C power supply, the entire system power supply function is realized through the connection of the TYPE-C data line. The power supply port of this design is TYPE-C power supply, and the power supply function of the whole system is realized through the connection of TYPE-C data line. Figure 2. Minimum System Diagram As shown in Figure 4, the display circuit part can use LCD1602 LCD with pull-up resistor module, by adjusting the backlight and contrast to adapt to different environments. At the same time, connecting the pull-up resistor can improve the stability and reliability of the signal. As shown in Figure 5 buzzer alarm circuit, the microcontroller detects the concentration of gas over the preset maximum threshold, it will send out a low-level signal, the transistor into the conduction state and trigger the buzzer for sound and light alarm. Figure 3. Power Supply Figure Circuit Diagram The internal structure of the buttons is mechanical. The exhaust gas detection and alarm system of this design sets the different gas concentration thresholds required for exhaust gas detection by means of the buttons; therefore, the system is set up with eight independent buttons, and the eight button functions can control the four different gas concentration values respectively. The keypad circuit is shown in Figure 6. Figure 4. LCD Display Circuit Diagram Figure 5. Buzzer Circuit Diagram Figure 6. Key circuit diagram Proteus analog test simulation is shown in Figure 7. The purpose of Proteus analog test simulation is to simulate and verify the accuracy of the software and hardware circuits before producing the PCB board, and to verify the circuit design and simulation during the development process. 134 Figure 7. Simulation Verification The PCB component library and SCH component library are created according to the requirements of this design. The schematic diagram of this design is shown in Figure 8. Figure 8. General schematic diagram PCB structural design is mainly to determine the size and mechanical positioning of the PCB board, which involves planning the specific location of various buttons, switches and interfaces and other components on the PCB board. PCB layout is to determine the placement of the PCB board components. PCB board used in the clock generator devices need to be placed close to reduce output distortion and to ensure stable startup. Figure 9. PCB Diagram PCB wiring must be in accordance with the electrical properties of the board to determine the base wiring for power and grounding of each component. The width of all lines should comply with the principle that the ground is greater than the power supply is greater than the signal. When wiring, should try to use forty-five degree folding line to line, while avoiding the use of ninety degree folding line wiring. After all the wires have been checked and passed, the ground filling is done, and the blank areas can be filled by laying copper. Through the design of the circuit schematic, and for the corresponding PCB components to choose the appropriate package, it will be imported into the PCB design, layout, wiring and laying copper foil. The finalized PCB design is shown in Figures 9 and 10. Figure 10. PCB 2.3. Software System Design The software control of this system is mainly to write the microcontroller program according to the hardware schematic that has been designed above. Keil5 MDK programming is used. The main flow chart of the system design is shown in Figure 11. At the beginning of the system startup, the initialization operation of each module is performed to ensure that the system components are in a normal working state, and the initialization is completed to enter the while main loop. In the main loop, the key scanning program is executed to monitor and respond to the user's key operation in real time to ensure the interactivity and real time of the system. In the display module program, the program mainly performs the display function to display the detected carbon monoxide (CO), nitrogen oxides (NOx), methane (CH4), and whether the air quality exceeds the threshold through the LCD display; finally, it enters into the processing function module, which performs the judgment function for judging whether the detected gas concentration exceeds the threshold, and if the concentration of any gas exceeds the threshold, the If any gas concentration exceeds the threshold, the transistor conducts to drive the buzzer for sound and light alarm. The program automatically activates and initializes the operating system and the sensor enters the ready state [8]. After the sensor warms up briefly, it starts monitoring the surrounding gas and transmits the measured data as an analog signal to the STC89C52RC microcontroller. Figure 14 shows the flowchart of the sensor detection program in detail as in Figure 12. nitrogen and oxygen air quality 135 Figure 11. Main Program Flowchart Figure 12. Sensor Detection Flowchart Figure 13. 1602 Display Workflow Diagram The main role of LCD in the system is to display the system detection data. The LCD module is a slow display device that first requires a series of initialization operations before operation, and before sending each instruction, the module's busy flag bit must be verified to be in a low state in order to effectively write instructions and data [9]. The detailed display flow is shown in Figure 13. The key functions are shown in Figure 14. In this case, the specific function of the key is determined by obtaining the key pressed. The function of key 1 is to control the toggle setting display. Each of the remaining eight keys are, in order, air quality, methane, carbon monoxide, and nitrogen oxides. Each press increases or decreases the value by 1; to increase the selected value, press the left button, to decrease the selected gas, press the right button. After setting, press the set button again to function as OK. Figure 14. Key Module Flowchart 2.4. System Debugging and Function Testing The gas detection test was first carried out indoors under the condition of indoor air. The system is activated when the power supply is turned on and the sensors are synchronized to start operating, they are responsible for detecting carbon monoxide (CO), nitrogen oxides (NOx), methane (CH4), and air quality in the environment. The detected data is then transmitted in real time to the microcontroller for processing. Eventually, through the display, the detection results are clearly presented for the user's reference and analysis. As can be seen from Figure 15, the detected values of these four gases indoors do not exceed the threshold value, and the system will not alarm, and this complete detection and display process ensures that the system's real-time monitoring and assessment of carbon monoxide (CO), nitrogen oxides (NOx), methane (CH4), and air quality in the environment is relatively accurate[10]. In order to have a clearer understanding of the accuracy of the system testing, separate testing experiments were conducted outdoors for air quality and CO. The experimental site was chosen in a more open and high traffic flow road in order to collect data more accurately[11]. The preset was to detect two different situations. We first set the threshold of air quality, and the device will sound and light an alarm when the threshold is exceeded. One way is to test the MQ135 air quality sensor in the experiment when there is 136 a vehicle driving by to detect the passing vehicle, in order to ensure the comprehensiveness and accuracy of the data, but also when there is no vehicle passing by in the same location to record the results of the test alone. After about 10 experimental comparisons can be analyzed. The experimental site is shown in Figure 16. The experimental results are analyzed as shown in Table 1. Figure 15. System Detection Figure 16. Inspection site Table 1. Detection and Analysis of the Impact of Vehicle Exhaust on Air Quality Number of experiments When no cars pass by When a car passes by 1 √ √ 2 × √ 3 × √ 4 × √ 5 × × 6 √ √ 7 × √ 8 × × 9 × √ 10 × √ Note: “√” means that the air quality sensor carries out an alarm, “×” means that the air quality sensor does not alarm Table 1 shows that eight out of ten tests conducted alarms when a car passed by. When there is no car passing by, there are two tests in ten experiments to carry out the alarm. Through the test results, excluding the influence of unstable factors, the alarm is more accurate when there are vehicles passing by, indicating that the air quality sensor is more sensitive to exhaust gas detection, and more accurate. Figure 17. CO outdoor testing experiment Due to the difficulty of testing CO in the open outdoor, a certain car was chosen to test the CO concentration value, during the test, one person went to start the car, and the other pointed the CO sensor of the exhaust gas detection and alarm device at the exhaust pipe of the car. The actual test scenario for this car is shown in Figure 17. Table 2 shows the concentration of CO in the exhaust gas emitted from the car after starting the car over a period of time at different speeds, from Table 2, it can be seen that the car in the braking state at different speeds for which the concentration value of CO changes, and finally take an average value Because of the influence of the experimental conditions, and the detection accuracy of the system has been tested earlier experiments. In order to facilitate the experiment, other gases are used to simulate the test of the alarm module, and the gas produced by the lighter's minimum gear without fire is used here for testing. First, it is necessary to connect the power supply and turn on the detection system. Secondly, enter the threshold setting interface by operating the setting button to set the thresholds for various gases. Finally, after the gas concentration exceeds the set threshold, as long as there is someone near the sensor and the flame of the lighter is in the lowest no-flame state, the system will start the sound and light alarm, and the experimental results are shown in Figure 18. The experimental results fully verified that the alarm function can be effectively realized when the detection value exceeds the set threshold, and the user can adjust the threshold setting by pressing the key [13]. 137 Table 2. Variation of CO concentration values in exhaust gases of automobiles at different rotational speeds rotation speed r/min CO concentration value mg/m3 Average CO concentration mg/m3 700 46 45 44 900 64 66 68 1100 81 83 85 1300 98 100 102 1500 118 116 114 Figure 18. Threshold exceeded audible and visual alarm detection 3. Summary After comprehensively considering various factors such as cost, accuracy, stability and practicality of the detection system, this project strictly follows the relevant national laws and regulations to ensure compliance and reliability. A rapid detection and alarm system device for intelligent mobile detection of pollutant gas concentration values of automobile exhaust emissions using a microcontroller as the core control component is designed. This paper introduces the background of the selected topic and the purpose of the research, as well as the current situation of automobile exhaust emissions at home and abroad. It provides a theoretical basis for the direction of this topic and designs the corresponding system architecture. The STC89C52RC microcontroller is used as the core control component, and the hardware circuits of the system's LCD display, keys, sound and light alarms, sensors, and A/D conversion modules are designed according to the requirements. The system software is developed in C language, and the running environment is Keil platform, and the design and initialization of the interface and functional modules are described in detail. After the design is completed, the system function is verified through experiments, although there is a gap with the international advanced equipment, the system still shows practical application value. This paper adopts STC89C52RC microcontroller as the main control chip, LCD1602 LCD module, MQ-7 sensor as CO detection module, MQ-135 gas sensor as air quality detection module. The CH4 detection module is selected as the MQ-4 gas sensor, the NX1 nitrogen and oxygen sensor is selected as the NOx detection module, and the alarm module adopts an active buzzer. By designing the reset circuit, crystal circuit, LCD display circuit, buzzer circuit, key circuit, and external power supply circuit to power the chip. Then Proteus simulation test is performed at the end of the stage. And Keil5 MDK programming is used to design the sensor detection, 1602 display operation, and keypad module. Through indoor and outdoor actual testing, the test results show that the alarm is more accurate when a vehicle passes by, which indicates that the air quality sensor is more sensitive and more accurate in exhaust gas detection. Simulation test with the gas produced by the lighter's minimum gear no-fire state, the results show that as long as there is someone near the sensor and the flame of the lighter is in the lowest no-fire state, and exceeds the threshold value, the system will immediately start the sound and light alarm, the design of the device automatically sound and light alarm. The above experimental results show that it meets the initial needs of this design. This paper only tested the feasibility of the system, but did not analyze and verify the energy consumption of the system in depth. In the actual collection process, since the exhaust gas emission is accompanied by water vapor, it can be considered to add waterproof measures for the system. This will not only enhance the reliability of the system, but also further minimize the detection data error. In addition, the current system is limited to single-point detection, and data transmission is inconvenient. In order to solve this problem. We can use the current popular Internet of Things (IoT) communication technology to develop specialized data management software for the host computer and realize communication with the host computer to achieve long- distance sharing of inspection data, thus making data management more efficient and convenient to meet the needs of different inspection stations and related departments. References [1] Lin Tong, Improving relevant laws and regulations to control automobile exhaust emissions. Modern Economic Information, 2016(11):328. [2] Yanfeng Yu. A comparative study of domestic and international automobile emission regulations[J]. Internal Combustion Engine & Parts, 2020, (01):186-187. DOI: 10. 19475/ j.cnki.issn1674-957x.2020.01.096. [3] Lina Xu. Rui Xue. Xiaodan Guan.Study of Automobile Exhaust Measurement System Based on Labview[J]. Journal of North China Institute of Aerospace Engineerin, 2009, 19 (03):16-18. [4] Yanhui Wang. Development of CO gas detection device in automobile exhaust [D]. Heilongjiang University,2016. [5] Haozhuo Zhang.Research on Video Vehicle Exhaust Object Detection and Domain Adaptation and Generalizability[D]. Zhejiang University,2022. 138 [6] Chenhong Wu. Signal Acquisition based on Modbus communication protocol [D]. Hefei University of Technology, 2021. [7] Shaopei Yang, Lingling Zhang, Qinghua Yang,et al. Design of Weight Sorting Device Based on Single-Chip Microcomputer Control [J].Technology innovation and productivity, 2020, (06): 57-60. [8] Xin Chang. Design of Vehicle Exhaust Detection System based on Internet of Things [D]. Jilin Agricultural University, 2020. DO I: 10.27163/d.cnki.gjlnu.2020.0 00321. [9] Shijian Peng. Research on micro bubble detection based on 51 single chip microcomputer [D]. Guilin University Of Electronic Technology,2022.DOI:10.27049/d.cnki.ggldc.2 022. 001090. [10] Yuhao Zhou. Research and design of exhaust gas detection system based on particle sensor [D]. Huazhong University of Science & Technology,2022.DOI:10.27157/d.cnki.ghzk u. 2022. 005619. [11] Yang Tong. Real-time Data Acquisition and Control System for Remote Sensing Detection of Automobile Exhaust [D]. Anhui University,2021.DOI:10.26917/d.cnki.ga nhu.20 2 1.000 802. [12] Yongbao Chai. Application of threshold model to the study of anti-cheating of vehicle exhaust detection [D]. Yunnan University,2020.DOI:10.27456/d.cnki.gyndu.2020.0 012 14. [13] Jicheng Zhang. Development of Remote Sensing Detection and Control System for Automobile Exhaust Emission [D]. Shandong Jiaotong University,2020. DOI:10. 27864/d. cnki. gsjtd. 2020. 000006.