Sensing of Environmental Variables for the Analysis of Indoor Air Pollution

Ambient intelligence systems try to perceive the environment and react, proactively and pervasively to improve people’s environmental conditions. A current challenge in Ambient intelligence is trying to mitigate environmental risks that affect global public health, such as increasing air pollution. This paper presents the analysis of some environmental variables related to indoor air pollutants, such as CO, PM2.5, PM10, humidity and temperature; all of these captured in a university environment. The environmental measurements were carried out through a wireless sensor network consisting of two nodes. The cloud computing service, that is, ThingSpeak, was used as the storage medium. With this network, the presence of pollutants in the study area were detected with concentration levels within the permitted ranges, as well as its correlation with the atmospheric variables of temperature and humidity. The implementation of the sensor network allowed the capture of data in a transparent and non-intrusive way, and the analysis allowed the understanding of the behavior of pollutants in indoor spaces, where air circulation is limited, which in the face of high levels of pollution can be harmful to human health. Keywords—Air pollution; Ambient Intelligence (AmI); indoor air quality; wireless sensor network


I. INTRODUCTION
In recent years, Ambient Intelligence (AmI) has gained notoriety due to the need to capture and analyze environmental conditions with the idea of improving the environment of the inhabitants and society in general. A feature of Ambient Intelligence systems is the ubiquitous and pervasive computation that makes them sensitive, responsive and adaptive, without the need to interact with users [1].
The idea of ubiquitous and pervasive computing, in Ambient Intelligence systems, is the presence of communication devices and technologies such as wireless sensor networks (WSN), which work together to monitor environmental conditions, like sound, temperature, pressure, movement, pollution, among others. Each node in the network can perform sensing, processing and wireless communication functions [2], [3], [4].
At present, WSNs are implemented in various areas, for instance health care and monitoring the environment, sports, transportation, entertainment, smart spaces, among others. However, they face various problems and challenges, highlighting the limitation in storage capacity, communication due to its short-range, security, privacy and limited processing resources. One solution for storing data is through cloud computing [5].
Cloud technology has been developed to provide quick and easy access to a set of configurable computing resources, such as networks, servers, applications, services and storage [5]. The latter is offered as an infrastructure service, where the user does not need to worry about the location of the servers, nor about the available resources due to the high scalability of the resources, as they can be increased on demand [2].
Sensor integration and cloud storage have led to the Sensor-Cloud architecture, which is used to capture environmental conditions and accumulate transmitted data for later analysis. In this way, Sensor-Cloud allows users to collect, process, visualize, analyze and share sensor data in an efficient and easy way [2], [5]. Currently, there are several providers of Sensor-Cloud platforms, such as Amazon, Google, Microsoft, ThingSpeak, among others. Therefore, today it is possible to monitor the conditions of the environment through a wireless sensor network, storing the measurements in the cloud and applying certain algorithms to obtain inferences about these measurements. Precisely one of the growing environmental problems at present is air pollution, which has become a concern of society in general due to the environmental impact and serious damage to the health of people and ecosystems [6]. Various organisms in the world warn of the adverse and devastating effects of air pollution with serious consequences for humanity and the sustainable development of the world [7], [8], with children under five and older adults being the most susceptible [9], [10].
According to the World Health Organization [7], in 2016 alone, 3 million deaths per year in open spaces and another 3 million in indoor spaces are attributed to air pollution. While for 2019 the same organization estimated 4.2 million premature deaths from outdoor pollution and 3.8 million deaths from domestic exposure to smoke from stoves and dirty fuels [11]. Furthermore, amidst the main types of deaths attributed to air pollution are [10]: stroke, heart disease, lung cancer.
In this sense, this work presents the sensing and analysis of environmental variables related to indoor air pollutants, which were captured through a wireless sensor network that was connected to a cloud service, where the measurements were stored. This wireless sensor network was composed of two nodes, one that captures atmospheric pollutants PM 10 and PM 2.5 (Particulate Matter), and the other that captures carbon monoxide, temperature and humidity in the environment. This wireless sensor network was installed in a university environment in Mexico City.

A. Air Pollution
Poor air quality means that there are particles or gases contaminating the environment in a certain period, either in open or closed spaces and in different quantities. These pollutants cause various damages to health and the environment, also contributing negatively to climate change and depletion of the ozone layer [6], [10].
It is important to highlight that at present, there is a wide diversity of factors that contribute to the emission of air pollutants: a) those of natural origin, such as erosion, volcanic activity, forest fires and biological material; b) those that are produced by human activities, especially in metropolitan areas by industry, transport and power generation; and c) those derived from activities in rural areas by agriculture and livestock. Undoubtedly, the combination of these pollutants, associated with meteorological and environmental conditions, potentiates the deterioration of air quality, which in addition to the effects on health and ecosystems, leads to a brake on the development of the economy and the advancement of social welfare due to the damage it causes in agriculture, livestock, tourism, and other areas [6].
From a health perspective, the most important air pollutant is particulate matter (PM), which has an aerodynamic diameter less than or equal to 10 micrometers (PM 10 ) and particles less than or equal to 2.5 micrometers (PM 2.5 ) [9]. PM 10 is caused by the disintegration of larger particles and the incomplete combustion of fossil fuels. They also contain materials from the Earth's crust and biological materials, such as pollen, spores, viruses and bacteria. Other emitters are unpaved roads, agriculture, firewood burning, the food industry, electric power generation, among others. While PM 2.5 is a complex mixture of inorganic materials, metals, inert species and carbonous material from combustion. Among the activities that generate this pollutant are: housing combustion, electric power generation, diesel vehicles [6], [9], [12].
On the other hand, the gases that contribute to deteriorating air quality are Carbon Monoxide (CO), Carbon Dioxide (CO 2 ), Ozone (O 3 ), Nitrogen Oxides (NO x ) and Sulfide Dioxide (SO 2 ). Of these, CO is one of the most important pollutants generated by incomplete combustion, that is, the components of the fuel that do not fully oxidize, these are called unburned, being motor vehicles and the generation of electrical energy some of their most important generating sources [6].

B. Indoor Air Quality
Indoor air is that which is found in closed places and its circulation is limited such as homes, hotels, banks, offices, schools, hospitals, among others. A large percentage of the population spends 90% of their time inside these places or any other space, where the air quality may be contaminated [13]. This may be due to various factors such as cleaning products used, building materials, maintenance activities, electronic equipment, textiles, combustion when cooking, use of heaters and so on. Therefore, new research emerges on how to prevent poor air quality, especially in indoor spaces [13], [14], [15].
Indoor Air Quality (IAQ) is the relationship between temperature, humidity, ventilation and chemical and biological pollutants in indoor spaces, not counting industrial buildings.

C. Health and Environmental Care
From different edges of technological development, it is important to promote environmental care with the purpose of improving the quality of life without compromising that of future generations [10]. This implies obtaining information through monitoring networks with the purpose of knowing the concentration levels of atmospheric pollutants. This information allows for air quality diagnostics and air pollution modeling [6].
Obtaining real-time information on air quality is of great importance for the control of air pollution, either to make the population aware of possible risks, as well as to eliminate or minimize the emission of pollutants. Furthermore, it is important to make predictions through valid models to identify trends in order to determine future pollutant concentrations or locate sources that originate them. Thus, the purpose is to have useful information to support decision-makers in order to prevent various levels of contamination [16], [17].

III. LITERATURE REVIEW
At present, there are works that used data from regulated monitoring stations, also known as certified, with which various models were implemented for the analysis and forecast of air pollution. On the other hand, there are works in which low-cost sensor networks were used for data acquisition, with which analyzes were performed to determine the reliability of their measurements, as well as the implementation of models for forecasting concentration levels of pollutants in the air.
One of these works is [18], where they installed 17 sensor nodes in playgrounds in Oslo, Norway. The purpose was the monitoring of nitrogen dioxide (NO 2 ) levels as an air pollutant in open spaces, in order to provide to the staff of these children's rooms with updated information to prepare an adequate plan for outdoor activities, thus reducing children's exposure to pollutants. As part of the work, to improve the precision of the data obtained by the sensors, data fusion techniques were used. With these data, detailed maps of pollutant concentrations throughout the area were generated. To compare the measurements obtained, they used captures from a nearby regulated atmospheric station, thus finding correlations with the data obtained by the sensors. As later work, the authors suggest using supervised learning techniques to reduce measurement error.
In [19] they presented an air quality monitoring system (AQM) in Qatar. For this, they used low-cost sensors, whose measurements were stored, processed and converted into forecasts of air pollutants of O 3 , NO 2 and SO 2 . For the forecast, they used machine learning algorithms such as Support Vector Machine (SVM), M5P Model Trees (M5P) and Artificial Neural Networks (ANN), which were evaluated by Prediction Trend Accuracy (PTA) and Root Mean Square Error (RMSE).
(IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 6, 2020 The results obtained showed that M5P achieved a better prediction performance. These results were later distributed via a mobile application and text messages. As future work, they suggest implementing changes in data capture for realtime forecasting.
Moreover, according to [20], the United States Environmental Protection Agency (EPA) established the Community Air Sensor Network (CAIRSENSE) project, in order to assess the feasibility of various sensor networks installed in an area of two kilometers from the suburban area of Decatur, Georgia. The pollutants measured between August 2014 and May 2015 were NO, O 3 , CO, SO 2 and PM 2.5 , which were compared with measurements from regulated air monitoring stations. The work showed that low-cost sensors provide variable performance, and in some cases had a high correlation. This can be a consequence of various environmental factors that contribute to the performance of the measurements obtained by the sensors. Therefore, the authors recommend testing these types of sensors in different climates in order to identify the air pollutants that predominate in a certain area or place.
In the case of Mexico, according to the Air Quality program [21], the Ministry of the Environment of Mexico City, in collaboration with the National Supercomputing Center of Barcelona (CNS), in 2017 developed a forecasting system of air quality that integrates three models: meteorological, emissions and chemical transport. The data used comes from stations of the Atmospheric Monitoring System (SIMAT). Data from global systems were used for the meteorological model, while information on the quantity and distribution of NOx, CO, SO 2 , NH 3 (ammonia), PM 2.5 and volatile organic compounds were used for the emissions model. Thus, based on the Megalopolis Environmental Commission [28], if one of the stations reports 151 ozone points, then the forecast system is consulted for the next 24 hours. However, in May 2019 an atmospheric contingency was presented that questioned the performance of the Air Quality Forecasting System. Table I summarizes the main characteristics of the analyzed works emphasizing the key points that characterize them such as author, type of monitoring, pollutants analyzed, place and type of application.
Nowadays, continuous and systematic environmental monitoring requires technological resources that hinder its implementation [18], [22]. In response, compact low cost and easy to implement sensors have been developed that allow monitoring of environmental conditions with high spatial and temporal resolution [23]. These devices, in recent years, have become an important part of active environmental monitoring with a remarkable performance [18], [24], which makes them a viable option to obtain space-time measurements with high resolution.
For this reason, obtaining real-time information on the concentrations of pollutants in the air is of great importance for controlling pollution levels and protecting people from adverse health impacts. Therefore, this work presents the sensing and analysis of environmental variables related to indoor air pollutants, captured through a wireless sensor network connected to the cloud service through ThingSpeak, which is an open source Internet of Things application to store and retrieve data over the Internet.

IV. METHOD
Given the purpose of capturing and analyzing environmental variables related to indoor air pollutants, as a method for this research three work stages, exploratory and applied, were defined: a) design and installation of the network of wireless sensors, b) data acquisition in the observation area, and c) analysis of air pollutants in the observation area.

A. Wireless Sensor Network
For data capture, a wireless sensor network was designed and implemented, consisting of a NodeMCU ESP8266 board; temperature, humidity, CO, PM 10 and PM 2.5 sensors; and ThingSpeak cloud storage service. The NodeMCU board is a development kit for Internet of Things which integrates various components: ESP8266 microcontroller, ESP12E module, CP2102 serial-USB converter chip, microUSB port for power supply and programming, firmware, status led, a button for reset, flash button, among others. While the sensors used were: • DHT11, it is a digital sensor that measures the humidity and temperature of the environment in which it is located. Humidity is measured by means of a capacitive sensor and the temperature by means of a thermistor.
• DHT22, it is a digital sensor that measures humidity and temperature, which has better accuracy than DHT11.
• MQ-7, it is a sensor to detect CO concentrations in parts per million (ppm). It is highly sensitive and fast responsive, used in industry, homes and portable detectors.
• SDS011, it is a sensor used to obtain the concentration of particles in the air between 0.3 and 10 micrometers in diameter. It has a digital output and a built-in fan that makes it stable and reliable.
These sensors were physically connected to the ESP8266 node, which in turn was wirelessly connected to Internet to create a permanent communication channel with the ThingSpeak platform. This platform allows the processing and storage of 8200 messages per day [25]; enough quantity for this project. In addition, it provides real-time data stream visualization. Fig.  1 shows an overview of wireless sensor network design. For the reading, import and export of data, a communication channel was enabled, which can be accessed through www.ijacsa.thesai.org HTTP calls, REST API and the MQTT API, or downloaded directly in the Comma-Separated Values (CSV) file format. The process begins with the capture of data through the sensors, these measurements are sent through the communication channel to the ThingSpeak platform, where the data was stored in the cloud in a structured way, that is, each column represents a captured variable and each record represents one row. Subsequently, with the data history, it is possible to make visualizations and analyzes of particular interests.

B. Data Acquisition in the Observation Area
The acquisition of data was performed in a university environment, specifically in an Artificial Intelligence Laboratory of a public university in Mexico City. The laboratory is a workspace for students and teachers, where academic activities, theoretical classes, and guided practices are held. This space has an area of 70m 2 and a capacity for 32 people. Fig. 2 shows the workspace, which has furniture, computer equipment, and an air conditioning system.
It is important to note that in Mexico City, throughout 2019, the Atmospheric Environmental Contingencies Program (PCAA) in its phase I has been activated on three occasions and lasting from one to three days, this due to the high O 3 and PM 2.5 concentration levels [26]. In this sense, based on the implemented wireless sensor network, the pollutants CO, PM 10 and PM 2.5 , and environmental variables of humidity and temperature were measured in the observation area.
• Carbon Monoxide (CO), is an odorless, colorless, and tasteless gas that is produced by the combustion of organic substances and pollutants emitted by vehicles, and on a smaller scale by industry. It is considered one of the six most criteria pollutants and harmful to health and the environment [27]. In addition, it is toxic due to its ability to combine with hemoglobin, impeding it from capturing and transporting oxygen and thus making it difficult to deliver to tissues, affecting different organs such as the heart and brain. This causes confusion, difficulty concentrating, and low reflexes [28], [29]. It also causes visual problems, reduces mental capacity, manual dexterity and making it difficult to perform complex tasks. At extremely high levels it produces severe poisoning and can lead to death [30].
• Particulate matter PM 10 is a mixture of substances in liquid or solid state that remain suspended in the atmosphere for varying periods [31]. This type of particle has 10 micrometers in diameter (PM 10 ) and its unit of measurement is µg/m 3 (microgram per cubic meter). They are mainly composed of materials from the Earth's crust and biological material, such as pollen, spores, viruses and bacteria. They originate mostly from the process of disintegration of larger particles. They are mainly deposited in the nose, mouth, and laryngopharynx, and can reach the thoracic region of the respiratory tractors such as the trachea, pharynx, and lungs [9], [30].
• Particulate matter PM 2.5 is composed of fine particles with diameter fewer than 2.5 micrometers, and just like PM 10 , its unit of measurement is µg/m 3 . The main emitters are carbon, organic carbon, biological material, which in turn includes endotoxins, bacteria, spores, allergens and pollen, and inorganic material, such as sulfates, ammonia, nitrates, transition metals, and earth metals [32]. Other sources of emission are sea salts, erosion, forest fires, volcanic activity, plant fragments, microorganisms, housing combustion, (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 6, 2020 power generation, transportation, among others [9]. They can reach alveoli and even blood, generating more serious and dangerous problems and diseases than PM 10 [30].
• Atmospheric temperature is a magnitude that measures the thermal level of the atmosphere, in this case in degrees centigrade ( • C). The human being is designed to intuitively perceive the notion of cold (lower temperature) and heat (higher temperature). Furthermore, the physical properties of matter depend on temperature.
• Relative humidity is the amount of water vapor that exists in a given environment. It is expressed as a percentage (%) and it is dependent on environmental conditions, the more water in the environment, the higher the degree of humidity. In addition, when humidity in the air cools due to temperature, it condenses and becomes liquid.
The capture period of these atmospheric variables was 15 consecutive days, from November 18 to December 2, 2019, with a capture timing scheduled at each node of one minute. The purpose was to detect possible air pollutants in the observation area, where students and teachers interact daily for academic activities. Tables II and III show extracts from the capture measurements of temperature, humidity and carbon monoxide (node 1); and PM 10 and PM 2.5 (node 2), respectively.

C. Analysis of Pollutants in the Observation Area
For the analysis of possible pollutants in the observation area an exploration of the data was carried out, mainly through the deployment of graphs in order to identify, depending on the temporality, some kind of trend, seasonality and correlation between variables. In addition, for the analysis, the permitted levels in each of the evaluated air pollutants and their risk level were taken as a reference.
• CO is measured in parts per million (ppm); 1 ppm equals 1145 µg/m 3 . The average levels of CO in households without gas stoves range from 0.5 to 5 ppm [33]. NOM-021-SSA1-1993 [34] establishes that the maximum permissible value of exposure to this pollutant, for a susceptible person, is 11 ppm on average for a maximum of 8 hours once a year. However, the EPA [35], through the National Ambient Air Quality Standards (NAAQS) establishes that the exposure to this pollutant should not exceed 9 ppm during an average of 8 hours or 35 ppm for one hour once a year.
• Regarding PM 10 , the limit values established by the Ministry of Health [9] for the exposure of a vulnerable person to this pollutant is 75 µg/m 3 as an average in 24 hours and 40 µg/m 3 as an annual average. On the other hand, the World Health Organization [36] suggests an annual average of 20 µg/m 3 and an average of 50 µg/m 3 for 24 hours. However, the EPA [35] sets the limit at 150 µg/m 3 for 24 hours without exceeding this exposure more than once a year for an average of 3 years.
• Given that, PM 2.5 causes more serious and dangerous problems and diseases than PM 10 [9], and since they can reach alveoli and even blood the Ministry of Health [11] establishes that 45 µg/m 3 is the limit of exposure to this pollutant for an average of 24 hours for a vulnerable person and 12 µg/m 3 as an annual average.

V. RESULTS
With respect to the CO concentration levels (Fig. 3), it was observed that during the first 10 days, values between 0.6 and 1.3 ppm were presented, which are within the range of the permitted average levels, that is, values between 0.5 and 5 ppm. However, for day 11 a peak of 2.5 ppm was observed which may be associated with an increase in pollution levels during that day. Then, it decreased reaching values below 2.0 ppm in the last days of sensing. In general, the obtained values were within the allowed average levels, that is, less than 9 ppm. Furthermore, there is no evidence of a clear cause and effect relationship of the CO measurement with respect to the passage of days. For the case of particulate matter of 2.5 and 10 micrometers in diameter (Fig. 4), a similar behavior was observed between PM 2.5 and PM 10 , reaching peaks of maximum concentration (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 6, 2020 in two days of measurement with 84.72 and 76.80 µg/m 3 , respectively and a lower peak that coincides with the maximum CO peak of day 11, shown in Fig. 3. On the remainder of the days evaluated, concentrations were lower reaching minimum measurements of 13.75 and 33.62 µg/m 3 , respectively. These values, in accordance with the parameters defined by the Ministry of Health [9] are at the permissible average levels, that is, 45 µg/m 3 for the case of PM 2.5 and 75 mg/m3 for PM 10 with exception of the two maximum concentration peaks mentioned. Regarding the air quality affected by the CO concentration levels and its relationship with temperature and humidity, the presence of a certain degree of observable correlation between these variables was perceived. In the case of temperature (Fig.  5), through its seasonality, it was observed that it does not condition the increase or decrease in CO concentration levels as time elapses, except in the last part of the sampling period, whereas the temperature increased slightly there was also a slight increase in the CO concentration levels. While in the case of humidity (Fig. 6) there is clear evidence that higher percentages of water concentration in the environment were lower levels of CO contamination in the air. About the effect that the atmospheric variables of temperature and humidity in the environment had on the PM 2.5 and PM 10 particulate matter, it was observed, Fig. 7 and 8, that these also did not condition the increase or decrease in air pollution levels either, that is, there is no observable pattern or degree of correlation between these variables. Was observed that the particulate matter suspended in the environment had varying behavior during the data capture period. Based on these results, regarding CO, the levels recorded to coincide with the values established by the United States Environmental Protection Agency for indoor spaces without stoves; as is the case of the laboratory under study. Given that the concentrations were lower than the limits set by the various national and international organizations that determine health standards, it can be affirmed that the presence of CO is not harmful to human health. For PM 10 and PM 2.5 particles, levels were detected at the margin or above-established limits that, coupled with the presence of outliers, could warn of errors in data collection.
Without a doubt, environmental conditions and the presence of pollutants in the air can affect the performance of people's activities and their quality of life. This presence of air pollutants, and specifically in indoor spaces, is also conditioned by other characteristics of the environment, such as lack of ventilation, days of working hours, a vehicular influx in parking lots, among others.

VI. CONCLUSIONS
Since indoor air quality can be affected by outdoor air, at present it seeks to promote environmental care from different edges of technological development in order to prevent diseases and health effects caused by air pollution and thus not compromising future generations.
One of the initial steps in dealing with exposure to air pollutants is learning about the conditions in which the environment is located. Therefore, it is important to quantify and analyze air quality as much as possible. This implies obtaining data through several monitoring systems, as support for the (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 6, 2020 On the other hand, it is not enough to have regulated monitoring stations to measure pollutant concentration levels, but it is also useful to have other data capture mechanisms, for example, through wireless sensor networks with which you can measure specific observation areas, whether in closed or open spaces.
In this work, a wireless sensor network was designed and installed for monitoring air pollutants in an indoor space of a public university in Mexico City. The main feature of this sensor network is the persistence of data in the cloud and high temporal resolution. The sensor network consists of two nodes, one to measure the concentrations of particular matter PM 10 and PM 2.5 and another to measure Carbon Monoxide and atmospheric variables of humidity and temperature in the environment.
Through the analysis, it was observed that the concentration levels of the contaminants are within the permissible parameters. In general, the level of pollution increased during working hours, meaning that the air quality was better during the first hours of the day. Likewise, it was determined that humidity and temperature are physical factors that do not condition variations in pollutants. However, no trends o seasonality were presented and a cause-effect relationship was not established over time.
It could be said, then, that low-cost wireless sensor networks obtain the environmental parameters of humidity and temperature, and levels of air pollution of CO, PM 10 and PM 2.5 in a closed space, in a pervasive and ubiquitous manner, that is, transparent and non-intrusive way, with cloud storage, high temporal resolution, high space coverage, in real time, and which can be customized based on requirements. Compared to regulated monitoring stations they are an option that redeems economic and practical. However, knowledge is required in the programming of microcontrollers, taking into account that there are no official programming guides and mainly calibration guides on such sensors that leads to uncertainty in data reliability.
In addition, the analysis of the data allowed the understanding of the behavior of environmental variables in indoor spaces. Based on the results obtained, as future work, it is planned to develop models, based on deep learning, for the forecast of pollutants in closed places where air circulation is limited, which given high levels of pollution can be harmful to human health.