Since entering the 21st century, economy in China has developed rapidly, people’s quality of life has been continuously improved, and the use of automobiles in daily life has become more and more common. The domestic automobile industry has experienced a blowout development in response to the globalization of the automobile industry . The air quality in the narrow, confined space inside the car is not optimistic. The survey shows that by comparing the air quality in the following vehicles: ferries, trains, trams, and cars, it is found that the degree of environmental pollution in cars is generally higher than that of the other types. In 2002, on the highway from Dalian to Shenyang, a car owner drove a new car into a car accident. After the investigation, it was discovered that the accident was caused by dizziness caused by excessive smell in the car  . In recent years, with the development of our society, environmental pollution has increasingly become one of the hot issues of concern to the whole society. Among them, the air pollution in large and medium cities and industrial dense areas is particularly prominent, which directly affects human health and quality of life . Therefore, the detection of harmful gases is very important. In the past, the main detection method was manual detection; but now, with the development of science and technology, the main use of single-chip control technology is used for detection. The most obvious advantage of the single-chip microcomputer is that it can be embedded in various instruments and equipment. This is impossible for a supercomputer . Now, Internet, multimedia equipment and wireless communication technology continue to move forward .
Data show that since the 1970s, foreigners have begun to study temperature and humidity control technology. In the beginning, it was collecting local data and information, and backing up and regulating them. This kind of analog tools and meters mostly appeared in the form of combination. It took another ten years before the distributed control technology was developed. Researchers in our country started relatively late in this area, and only started after the distributed control system was developed in foreign countries. In the beginning, most of the domestic engineers learned about the temperature and humidity microcomputer monitoring system through learning foreign developed measurement and control technology. And the system only monitors a single factor in the environmental components, such as temperature, humidity, etc.
The task of this project is to use the 52 microcontroller as the control core, combined with the sensor module, completing design of the system. The specific functions are as follows:
1) With the single-chip microcomputer as the core, cooperate with each module to realize the real-time measurement of the temperature, humidity and PM2.5 concentration of the car’s internal environment.
2) Acoustic and visual alarm is realized, that is, the buzzer sounds at the same time, the LED light flashes, the method is to compare the detected PM2.5 value with the original value, if it exceeds the set range, it can alarm.
3) Real-time transmission of the detected data by Bluetooth.
4) Long-term uninterrupted loop detection.
5) The detected data can be displayed on the LCD1602 LCD screen in real time.
6) The PM2.5 concentration exceeding the limit can be set by pressing the button and can be saved.
2. Overall Design of the Detection System of Automobile Interior Environment
2.1. The System Structure Diagram of the Detection System
The process of design of the detection system structure diagram is based on the expected goals of the detection system. It is planned to use buttons and Bluetooth app to control the entire detection system. At the same time, an alarm function needs to be set in the detection system, so the overall block diagram of the system can be obtained. The hardware system block diagram is shown in Figure 1. As shown in Figure 1, the design is divided into seven modules, including temperature and humidity sensor module, alarm module, power module, display module, button module, Bluetooth module and dust sensor module. The detection module is divided into temperature and humidity detection module and dust detection module.
Figure 1. System structure diagram.
2.2. The Working Principle of the Detection System
Turn on the power and the system initializes. The dust detection module starts to detect the concentration of PM2.5, and transmits the detected data to the single-chip microcomputer through the ADC analog-to-digital conversion module. At the same time, the temperature and humidity sensor also starts to detect the temperature and humidity value, and then transmits it to the single-chip microcomputer. After processing by the single-chip microcomputer, the value is displayed on the LCD1602 liquid crystal display, through the Bluetooth module, the display content can be synchronized. Change the parameter limit range through the button module. If the measured data is not in the limit range, the alarm module will act.
3. Hardware Design of the Detection System
3.1. Hardware Circuit Schematic
The detection system microcontroller I/O port and resource allocation table is shown in Table 1.
3.2. Selection and Demonstration of the Main Control Chip
AT89C52RC can write the program into the MCU serially through the serial data receiving terminal RXD and the serial data transmitting terminal TXD, which can facilitate the user to debug the software of the MCU without making any changes to the hardware. Its industrial grade operating temperature range is −40˚C - +85˚C, commercial grade 0˚C - 75˚C, and the package is a 40-pin PDIP package . Considering the cost, the interface of the 52 single-chip microcomputer can meet the function.
3.3. Selection and Justification of Temperature and Humidity Sensor
In order to improve comfort, the two physical terms of temperature and humidity must first be addressed. In this part, we use a sensor that detects both temperature and humidity (temperature and humidity Sensor), its symbol is denoted as DHT11. In order to make the measurement more accurate, the sensor will be calibrated with high precision in the humidity research room before
Table 1. The detection system microcontroller I/O port.
leaving the factory. The coefficients obtained after calibration will be stored in the OTP memory by way of programming. In the process of daily use testing, just write a program to call these coefficients in it. Advantage of temperature and humidity sensor is embodied in the high degree of integration, which makes it occupy a small area; the use of single-line serial communication reduces the power consumption a lot. Its signal transmission distance is more than 20 meters, enabling it to be applied to more complex environments. Figure 2 is the temperature and humidity sensor.
3.4. Selection and Justification of the Dust Sensor
Figure 3 is the dust sensor. In addition to temperature and humidity, the system designed in this subject can also detect the concentration of PM2.5 in the air. The required instrument is a dust collector, its model is GP2Y1010AUOF, which is developed by Sharp Technology Corporation of Japan. Its working principle is the same as that of photosensitive. Its main components are phototransistors and infrared light-emitting diodes, which are installed in the sensor in a diagonal form. It can detect very small things such as dust particles and particulates in cigarettes, and the concentration of particulates can be checked by the pulse level output by the sensor. When the sensor is energized, its interior will emit LED light in a certain direction. When air passes through its middle position, the LED light will emit refraction. By measuring the returned light, the concentration of particulate matter can be calculated.
3.5. Selection and Justification of Bluetooth Module
In this design, not only the measured data information can be displayed in real
Figure 2. DHT11 temperature and humidity sensor.
Figure 3. Dust sensor.
time, but also the measured data can be displayed on the mobile phone through the wireless sensor. The above functions can be realized by using a Bluetooth sensor, and its model is HC-06, which is shown in Figure 4. Its advantage is its high degree of integration, which is reflected in the master-slave integrated design, which makes it more convenient for people to use. When the mobile phone is connected to Bluetooth, it will be used as a serial port, because the communication protocol of the Bluetooth module itself will be ignored at this time. The working principle is that one device sends information data to the shared communication channel, and another paired device can obtain the corresponding data information in the channel. Bluetooth technology is a low-power, high-rate wireless data transmission technology. It uses frequency hopping technology. Compared with other systems operating in the 2.4 GHz frequency band, Bluetooth technology has faster frequency hopping and shorter data packets, making the Bluetooth system more efficient  .
4. Software Design of the Detection System
The main program mainly cooperates with the hardware modules to realize the corresponding functions of the system, including the collection, processing, display and transmission of temperature and humidity data, PM2.5 concentration data to the mobile phone, and realize the call of each sub-function, etc. The main program flowchart is shown in Figure 5.
Figure 5 is the main program flow chart. Turn on the power and the system initializes. Each module starts to detect the environmental parameters, and sends the measured data to the LCD1602 LCD screen for display, and then transmits and displays it to the mobile phone through the Bluetooth device. Judge whether the key is pressed through the program. If it is pressed, the key subroutine will be called to change the alarm value of the dust concentration. By comparing the PM2.5 concentration data with the set alarm value, if the collected data exceeds the alarm value, the buzzer will start to operate, accompanied by the lighting of the LED light, to achieve audible and visual alarm.
5. Product Commissioning
Figure 6 is the system debugging diagram. It can be seen from the above figure that the system can work normally, the LCD screen display can normally display
Figure 4. Bluetooth module.
Figure 5. Main program flow chart.
Figure 6. System debugging diagram.
Figure 7. LCD screen display results.
Figure 8. Mobile phone test results.
temperature and humidity, dust concentration and alarm value, and can be displayed on the mobile phone through the communication module. Update the data every 2s on the phone. It can be seen from the above figure that the first line of the LCD screen displays the measured temperature and humidity values, and the second line displays the measured dust concentration value and the concentration alarm limit value. The alarm value can be set by pressing the button.
Figure 7 is the LCD screen display results. As shown in Figure 7, the first line of the LCD screen displays the measured temperature value and humidity value, and the second line displays the measured dust concentration value and the concentration alarm limit value. The alarm value can be set by pressing the button. And the measured data is compared and analyzed with the actual data, and the error of the data does not exceed 5%.
Figure 8 is the mobile phone test results. As shown in Figure 8, through the Bluetooth module, the mobile phone can receive and display the measurement results and each measurement data is basically consistent to ensure the accuracy of the measurement.
The automotive internal environment detection system based on the single-chip microcomputer can successfully detect the temperature, humidity and dust concentration in the environment. It can be displayed on the LCD1602 LCD screen, connected via Bluetooth, and can also be displayed on the mobile phone. The dust alarm value can be set by pressing the key, and the set value can be saved. The system has low manufacturing cost and is suitable for use in cars, wooden door processing plants, ceramic tile manufacturing plants, laboratories and other places.
This design successfully detects the temperature, humidity and dust concentration in the current environment, and realizes the function of alarm when the dust concentration exceeds the limit, and it can be displayed on the LCD1602 liquid crystal display, and can also be transmitted to the mobile phone through the Bluetooth module. Finally, there can be further improvements in the design process:
1) The system cannot alarm the value of temperature and humidity, but can only alarm if the dust concentration exceeds the limit;
2) The mobile phone can only display the measured value, and cannot set the limit value;
3) There are too many substances harmful to the human body in the environment, such as CO, etc. However, due to the high design difficulty, other detection modules are not added to this system.
This research was supported by the Doctoral Research Initiation Fund of Guilin University of Technology (GUTQDJJ2018068) and 2020 Guangxi University Middle-aged and Young Teachers’ Basic Research Ability Improvement Project (2020KY06024).
 Zhang, J., Hao, X., Wei, W. and Huang, Y. (2016) The Design of PSM-Based ECRH Power Supply Control System. Journal of Power and Energy Engineering, 4, 91-102. https://doi.org/10.4236/jpee.2016.44009