# Residential Environment Pollution Monitoring System Based on Cloud Computing and Internet of Things

Authors: Jing Mi; Xinghua Sun; Shihui Zhang; Naidi Liu
Journal: International Journal of Analytical Chemistry
 (2022)

---

## Abstract

In order to solve the problems of single monitoring factor, weak comprehensive analysis ability, and poor real time performance in traditional environmental monitoring systems, a research method of residential environment pollution monitoring system based on cloud computing and Internet of Things is proposed. The method mainly includes two parts: an environmental monitoring terminal and an environmental pollution monitoring and management platform. Through the Wi-Fi module, the data is sent to the environmental pollution monitoring and management platform in real time. The environmental monitoring management platform is mainly composed of environmental pollution monitoring server, web server, and mobile terminal. The results are as follows. The data measured by the system is close to the data measured by the instrument, and the overall error is small. The measurement error of harmful gases is about 6%. PM 2.5 is about 6.5%. Noise is about 1%. The average time for sensor data update is 0.762 s. The average alarm response time is 2 s. The average data transfer time is 2 s. Practice has proved that the environmental pollution monitoring and alarm system operates stably and can realize real-time collection and transmission of data such as noise, PM 2.5, harmful gas concentration, illumination, GPS, and video images, providing a reliable guarantee for timely environmental pollution control.


---

## Body

## 1. Introduction

In order to solve the problem of air pollution in the indoor living environment, the indicators that cause air pollution can be collected. These indicators mainly include inhalable particulate matter, formaldehyde, carbon dioxide, and stupid substances. These air indicators can be monitored through the indoor living environment monitoring system, and indicators that exceed the standard can be warned. What is more important is to collect carbon monoxide, methane, and other combustible gases and smog in the indoor air to prevent unexpected accidents such as gas poisoning and home fire, monitor these indicators that affect the safety of indoor residents in real time, and timely monitor these indicators that exceed the standard. Prewarning and alarming: in order to prevent accidents and ensure the personal and property safety of indoor residents. Establish an indoor living environment comfort evaluation model, which requires the environmental elements that affect the comfort of indoor occupants and the environmental parameters of each environmental element.Since the reform and opening up, China’s economic power has greatly increased, creating many outstanding achievements. And people’s living standards have also undergone earth-shaking changes [1]. During this period, China’s GDP growth rate reached 9.8%, becoming the country with the fastest economic growth in the same period. The continuous 30 years of rapid economic growth makes people around the world see “China’s economic miracle” [2].While promoting development, economic development with high energy consumption has also brought great pressure to China’s ecological environment, even affecting the daily life of urban residents [3]. Noise is also a common factor affecting residents’ health. With the acceleration of urbanization, production, living and transportation levels are improving. And, noise generated by urban construction has a negative impact on people’s daily life and health [4, 5]. According to 44 urban environment monitoring networks, more than 2/3 of the urban population in China are faced with noise pollution [6]. China’s production of industrial waste is increasing rapidly, which will inevitably put enormous pressure on the environment. According to the statistics of relevant departments, the accumulation of household garbage in China is also very serious. Therefore, it can be concluded that the severe urban environment pollution in China has begun to affect people’s daily life and environment pollution even has seriously harmed people’s health in some places [7, 8]. In view of the current situation of urban environment pollution, combined with the impact of environment pollution on people’s physical and mental health, as well as China’s determination to solve the problem of environment pollution and the immaturity of environment monitoring technology and many other factors, it is very necessary to establish the residential environment pollution monitoring and alarm system.Saito et al. believed that the definition of environment monitoring was that using biochemical methods to analyze the proportion and harm of various environment factors in the environment and evaluate the quality and change trend of the environment correctly according to the results [9]. Alobaidi and Valyrakis believed that since the emergence of environment monitoring technology, countries all over the world began to vigorously invest in the development of environment pollution monitoring technology and the research and development of environment pollution monitoring products, resulting in rapid development of environment monitoring technology [10]. Aguilar-arevalo et al. believed that environment monitoring technology in various countries started early and became increasingly mature through advanced scientific and technological means. The whole development process mainly included three important stages of special monitoring of environment pollution accidents, pollution sources, and environment quality [11]. Saoutieff et al. believed that, in the 1950s, after several serious pollution accidents caused by toxic chemical leakage, the developed countries began to analyze collected environment samples by chemical means to determine the composition and content of pollution, assisting the subsequent treatment [12]. Li et al. believed that, by the end of 1960s, people gradually realized that not only chemical substances would cause environment pollution but also biological and physical factors would damage the environment. So physical and biological methods were also included in environment detection. Coupled with the government’s attention to environment pollution legislation and pollutant discharge control, the monitoring of environment pollution has developed greatly in this period [13]. Leonardo et al. believed that, around 1975, due to the deepening of people’s understanding of environment protection, the developed countries began to pay attention to the monitoring of the overall quality of the environment rather than the monitoring of a single pollution source, which made the scope of environment pollution monitoring more comprehensive [14]. Moon et al. believed by around 1980, the developed countries began to rely on advanced science and technology to establish their own intelligent environment monitoring system. And, the geographic information system technology, remote sensing, and positioning technology were used comprehensively to monitor the change of natural environment continuously, so as to achieve a wide range of monitoring and improve the ability of data collection and processing data. The prediction of future environment quality realized and the development of the intelligent monitoring technology was promoted [15]. Lu et al. believed that, from the 1980s to the early 21st century, the integration of multiple technologies was gradually regarded as the mainstream scheme to realize environment pollution monitoring for the environment monitoring systems of various countries [16]. At present, in terms of environment pollution monitoring, the developed countries adopted the technical integration of “3S” technology with a series of emerging technologies such as big data and artificial intelligence, so as to achieve intelligent, accurate, and comprehensive development of environment pollution problems, providing strong technical support for environment assessment, environment prediction, and decision-making [17]. On the basis of the current researches, the intelligent community environment pollution monitoring and alarm system was designed and realized. In terms of the environment pollution problems existing in the current urban community, combined with the current development of environment pollution monitoring technology, the Internet of Things technology, data fusion technology, embedded development technology, Wi-Fi communication technology, and application development technology were adopted on the basis of fully studying the system framework design, embedded software and hardware design, Web development and design, and the server function design.


## 2. Research Methods

### 2.1. System Function Design

According to the analysis of function and performance demand of the system, the system function modules could be divided into the environment pollution monitoring terminal and the environment pollution monitoring management platform [18, 19]. The environment monitoring terminal took STM32F103 and S3C6410 processor as the core processing unit. Through C# software development technology, Socket communication technology and database technology programming, area network server of the system was established. When the abnormal data appeared, alarm would be on in the server side. And, the current GPS data were recorded and sent to the environment management monitoring center and mobile phone terminals (community staff) [20]. The Web server of the system was the overall monitoring center of the environment monitoring system, mainly being responsible for the display of historical data, view of user records, alarm in emergencies, and task distribution in abnormal situations [21]. When the system data were abnormal, the system converted the received GPS information into location information and sent the anomaly and location information to mobile phone terminals over the network (inspection) which were the most important part of the control and treatment of environment pollution in the whole system and the key point to complete the timely treatment of environment pollution in the system [22]. The cellphone terminal of community manager was mainly responsible for receiving and displaying the data of each monitoring point in the community in real time, giving alarm prompt in case of abnormality. While the patrol mobile phone terminal was mainly responsible for receiving the tasks distributed by the environment management center and uploading the processing results of the task to the Web server [23]. The specific system function design diagram is shown in Figure 1.Figure 1
System function design diagram.


### 2.2. Hardware Design of Environment Parameter Collection and Transmission Module

STM32 processor was taken as the core in the environment parameter collection module of the system, which integrated clock circuit, power circuit, A/D (analog/digital) conversion module, serial communication module, and I2C bus module around it, constituting the core components of data collection. In addition, the multisensor of smoke, light intensity, and harmful gas concentration and ESP8266Wi-Fi module was extended. The specific hardware structure is shown in Figure2.Figure 2
Hardware structure of environment parameter collection and transmission module.


### 2.3. Hardware Design of Videos and Images Collection and Transmission Module

ARM1I processor was taken as the core in the hardware structure of videos and images collection system. And, the clock circuit, power supply circuit, NAND FLASH module, DDR module, serial communication module, and USB interface module were integrated around it, which constituted the core components of video image collection. In addition, GPS sensor, camera module, and USB Wi-Fi module were extended to realize the collection and transmission of location information and videos and images. The specific hardware structure is shown in Figure3.Figure 3
Hardware structure diagram of video image collection and transmission module.


### 2.4. Software Design of Environment Pollution Parameter Collection Module

For environment pollution parameter collection, data collection nodes are formed through the STM32 external multichannel sensors. Then multiple data collection nodes of sensor network were prepared. So, the pollution of the environment parameter collection module software design was required to initialize the hardware of the environment parameter collection module such as STM32, a serial port, Wi-Fi module, and a sensor. Then, the data collection worked well. But in reading environment pollution parameters, the outputs of the sensor were analog output and digital output. For digital output, it can be directly read by a serial port or I/O port. Analog output was converted into digital signal through A/D first and then its value is read. The data collection software design flow chart of the system is shown in Figure4.Figure 4
Software design flow chart of environment parameter collection function.


### 2.5. Software Design of the Video and Image Collection Module

In the software design of the video and image collection module, it was necessary to complete the writing of the customized UVC driver first. When collecting the number of videos and images, the hardware such as ARM1I, serial port, USB, and camera module needed to be initialized first. Then, the corresponding device files needed to be opened. The parameters of video image reading needed to be set, and the required cache of video image was allocated. And then, the BOA server was started, and the required driver was run. The specific software design process is shown in Figure5.Figure 5
Software design flow chart of the videos and images collection function.


### 2.6. Design of Environment Pollution Monitoring Server

This system environment pollution monitoring server design mainly included environment pollution monitoring server demand analysis and environment pollution monitoring server system design.Environment pollution monitoring server functions should include data receiving, real-time display, and comprehensive analysis. At the same time, remote video monitoring and image processing were also essential. So, the environment pollution monitoring server should meet the following functions.


#### 2.6.1. Real-Time Reception, Display, and Analysis of Pollution Data

The environment pollution data collection terminal of the system periodically sent the packaged data to the environment pollution monitoring server through Wi-Fi. The server automatically received and displayed the data in real time in the corresponding environment parameter display bar. At the same time, the server analyzed, stored, and charted the received information. Thus, the specific environment pollution situation of the community could be directly monitored in real time, whether from data or graphics. And, the historical record of the database could provide data support for predicting the future environment situation.


#### 2.6.2. Real-Time Reception, Analysis, Storage, Display of GPS Data, and Display of Maps

The system collected the location information of the current monitoring area in real time through the GPS sensor. And, it was deleted by the ARMI1 processor. The data frame was sent to the environment pollution monitoring server through the wireless network using the TCP/IP transmission protocol. And, the server received the data in real time and then analyzed it. The longitude and latitude information in the data was displayed in the corresponding data column and stored in the local database in real time. At the same time, the network server should also have map display, search, view, and other functions.


#### 2.6.3. Video Surveillance, Photo Capture, and Image Processing

The system obtained real-time videos through the camera. Some simple processing and compression were performed through the ARMII processor. And, the videos and images were sent to the environment pollution monitoring server through the HTTP protocol with the help of the boa server. In case of abnormal data collection, the collection terminal could identify and process the captured images and then send them to the server. The server could store them and made a comprehensive analysis of the processing results and data to draw a conclusion.


## 2.1. System Function Design

According to the analysis of function and performance demand of the system, the system function modules could be divided into the environment pollution monitoring terminal and the environment pollution monitoring management platform [18, 19]. The environment monitoring terminal took STM32F103 and S3C6410 processor as the core processing unit. Through C# software development technology, Socket communication technology and database technology programming, area network server of the system was established. When the abnormal data appeared, alarm would be on in the server side. And, the current GPS data were recorded and sent to the environment management monitoring center and mobile phone terminals (community staff) [20]. The Web server of the system was the overall monitoring center of the environment monitoring system, mainly being responsible for the display of historical data, view of user records, alarm in emergencies, and task distribution in abnormal situations [21]. When the system data were abnormal, the system converted the received GPS information into location information and sent the anomaly and location information to mobile phone terminals over the network (inspection) which were the most important part of the control and treatment of environment pollution in the whole system and the key point to complete the timely treatment of environment pollution in the system [22]. The cellphone terminal of community manager was mainly responsible for receiving and displaying the data of each monitoring point in the community in real time, giving alarm prompt in case of abnormality. While the patrol mobile phone terminal was mainly responsible for receiving the tasks distributed by the environment management center and uploading the processing results of the task to the Web server [23]. The specific system function design diagram is shown in Figure 1.Figure 1
System function design diagram.


## 2.2. Hardware Design of Environment Parameter Collection and Transmission Module

STM32 processor was taken as the core in the environment parameter collection module of the system, which integrated clock circuit, power circuit, A/D (analog/digital) conversion module, serial communication module, and I2C bus module around it, constituting the core components of data collection. In addition, the multisensor of smoke, light intensity, and harmful gas concentration and ESP8266Wi-Fi module was extended. The specific hardware structure is shown in Figure2.Figure 2
Hardware structure of environment parameter collection and transmission module.


## 2.3. Hardware Design of Videos and Images Collection and Transmission Module

ARM1I processor was taken as the core in the hardware structure of videos and images collection system. And, the clock circuit, power supply circuit, NAND FLASH module, DDR module, serial communication module, and USB interface module were integrated around it, which constituted the core components of video image collection. In addition, GPS sensor, camera module, and USB Wi-Fi module were extended to realize the collection and transmission of location information and videos and images. The specific hardware structure is shown in Figure3.Figure 3
Hardware structure diagram of video image collection and transmission module.


## 2.4. Software Design of Environment Pollution Parameter Collection Module

For environment pollution parameter collection, data collection nodes are formed through the STM32 external multichannel sensors. Then multiple data collection nodes of sensor network were prepared. So, the pollution of the environment parameter collection module software design was required to initialize the hardware of the environment parameter collection module such as STM32, a serial port, Wi-Fi module, and a sensor. Then, the data collection worked well. But in reading environment pollution parameters, the outputs of the sensor were analog output and digital output. For digital output, it can be directly read by a serial port or I/O port. Analog output was converted into digital signal through A/D first and then its value is read. The data collection software design flow chart of the system is shown in Figure4.Figure 4
Software design flow chart of environment parameter collection function.


## 2.5. Software Design of the Video and Image Collection Module

In the software design of the video and image collection module, it was necessary to complete the writing of the customized UVC driver first. When collecting the number of videos and images, the hardware such as ARM1I, serial port, USB, and camera module needed to be initialized first. Then, the corresponding device files needed to be opened. The parameters of video image reading needed to be set, and the required cache of video image was allocated. And then, the BOA server was started, and the required driver was run. The specific software design process is shown in Figure5.Figure 5
Software design flow chart of the videos and images collection function.


## 2.6. Design of Environment Pollution Monitoring Server

This system environment pollution monitoring server design mainly included environment pollution monitoring server demand analysis and environment pollution monitoring server system design.Environment pollution monitoring server functions should include data receiving, real-time display, and comprehensive analysis. At the same time, remote video monitoring and image processing were also essential. So, the environment pollution monitoring server should meet the following functions.


### 2.6.1. Real-Time Reception, Display, and Analysis of Pollution Data

The environment pollution data collection terminal of the system periodically sent the packaged data to the environment pollution monitoring server through Wi-Fi. The server automatically received and displayed the data in real time in the corresponding environment parameter display bar. At the same time, the server analyzed, stored, and charted the received information. Thus, the specific environment pollution situation of the community could be directly monitored in real time, whether from data or graphics. And, the historical record of the database could provide data support for predicting the future environment situation.


### 2.6.2. Real-Time Reception, Analysis, Storage, Display of GPS Data, and Display of Maps

The system collected the location information of the current monitoring area in real time through the GPS sensor. And, it was deleted by the ARMI1 processor. The data frame was sent to the environment pollution monitoring server through the wireless network using the TCP/IP transmission protocol. And, the server received the data in real time and then analyzed it. The longitude and latitude information in the data was displayed in the corresponding data column and stored in the local database in real time. At the same time, the network server should also have map display, search, view, and other functions.


### 2.6.3. Video Surveillance, Photo Capture, and Image Processing

The system obtained real-time videos through the camera. Some simple processing and compression were performed through the ARMII processor. And, the videos and images were sent to the environment pollution monitoring server through the HTTP protocol with the help of the boa server. In case of abnormal data collection, the collection terminal could identify and process the captured images and then send them to the server. The server could store them and made a comprehensive analysis of the processing results and data to draw a conclusion.


## 2.6.1. Real-Time Reception, Display, and Analysis of Pollution Data

The environment pollution data collection terminal of the system periodically sent the packaged data to the environment pollution monitoring server through Wi-Fi. The server automatically received and displayed the data in real time in the corresponding environment parameter display bar. At the same time, the server analyzed, stored, and charted the received information. Thus, the specific environment pollution situation of the community could be directly monitored in real time, whether from data or graphics. And, the historical record of the database could provide data support for predicting the future environment situation.


## 2.6.2. Real-Time Reception, Analysis, Storage, Display of GPS Data, and Display of Maps

The system collected the location information of the current monitoring area in real time through the GPS sensor. And, it was deleted by the ARMI1 processor. The data frame was sent to the environment pollution monitoring server through the wireless network using the TCP/IP transmission protocol. And, the server received the data in real time and then analyzed it. The longitude and latitude information in the data was displayed in the corresponding data column and stored in the local database in real time. At the same time, the network server should also have map display, search, view, and other functions.


## 2.6.3. Video Surveillance, Photo Capture, and Image Processing

The system obtained real-time videos through the camera. Some simple processing and compression were performed through the ARMII processor. And, the videos and images were sent to the environment pollution monitoring server through the HTTP protocol with the help of the boa server. In case of abnormal data collection, the collection terminal could identify and process the captured images and then send them to the server. The server could store them and made a comprehensive analysis of the processing results and data to draw a conclusion.


## 3. Results Analysis

### 3.1. System Performance Test

The system performance was tested from the system error, real-timeness, and stability:(1)
The system error test of the environment pollution parameters was collected by the system, the influence of the actual situation on the environment parameters should be considered. In the research, two representative kinds of weather (sunny and rainy) were selected to collect temperature, humidity, and light intensity data at 8 : 00, 11 : 00, 14 : 00, 17 : 00, and 20 : 00, respectively. The results are shown in Table1 [24]. Considering the complex relationship between the harmful gas concentration, PM 2.5, and meteorological factors, in order to simplify the analysis, the data collection time point of the harmful gas concentration, PM 2.5 concentration, and noise intensity under sunny conditions was the same as the above. The results are shown in Table 1.The system and the suction hole of the measuring instrument were placed at the same measuring point, and the aerosol with a gradual change of concentration from high to low was measured at the same time.(1)C=R∗K.According to formula (1), atmospheric particulate concentration C and mass concentration conversion coefficient K could be calculated, where R is the instrument-measured value.As could be seen from the data comparison in Table1, the data measured by the system was close to that measured by the instrument in terms of value. And, the overall error was small, which could be further reduced by selecting sensors with better performance [25].(2)
Real-timeness test of the system.In the real-time test of the system, the average time was calculated as the test result through multiple timing tests on the data updating time, alarm response time and data transmission time of each sensor as shown in Figure6.Figure 6
Test results of sensor data updating, alarm response, and average time of data transmission.Table 1
Comparison between the harmful gas concentration, PM 2.5 concentration, and noise intensity measured by the system and the measured values by the instrument.
Harmful gas concentration (ppm)PM 2.5 concentration (μg/m3)Noise intensity (db)Value by systemValue by instrumentError (%)Value by systemValue by instrumentError (%)Value by systemValue by instrumentError (%)51486.3533316.4646472.1348464.35333010.05252030293.4531303.335050050468.7033316.4648492.0449458.8935336.0647482.08The data measured by the system is close to the data measured by the instrument, and the overall error is small. The measurement error of harmful gases is about 6%. PM 2.5 is about 6.5%. Noise is about 1%. The average time for sensor data update is 0.762 s. The average alarm response time is 2 s. The average data transfer time is 2 s.These environmental parameters are collected with the help of IoT sensing devices, and uploaded to the data center with the help of the network. The indoor living environment comfort evaluation model can perform cloud computing analysis on these massive data and obtain the indoor living environment comfort evaluation results, so as to improve the comfort of indoor occupants and ensure physical and mental health and comfort.


## 3.1. System Performance Test

The system performance was tested from the system error, real-timeness, and stability:(1)
The system error test of the environment pollution parameters was collected by the system, the influence of the actual situation on the environment parameters should be considered. In the research, two representative kinds of weather (sunny and rainy) were selected to collect temperature, humidity, and light intensity data at 8 : 00, 11 : 00, 14 : 00, 17 : 00, and 20 : 00, respectively. The results are shown in Table1 [24]. Considering the complex relationship between the harmful gas concentration, PM 2.5, and meteorological factors, in order to simplify the analysis, the data collection time point of the harmful gas concentration, PM 2.5 concentration, and noise intensity under sunny conditions was the same as the above. The results are shown in Table 1.The system and the suction hole of the measuring instrument were placed at the same measuring point, and the aerosol with a gradual change of concentration from high to low was measured at the same time.(1)C=R∗K.According to formula (1), atmospheric particulate concentration C and mass concentration conversion coefficient K could be calculated, where R is the instrument-measured value.As could be seen from the data comparison in Table1, the data measured by the system was close to that measured by the instrument in terms of value. And, the overall error was small, which could be further reduced by selecting sensors with better performance [25].(2)
Real-timeness test of the system.In the real-time test of the system, the average time was calculated as the test result through multiple timing tests on the data updating time, alarm response time and data transmission time of each sensor as shown in Figure6.Figure 6
Test results of sensor data updating, alarm response, and average time of data transmission.Table 1
Comparison between the harmful gas concentration, PM 2.5 concentration, and noise intensity measured by the system and the measured values by the instrument.
Harmful gas concentration (ppm)PM 2.5 concentration (μg/m3)Noise intensity (db)Value by systemValue by instrumentError (%)Value by systemValue by instrumentError (%)Value by systemValue by instrumentError (%)51486.3533316.4646472.1348464.35333010.05252030293.4531303.335050050468.7033316.4648492.0449458.8935336.0647482.08The data measured by the system is close to the data measured by the instrument, and the overall error is small. The measurement error of harmful gases is about 6%. PM 2.5 is about 6.5%. Noise is about 1%. The average time for sensor data update is 0.762 s. The average alarm response time is 2 s. The average data transfer time is 2 s.These environmental parameters are collected with the help of IoT sensing devices, and uploaded to the data center with the help of the network. The indoor living environment comfort evaluation model can perform cloud computing analysis on these massive data and obtain the indoor living environment comfort evaluation results, so as to improve the comfort of indoor occupants and ensure physical and mental health and comfort.


## 4. Conclusion

In the research, the environment pollution monitoring system was investigated, and China’s current environment pollution monitoring of the defects in the products was analyzed. At the same time, the research of intelligent electronic surveillance products the market experience was utilized. Combined with the market demand of environment pollution monitoring system, the sensor network, wireless network communication, embedded development, digital image processing, data fusion, and many other technologies were adopted. The design of intelligent community environment pollution monitoring and alarm system was completed. The environment pollution problems in China were analyzed through specific data. And, the key technologies used in the system framework were introduced. According to the overall scheme design of the system, the environment monitoring terminal of the system was designed. By analyzing the function and performance requirements of each submodule, the sensor module, GPS module, camera module, and wireless network communication module of the data collection unit were determined, which collected the parameters including noise, illumination intensity, harmful gas concentration, and PM 2.5 concentration. The hardware circuit of each module was designed. Software for environment pollution monitoring and management platform was designed, mainly including environment pollution monitoring server software, Web server software, and mobile phone terminal software. A joint test on the environment pollution monitoring system of the smart community was conducted, and the test results were analyzed. The test results showed that the system could run stably and achieve all the functions including the real-time data collection, abnormal alarm, data uploading, and video monitoring of environment pollution problems.



---

*Source: 1013300-2022-08-17.xml*