Internet of Things and Enhanced Living Environments: Measuring and Mapping Air Quality Using Cyber-physical Systems and Mobile Computing Technologies

This paper presents a real-time air quality monitoring system based on Internet of Things. Air quality is particularly relevant for enhanced living environments and well-being. The Environmental Protection Agency and the World Health Organization have acknowledged the material impact of air quality on public health and defined standards and policies to regulate and improve air quality. However, there is a significant need for cost-effective methods to monitor and control air quality which provide modularity, scalability, portability, easy installation and configuration features, and mobile computing technologies integration. The proposed method allows the measuring and mapping of air quality levels considering the spatial-temporal information. This system incorporates a cyber-physical system for data collection and mobile computing software for data consulting. Moreover, this method provides a cost-effective and efficient solution for air quality supervision and can be installed in vehicles to monitor air quality while travelling. The results obtained confirm the implementation of the system and present a relevant contribution to enhanced living environments in smart cities. This supervision solution provides real-time identification of unhealthy behaviours and supports the planning of possible interventions to increase air quality.


Introduction
Internet of Things (IoT) paradigm is related to the connection of physical objects to the Internet. These objects should be pervasive and ubiquitous by supporting reliable sensing capabilities. Moreover, these devices can be handled via unique addresses, support cooperation capabilities and provide ubiquitous and pervasive applications [1,2]. There is clear evidence of the increase of IoT systems and their adoption for several daily routine activities. People's homes are being invaded by IoT products for surveillance, environmental monitoring, energy consumption analysis and home automation. Regarding the healthcare field, IoT technologies provide effective and efficient methods for enhanced the United States has decreased in the past decades [30,31]. Nevertheless, most people live in cities where air quality problems persist since ozone (O 3 ), nitrogen dioxide (NO 2 ), and particulate matter (PM) exposure values lead to relevant health risks and are estimated to reduce life expectancy [32]. Consequently, air pollution remains a critical problem worldwide [33].
Several epidemiologic research studies state numerous adverse health effects associated with air quality, such as premature death, respiratory, and cardiovascular disease [34]. Air quality assumes a significant responsibility in human exposure to pollutants and is particularly relevant for specific groups such as older adults, students, and people with disabilities [35]. Secondly, numerous research studies noted the negative impacts on health and well-being, particularly on children and older adults related to reduced air quality levels. Poor air quality levels is a critical global health challenge and can be compared to the use of tobacco and sexually transmitted diseases [28]. The Environmental Protection Agency (EPA) stated that indoor air quality (IAQ) pollutants levels can be up to 100 times greater when compared with outdoor air quality and ranked poor air quality in the top 5 environmental risks to global health and well-being [36]. Every year, air quality concentration levels are responsible for 3.2 million deaths and a relevant increase in heart and asthma attacks, dementia, as well as cancer [37,38]. The consequences of poor air quality are most severe in developing countries where there is no regulation to control pollutants emissions. However, air quality levels are also a problem in developed countries. Every year in the USA, approximately 60,000 premature deaths are reported and linked to reduced air quality levels and the healthcare costs related to air quality diseases in healthcare costs reach $150 billion [39]. According to the European Environment Agency, in 2016, air pollution was responsible for 400,000 premature deaths in the European Union (EU). PM caused 412,000 premature deaths in 41 European countries, and 374,000 occurred in the EU [40]. Moreover, the cost related to the air pollutant emissions effect caused by industrial facilities in 2012 has been estimated as at least 59 to 189 billion euros in the EU [41]. Even in locations with good air quality, levels are reported in situations of short-term exposure which conduct relevant health symptoms related to sensitive groups such as elderly and children with asthma and cardiovascular problems [42,43]. Living environments include numerous types of spaces and locations, such as workplaces, clinics, public service centres, faculties, leisure spaces, vehicles, cabins, and outdoor locations [44]. Notably, a significant percentage of indoor environments have a high number of occupants. Taking into consideration all the problems and consequences from reduced air quality exposure, the indoor and outdoor air should be monitored in real time using CPS to improve the health and well-being of the occupants [45]. Furthermore, specific legislation requirements must be created to act in real time in order to promote public health and well-being. By applying efficient and effective monitoring methods, it is possible to identify inadequate air quality concentrations in useful time and plan interventions for ELE and well-being [46]. Regarding the afore-mentioned facts, air quality sensing is a relevant public health problem which must be addressed by several fields of research but mainly by the technological field. Air quality sensing is a relevant factor to be monitored and controlled not only inside buildings but also inside vehicles. Scalable, modular and easy-to-install methods are required to detect poor air quality scenarios.
Carbon dioxide (CO 2 ) is one of the greenhouse gases assumed as the primary cause of global warming and environmental degradation [47]. Moreover, the CO 2 concentration level is a relevant indicator of air quality conditions [48,49]. It is produced in large quantities, is relatively easy to quantify, and can be used to evaluate the degradation of the air quality as a whole [50][51][52]. Numerous authorities define the thresholds for CO 2 in different countries [53,54]. Concentrations between 250 and 350 ppm are defined as normal outdoor air levels. The concentration commonly measured for occupied indoor spaces ranges from 350 to 1000 ppm. Poor air quality values for CO 2 associated with complaints of drowsiness are defined from 1000 to 2000 ppm. From 2000 to 5000 ppm, CO 2 levels are related to several health symptoms such as headaches and increased heart rate. Values higher than 5000 ppm are associated with unusual air conditions with high levels of other air pollutants.
The primary source of CO 2 emissions in urban areas is related to the use of fossil fuels such as petroleum, hydrocarbons and natural gas [55,56]. Electricity production is also responsible for the emission of high quantities of CO 2 if the power source is fossil fuels [57,58]. Moreover, transportation and industry must also be taken into consideration regarding CO 2 emissions [59].
This document proposes an air quality supervision system based on IoT for ELE. The proposed method incorporates a cyber-physical system for air quality monitoring and applies mobile computing technologies to measure and map the air quality levels taking into account the spatial-temporal information. The proposed architecture incorporates a data acquisition prototype and provides a mobile application for data consulting. This cyber-physical system incorporates an ESP32 microcontroller as the processing and communication unit and uses an MH-Z14 CO 2 sensor. The collected data are transmitted to a smartphone through BLE, which collects the GPS data and uploads all the information to a backend application. The collected data can also be accessed using the mobile application developed by the authors. Furthermore, this information can be consulted by the building and city manager in real time for air quality assessment. These data can be analyzed to plan interventions to create ELE. The proposed solution is portable and can be easily installed and configured, not only to provide air quality supervision in indoor environments where GPS is available, such as vehicle cabins, but also to monitoring outdoor air quality. Moreover, the proposed solution can be installed on top of vehicles to map and measure the air quality in real time. Numerous air quality monitoring systems have been proposed by several research studies available in the literature. These methods incorporate open-source technologies for processing and data transmission and microsensors for data acquisition, but also provide mobile applications for data consulting [60][61][62][63][64][65][66][67]. However, these methods do not provide a portable solution to monitor air quality inside vehicles and do not correlate the air quality levels with geographic coordinates. The main contribution of this paper is to propose a low-cost IoT method to monitor air quality which can be easily installed and configured to supervise vehicles on the move and store the collected values in a structured database, for supporting decision making on possible interventions to promote public health. The main objectives of the manuscript were to present the design and development of a portable real-time data acquisition system for air quality measurement and mapping and to test the proposed IoT approach and system architecture. Furthermore, another relevant objective was to create a reliable stream of air quality data to assist the decision making on possible interventions for ELE and to support the clinical evaluation by correlating the patient health conditions with the air quality data of their living environment.
The rest of this document is organized as follows: Section 2 introduces the related work; Section 3 describes the methods and materials used in the design and development of the proposed architecture; Section 4 presents the results of the research conducted, and Section 5 concludes the paper.

Background
Smart cities incorporate technology to increase efficiency, sustainability, and economic development for ELE [68]. The creation of a smart city is based on relevant concepts, such as IoT, CPS and mobile computing technologies to improve health and well-being. Regarding the relevant open issues of present-day urban environments, the smart city concept is an effective method to address these challenges [69]. Moreover, the smart city should be considered as an emerging approach to address relevant urban problems originating from population growth and economic activities [70]. However, the implementation of smart cities has numerous challenges, such as the interoperability of different technologies, but also privacy and ethical problems. IoT architectures can be incorporated in smart cities through the development of new daily routine services to increase city efficiency and sustainability [71]. Furthermore, IoT systems can provide interoperability to smart cities as IoT can be used to develop unified urban scale systems [72].
Smart homes are ELE which lead to several benefits for human life. The main goal of smart homes is to allow and maximize the benefits of technology for everyone in order to improve public health and safety [73]. Recent technology advances allow a decrease in the cost of smart homes and the development of smart environments and intelligent sensors for real-time data acquisition, transmission, and storage [74]. IoT architectures are developed to incorporate smart devices for data collection and mobile computing technologies which are used for data consulting [75]. Smart homes must include air quality sensing for ELE and to promote health and well-being. The smart home design must take into consideration older adults to promote effective care and improve safety [76].
The implementation and correlation of different areas of knowledge, such as smart cities, smart homes, mobile computing, IoT and CPS, will lead to smart living, which will bring multiple benefits for everyone [77]. Smart homes, combined with IoT and mobile computing, already integrate numerous benefits in the smart city context [78]. The real-time sensing features enabled by ELE provide immediate alerts based on environmental conditions sensing, which can automatically trigger appropriate interventions to improve public health and safety. Air quality monitoring systems can be used to provide real-time data in both outdoor and indoor living environments to design intervention strategies in a useful time to increase productivity and well-being. Moreover, these data can be consulted by doctors and city managers to correlate environmental conditions with people's symptoms for enhanced public health and safety.
Numerous open-source IoT methodologies for air-quality sensing incorporate cost-effective sensors for data collection and mobile applications for data access anywhere and anytime, are proposed by research studies available in the literature. A real-time CO 2 monitoring system composed of a cyber-physical system for ambient data acquisition and web and mobile software compatibility for data consulting is proposed by [64]. This system is a modular, scalable, and low-cost monitoring system which can be wirelessly connected to the Internet using Wi-Fi. The principal purpose of the proposed method is to provide an effective IAQ assessment to anticipate technical interventions for enhanced health and well-being. The iAir is an IoT system for real-time IAQ supervision based on the ESP8266 microcontroller, which is used as a communication and processing unit [63]. This system incorporates a MICS-6814 metal oxide semiconductor sensor which provides carbon monoxide (CO), ethanol, NO 2 , propane and methane supervision. The proposed method incorporates a mobile application for data access and real-time notifications and is based on open-source technologies. The acquisition system is connected to the Internet through Wi-Fi and provides easy installation features. A smartwatch-based application for IAQ data consulting is proposed by [79]. This solution incorporates a hardware prototype for data collection and transmission and is based on open-source technologies. The processing unit is based on the Arduino UNO microcontroller and several sensors are used for temperature, humidity, CO 2 , light, and PM monitoring. The data collected are stored in the ThingSpeak cloud platform. The smartwatch application provides pervasive and ubiquitous access to real-time notifications. The AirPlus is a real-time indoor environmental quality monitoring system which incorporates mobile computing software for data consulting and notifications [80]. The system sensor unit is composed of a PMS5003ST sensor that can monitor formaldehyde (CH 2 O), temperature, relative humidity and PM. The proposed architecture incorporates an acquisition system for data sensing purposes and wireless communication and smartphone application for data visualization and analytics. The main goal is to provide an efficient dataset to plan interventions to improve residents' productivity and health. Moreover, this dataset can be accessed to associate occupants' health symptoms with their indoor living conditions. An IoT architecture for IAQ supervision which incorporates costeffective air quality, temperature and humidity sensors is proposed by [81]. This system integrates a Raspberry Pi 2 microcontroller and the data collected are saved in a cloud platform. The proposed system provides real-time air quality index data, incorporates e-mail notification features, as well as web compatibility for data consulting. The authors of [82] present an end-to-end IAQ supervision system which provides CO 2 , CO, sulfur dioxide (SO 2 ), NO 2 , O 3 , chlorine (Cl 2 ), temperature, and humidity monitoring. The monitored data are stored in the Emoncms open-source IoT platform for real-time supervision and long-term storage. This solution uses a hybrid IoT/WSN architecture, the gateway is based on Raspberry Pi, and the sensor nodes are based on the Waspmote microcontroller.
Using real-time air quality monitoring systems, it is possible to identify unhealthy outdoor and indoor scenarios which can be assertively intervened. The proposed solution provides a useful tool for air quality management for ELE of smart cities. CO 2 assessment leads to several benefits for public health and productivity as the city, or building manager can improve the air quality by planning interventions to decrease the pollution load [83].

Exposure to Air Pollution
Exposure can be defined as the contact between an airborne pollutant and a surface of the human body. Therefore, this phenomenon requires two events at the same time: an airborne contaminant considering a particular location and time, and the presence of an individual at that location and time [84]. Air pollution exposure also affects beneficial and healthy practices, such as bicycling in urban areas [85]. A study conducted in central city neighbourhoods on the Island of Montreal concluded that cyclists' exposure levels to air pollution are significant and can be associated with health and safety risks [86].
Air pollution mapping and measurement have several challenges [87]. On the one hand, several pollutants affect air quality at different levels. On the other hand, there are several limitations regarding the insufficient funding and political questions in the design of aggressive policies for air pollutant emission reduction [88]. Mapping real-time air quality using mobile computing technologies promote higher spatial coverage when compared to fixed air quality stations. The fixed stations have relevant limitations since the monitoring data do not provide a continuous time-series of measurements [88]. Moreover, the fixed air quality stations typically have relatively long measurement times, such as an hour or even more [89]. These fixed stations present another significant limitation since they are typically installed in background locations at a relative distance from busy roads and can provide a distorted impression of air pollution exposure [89].
The use of mobile computing technologies, in general, and smartphones, in particular, to handle and process air pollution exposure data lead to several advantages. On the one hand, smartphones are widely used by most people. On the other hand, they include several sensors and communication protocols for data transmission. Furthermore, the mobile devices have processing capacities which enable the visualization and analysis of air pollution measurement data [90].

Materials and Methods
Air quality is a fundamental challenge for public health and well-being as it is accountable for several health symptoms [91]. Air pollution depends on the concentration of numerous chemical components such as, radon decay products, CO, CH 2 O, NO 2 , and aeroallergens which are correlated to health complications [92]. Therefore, air quality must be measured in real-time to provide a spatial-temporal dataset for enhanced data analytics and visualization.
On the one hand, temperature and humidity monitoring systems are already integrated into our daily routine as they are incorporated both in outdoor spaces and in the cabin of vehicles as people are more sensitive to these types of parameters. Poor thermal comfort conditions are easily detected by people [93]. On the other hand, poor air quality scenarios are only detected by people under extreme conditions. Typically, poor air quality is detected by short-term exposure effects such as eyes, nose, and throat irritation, coughing, chest tightness and shortness of breath [94].
It is essential to adopt effective systems to monitor air quality to alert the user in real time and provide effective behavioural changes for ELE. This is particularly relevant for several specific groups, such as people with cardiovascular disease, coronary artery disease or heart failure, specific lung diseases such as asthma or chronic obstructive pulmonary disease problems, pregnant women, older adults and people under the age of 14 years [95][96][97][98].
Taking into account this critical public health challenge, the authors propose a portable air quality monitoring system which can measure and map the CO 2 concentration in real-time and incorporate mobile computing technologies for data analytics and visualization considering the geographical coordinates. The hardware prototype does the data collection and they are sent by BLE to the mobile phone, which is responsible for the communication of the data to a backend.NET application for data storage using an MS SQL Server database. For data consulting, a mobile application was created using the Swift programming language (Figure 1). This solution provides a dataset of CO2 concentration in real-time which can aid the city or building manager in providing an efficient air quality assessment regarding the detailed spatialtemporal information of indoor or outdoor spaces, as well as in the projection of strategies and policies to increase people's health and well-being. The system is distributed into three segments: the cyber-physical system, which is responsible for data collection, a mobile computing system which supports the data upload, and a backend application which is responsible for data storage. The cyberphysical system prototype is represented in Figure 2. This cyber-physical system is based on the ESP32 microcontroller and uses a Heltec Lora 32; an IoT dev-board developed by Heltec Automation, which integrates an ESP32 and supports Wi-Fi, BLE and LoRa communication technologies, a Li-Po battery management system and 0.96″ OLED. The ESP32 is a 240 MHz Tensilica LX6 dual-core with 520 KB SRAM, and the LoRa chip is an SX1276. This microcontroller incorporates 3 UART; 2 SPI and I2C inputs, a 12 bits ADC, an 8-bits DAC and 29 general GPIO for sensor and actuators connections. The display is a 0.96 inch 128 × 64 OLED, which incorporates an 8 MB SPI FLASH, a micro USB for data programming and the microcontroller dimensions are 50.2 × 25.5 × 9.74 mm.
The sensing unit is designed using the DFRobot CO2 analogue infrared sensor. This sensor can measure CO2 data from 0 to 5000 ppm. It is based on non-dispersive infrared technology and has a five-year service life. Moreover, this sensor integrates temperature compensation and support analogue output. It has several relevant specifications, such as high stability, low power consumption, fast response, high sensitivity and long life. Table 1 presents the complete sensor specification.  This solution provides a dataset of CO 2 concentration in real-time which can aid the city or building manager in providing an efficient air quality assessment regarding the detailed spatial-temporal information of indoor or outdoor spaces, as well as in the projection of strategies and policies to increase people's health and well-being. The system is distributed into three segments: the cyber-physical system, which is responsible for data collection, a mobile computing system which supports the data upload, and a backend application which is responsible for data storage. The cyber-physical system prototype is represented in Figure 2. This solution provides a dataset of CO2 concentration in real-time which can aid the city or building manager in providing an efficient air quality assessment regarding the detailed spatialtemporal information of indoor or outdoor spaces, as well as in the projection of strategies and policies to increase people's health and well-being. The system is distributed into three segments: the cyber-physical system, which is responsible for data collection, a mobile computing system which supports the data upload, and a backend application which is responsible for data storage. The cyberphysical system prototype is represented in Figure 2. This cyber-physical system is based on the ESP32 microcontroller and uses a Heltec Lora 32; an IoT dev-board developed by Heltec Automation, which integrates an ESP32 and supports Wi-Fi, BLE and LoRa communication technologies, a Li-Po battery management system and 0.96″ OLED. The ESP32 is a 240 MHz Tensilica LX6 dual-core with 520 KB SRAM, and the LoRa chip is an SX1276. This microcontroller incorporates 3 UART; 2 SPI and I2C inputs, a 12 bits ADC, an 8-bits DAC and 29 general GPIO for sensor and actuators connections. The display is a 0.96 inch 128 × 64 OLED, which incorporates an 8 MB SPI FLASH, a micro USB for data programming and the microcontroller dimensions are 50.2 × 25.5 × 9.74 mm.

Specification Value
The sensing unit is designed using the DFRobot CO2 analogue infrared sensor. This sensor can measure CO2 data from 0 to 5000 ppm. It is based on non-dispersive infrared technology and has a five-year service life. Moreover, this sensor integrates temperature compensation and support analogue output. It has several relevant specifications, such as high stability, low power consumption, fast response, high sensitivity and long life. Table 1 presents the complete sensor specification.  This cyber-physical system is based on the ESP32 microcontroller and uses a Heltec Lora 32; an IoT dev-board developed by Heltec Automation, which integrates an ESP32 and supports Wi-Fi, BLE and LoRa communication technologies, a Li-Po battery management system and 0.96" OLED. The ESP32 is a 240 MHz Tensilica LX6 dual-core with 520 KB SRAM, and the LoRa chip is an SX1276. This microcontroller incorporates 3 UART; 2 SPI and I2C inputs, a 12 bits ADC, an 8-bits DAC and 29 general GPIO for sensor and actuators connections. The display is a 0.96 inch 128 × 64 OLED, which incorporates an 8 MB SPI FLASH, a micro USB for data programming and the microcontroller dimensions are 50.2 × 25.5 × 9.74 mm.
The sensing unit is designed using the DFRobot CO 2 analogue infrared sensor. This sensor can measure CO 2 data from 0 to 5000 ppm. It is based on non-dispersive infrared technology and has a five-year service life. Moreover, this sensor integrates temperature compensation and support analogue output. It has several relevant specifications, such as high stability, low power consumption, fast response, high sensitivity and long life. Table 1 presents the complete sensor specification. The selection of the MH-Z14 CO 2 sensor module was conducted considering not only the cost of the system but also the accuracy of the monitored data. This sensor accuracy is enough considering the thresholds defined for the CO 2 levels by the competent authorities. The proposed solution can be improved by adding other sensors to monitor specific chemical compounds and air pollutants. Moreover, it is relevant to mention that the main objective of the research was to test the proposed IoT approach and system architecture. The hardware cost is an estimated € 85.76 (Table 2). On the one hand, CO 2 levels are relevant for indoor and outdoor air quality assessment. High levels of CO 2 inside classrooms have been studied for several years [99][100][101][102][103]. On the other hand, outdoor air quality depends on the concentration of several substances such as particles, NO 2 , hydrocarbons, CO and O 3 , which derive from combustion sources [104]. Outdoor air quality not only depends on the pollutant emissions, but it also affected by the current ventilation and meteorological conditions [105]. Low wind and low convention promote the accumulation of pollutants. In these scenarios, the levels of CO 2 also increase [106]. Therefore, a direct relation between CO 2 and outdoor pollution produced by traffic and industry is also verified [107].
Air quality assessment can be done using multiple sensors to monitor each air pollutant [108]. However, the design of a cost-effective system that incorporates numerous sensors is not possible since the addition of sensors will increase the overall cost of the system. The use of various sensors also increases maintenance procedures [109]. PM sensors are based on optical sensors which need to be regularly cleaned to provide accurate readings [110]. Nitrogen sensors need to be frequently calibrated and replaced [111]. Furthermore, cost-effective sensors for the dedicated monitoring of each chemical composition presented in the air do not exist.
Nowadays, CO 2 sensors are reliable, accurate and maintenance-free [112]. CO 2 sensors can be used to provide an efficient and practical association between combustion-related emissions and outdoor air quality conditions. The correlation between outdoor air quality and the particular concentration of air pollutants depends on their source as diesel cars produce higher emissions of nitrogen dioxide than gasoline vehicles, for example [113]. This relation also depends on the season and the urban area [114]. Nevertheless, high levels of CO 2 are always a sign of high pollutant emissions considering the air exchange, which is therefore, an indication of the high risk for pollutants. Likewise, a low CO 2 level indicates that air pollutants are not accumulated and reveals good air quality scenarios [115].
In particular scenarios and applications, there is no significant need for high accuracy solutions because a qualitative assessment is sufficient to promote health and well-being. However, the proposed system incorporates a reliable CO 2 sensor to address the applications where accuracy is relevant. More important than the accuracy properties is to provide a portable solution for IAQ monitoring, which can map and measure the CO 2 levels in both indoor and outdoor environments. The cyber-physical system firmware was developed using the Arduino Core which is an open-source framework which offers Arduino functions and libraries support for the ESP32 microcontroller. This hardware is responsible for data acquisition and uses built-in BLE technology to communicate with a smartphone. The smartphone is responsible for GPS data handling. Moreover, the mobile application uses web services for data transmission and storage on an MS SQL Server. The proposed method records the CO 2 levels every 120 seconds (Figure 3). For testing proposes, a smartphone application was created using Swift programming language and Xcode Integrated Development Environment. This mobile application supports iOS 12 and above. This app, named AirSensingMobile, offers real-time data access and turns possible to check the location where this data is recorded.
Sensors 2020, 20, x FOR PEER REVIEW 9 of 20 In particular scenarios and applications, there is no significant need for high accuracy solutions because a qualitative assessment is sufficient to promote health and well-being. However, the proposed system incorporates a reliable CO2 sensor to address the applications where accuracy is relevant. More important than the accuracy properties is to provide a portable solution for IAQ monitoring, which can map and measure the CO2 levels in both indoor and outdoor environments. The cyber-physical system firmware was developed using the Arduino Core which is an open-source framework which offers Arduino functions and libraries support for the ESP32 microcontroller. This hardware is responsible for data acquisition and uses built-in BLE technology to communicate with a smartphone. The smartphone is responsible for GPS data handling. Moreover, the mobile application uses web services for data transmission and storage on an MS SQL Server. The proposed method records the CO2 levels every 120 seconds (Figure 3). For testing proposes, a smartphone application was created using Swift programming language and Xcode Integrated Development Environment. This mobile application supports iOS 12 and above. This app, named AirSensingMobile, offers real-time data access and turns possible to check the location where this data is recorded. BLE is a wireless communication technology developed for battery-powered systems [116]. BLE uses the 2.4 GHz radio frequency band and consumes less power than ZigBee [117,118]. BLE technology is the most used communication technology for the connection of hardware accessories with mobile phones [119]. Consequently, BLE communication technology is a suitable approach for IoT applications and was selected to provide data communication between the cyber-physical system and the mobile application. The Core Bluetooth is Apple's framework to send and receive messages using BLE technology on iOS applications. GPS is a space-based satellite navigation system which provides location and time information anywhere on Earth. This positioning system is used for several applications in military, civil, and commercial fields. Today, the majority of smartphones support GPS features, on iOS operating systems. CoreLocation is the framework responsible for GPS data acquisition.
Most of the air quality monitoring systems for indoor and outdoor environments available in the market are expensive and do not support spatial-temporal properties. Some of these solutions provide only data consulting on the equipment's display or provide data download procedures for further analysis. However, portability and real-time data sharing are relevant to provide healthy environments for the occupants. Furthermore, the location of the data collected is crucial in specific fields, such as the vehicles' cabins monitoring. Thus, the proposed method presents a portable air quality monitoring system with integrated wireless communication technology which provides an effective method to map and measure the air quality levels for further analysis to plan interventions for ELE.

Results and Discussion
The proposed solution was developed to provide air quality sensing in both indoor and outdoor environments. The mobile application offers data consulting in terms of geographic location. For testing purposes, the cyber-physical system was powered using a 5V 10,000 mA power bank. Realtime air quality supervision must be considered as a relevant tool to support decision-making not BLE is a wireless communication technology developed for battery-powered systems [116]. BLE uses the 2.4 GHz radio frequency band and consumes less power than ZigBee [117,118]. BLE technology is the most used communication technology for the connection of hardware accessories with mobile phones [119]. Consequently, BLE communication technology is a suitable approach for IoT applications and was selected to provide data communication between the cyber-physical system and the mobile application. The Core Bluetooth is Apple's framework to send and receive messages using BLE technology on iOS applications. GPS is a space-based satellite navigation system which provides location and time information anywhere on Earth. This positioning system is used for several applications in military, civil, and commercial fields. Today, the majority of smartphones support GPS features, on iOS operating systems. CoreLocation is the framework responsible for GPS data acquisition.
Most of the air quality monitoring systems for indoor and outdoor environments available in the market are expensive and do not support spatial-temporal properties. Some of these solutions provide only data consulting on the equipment's display or provide data download procedures for further analysis. However, portability and real-time data sharing are relevant to provide healthy environments for the occupants. Furthermore, the location of the data collected is crucial in specific fields, such as the vehicles' cabins monitoring. Thus, the proposed method presents a portable air quality monitoring system with integrated wireless communication technology which provides an effective method to map and measure the air quality levels for further analysis to plan interventions for ELE.

Results and Discussion
The proposed solution was developed to provide air quality sensing in both indoor and outdoor environments. The mobile application offers data consulting in terms of geographic location. For testing purposes, the cyber-physical system was powered using a 5V 10,000 mA power bank. Real-time air quality supervision must be considered as a relevant tool to support decision-making not only to plan behavioural changes inside buildings but also to ensure healthy outdoor conditions through the correct planning and flow of traffic. Usually, the outdoor air quality levels are not measured in real-time using mobile air pollution monitoring technologies. The outdoor air quality is typically monitored by stationary monitoring units with a fixed location. These monitoring units have a high cost of installation and operation [88]. However, real-time monitoring procedures applied outdoor can help the identification of specific locations where the air quality conditions are defective to improve public health and safety. Nowadays, mobile phones usage time in the western world has increased considerably. Smartphones are used for numerous daily routine activities and support several communication technologies but also significant processing power and data visualization tools. The majority of smartphones incorporate GPS [120]. In total, 70% of the Netherlands population and 90% of adolescents have smartphones [121]; 40% of the German population use a smartphone [122], and in the United Kingdom, 51% of adults also have smartphones [123].
Furthermore, mobile computing technologies have offered ubiquitous Internet connection which leads to numerous daily routine changes. Therefore, a mobile application was proposed to provide an effective method for the user to carry their air quality sensing data for continuous use. Figure 4a presents the last data collected by the system. Thus, the user can consult the CO 2 data collected but also check the BLE RSSI from the connection between the cyber-physical system and the smartphone. Figure 4b shows the corresponding location from the data collected. Using this method, it is possible to measure and map the air quality sensing in real-time for ELE in smart cities.
Sensors 2020, 20, x FOR PEER REVIEW 10 of 20 only to plan behavioural changes inside buildings but also to ensure healthy outdoor conditions through the correct planning and flow of traffic. Usually, the outdoor air quality levels are not measured in real-time using mobile air pollution monitoring technologies. The outdoor air quality is typically monitored by stationary monitoring units with a fixed location. These monitoring units have a high cost of installation and operation [88]. However, real-time monitoring procedures applied outdoor can help the identification of specific locations where the air quality conditions are defective to improve public health and safety. Nowadays, mobile phones usage time in the western world has increased considerably. Smartphones are used for numerous daily routine activities and support several communication technologies but also significant processing power and data visualization tools. The majority of smartphones incorporate GPS [120]. In total, 70% of the Netherlands population and 90% of adolescents have smartphones [121]; 40% of the German population use a smartphone [122], and in the United Kingdom, 51% of adults also have smartphones [123]. Furthermore, mobile computing technologies have offered ubiquitous Internet connection which leads to numerous daily routine changes. Therefore, a mobile application was proposed to provide an effective method for the user to carry their air quality sensing data for continuous use. Figure 4a presents the last data collected by the system. Thus, the user can consult the CO2 data collected but also check the BLE RSSI from the connection between the cyber-physical system and the smartphone. Figure 4b shows the corresponding location from the data collected. Using this method, it is possible to measure and map the air quality sensing in real-time for ELE in smart cities.  The proposed method supports numerous advantages regarding modularity, size, portability, cost-effective and easy installation. The mobile application provides an easy and accessible method for data analysis and visualization. On the one hand, the proposed architecture provides a relevant dataset for environmental management. Using the proposed system, it is possible to detect defective air quality scenarios and plan interventions for ELE. Therefore, this mobile computing solution can be assumed as a relevant decision-making tool to define strategies to increase air quality conditions and to guarantee the efficiency of these methods. Figure 5 presents the mapping of the monitored locations in the tests conducted. The numbers of Figure 5 represented the exact location where the CO2 concentrations were measured. The details regarding the latitude, longitude, CO2 level and time of the data collection are presented in Table 3. The proposed method supports numerous advantages regarding modularity, size, portability, cost-effective and easy installation. The mobile application provides an easy and accessible method for data analysis and visualization. On the one hand, the proposed architecture provides a relevant dataset for environmental management. Using the proposed system, it is possible to detect defective air quality scenarios and plan interventions for ELE. Therefore, this mobile computing solution can be assumed as a relevant decision-making tool to define strategies to increase air quality conditions and to guarantee the efficiency of these methods. Figure 5 presents the mapping of the monitored locations in the tests conducted. The numbers of Figure 5 represented the exact location where the CO 2 concentrations were measured. The details regarding the latitude, longitude, CO 2 level and time of the data collection are presented in Table 3.  On the other hand, real-time data assessment allows us to conclude that typically the air quality is under demanded standards. The data collected during the tests conducted states that under certain conditions and during some specific times of the day, air quality levels can be very different from healthy standards. Real-time air quality monitoring methods combined with the use of mobile computing technologies for data consulting, increase the population's attention to the critical air quality problem and supports them to preserve healthier environmental conditions. Air quality sensing is a relevant requirement for enhanced public health and well-being. Consequently, the design and development of new cost-effective methods for air quality monitoring based on open-source and mobile computing technologies are a trending research theme. Table 4 presents a summarized comparison review of the air quality supervision solutions described above.  On the other hand, real-time data assessment allows us to conclude that typically the air quality is under demanded standards. The data collected during the tests conducted states that under certain conditions and during some specific times of the day, air quality levels can be very different from healthy standards. Real-time air quality monitoring methods combined with the use of mobile computing technologies for data consulting, increase the population's attention to the critical air quality problem and supports them to preserve healthier environmental conditions.
Air quality sensing is a relevant requirement for enhanced public health and well-being. Consequently, the design and development of new cost-effective methods for air quality monitoring based on opensource and mobile computing technologies are a trending research theme. Table 4 presents a summarized comparison review of the air quality supervision solutions described above. Regarding the systems presented in Table 4, the proposed method incorporates several advantages. Compared to the architecture proposed by the authors of [82], which is based on wireless sensor networks (WSN), the proposed method eliminates the necessity to configure the sensor nodes and gateways. Moreover, the proposed system supports easy installation as it is only necessary to configure the BLE communication between the cyber-physical system and the mobile device. Furthermore, the proposed method provides air quality measurement and mapping. The geographical location of the monitored data leads to a significant advantage as it is possible to track the air quality evolution on the move. This system can be installed outside vehicles to monitor air quality while travelling. This functionality is not incorporated in any of the methods described in Table 4 as none of the systems support portability. The proposed system is based on the ESP32 microcontroller. First, the ESP32 supports Wi-Fi, BLE and LoRa communication technologies. Second, this microcontroller supports 240 MHz of clock speed which contrasting with the 16 MHz of the Arduino [79] and the 80 MHz of the ESP8266 [63,64,80].
The air quality supervision conducted in most places is based on random sampling using high-cost professional equipment. Nevertheless, the information collected by those kinds of systems is limited as they are devoid of spatiotemporal behaviour. The air quality monitoring systems presented by [124][125][126][127][128] are portable and incorporate information storage on the device itself but do not support real-time data consulting features or mobile computing compatibility. These portable solutions have high-cost and require specific procedures using proprietary software to extract the data collected for further analysis and visualization. Table 5 presents a summary of the portable solutions available in the market.  [126] 0-4000 1 ±5% of reading 302.78 ROTRONIC CP11 [127] 0-5000 1 ± (30 + 5% reading) 373.39 Extech CO230 [128] 0-9999 1 ± (50 + 5% reading) 239.00 The solutions presented in Table 5 provide portability features; however, the data collected cannot be consulted in real-time to be consulted by the authorities to support decision making on possible interventions for enhanced public health. These solutions present accurate relative readings and efficient sensor range and resolution. The maximum sensor error value depends on the sensor measurement range since the accuracy of the sensor is directly influenced by the sensor reading value. Considering a CO 2 concentration of 1000 ppm, the maximum error value is 50 ppm VOLTCRAFT CM 100 [126]; is 80 ppm for the DZSF AR8200 [124], Reeseiy CO2 [125] and ROTRONIC CP11 [127]; and is 100 ppm for the Extech CO230 [128]. In the worst-case scenario, the maximum error value is 200 ppm for the VOLTCRAFT CM 100 [126]; is 280 ppm for the ROTRONIC CP11 [127]; 530 ppm for the DZSF AR8200 [124] and Reeseiy CO2 [125]; and is 550 ppm for the Extech CO230 [128]. However, the proposed solutions available on the market require data extraction and classification procedures before can be analyzed. Accordingly, the design of a portable air quality monitoring methods based on state-of-the-art open-source technologies that provide real-time data sharing and spatiotemporal information is essential to promote public health.
Therefore, the method proposed by the authors is a reliable and effective solution for real-time air quality systems which combine portability, scalability and modularity features as essential benefits related to current solutions. The selection of the sensor was conducted, taking into consideration the accuracy and cost of the system. The principal objective of the study was to validate the IoT approach. Consequently, the focus of the research was the design and development of portable real-time data acquisition system for air quality measurement and mapping. The CO 2 sensor was chosen because this type of gas can be used for both indoor and outdoor air quality assessment. Moreover, the CO 2 data can support clinical analysis conducted by health professionals. In the future, air quality sensing will be incorporated in every living environment as it allows an accurate validation of healthy living environments for enhanced public health and well-being.
The proposed method can be used to monitor the air quality inside vehicles on the move to create a dataset which will be relevant to identify poor air quality scenarios in particular locations and often to better understand the effect and implications of the outdoor air quality parameters on the vehicle's occupants. In particular, air quality monitoring is of utmost importance in public transports due to the number of occupants and also the ventilation methods used in this kind of vehicles. The proposed system can be easily installed inside public vehicles to perceive the IAQ, considering not only the location of the vehicle but also the number of occupants with reference to the spatiotemporal information. This data will open a relevant discussion to the quality perceived inside public vehicles at specific hours of the day and promote policies to promote public health.
Based on the results achieved the proposed method can be assumed as an effective method for real-time air quality assessment. Moreover, air quality data can be investigated to detect poor air quality patterns for effective intervention planning in smart cities. Furthermore, these data can be used to correlate the identification of multiple defective situations with the population's habits and behaviours that reduce air quality. The principal objective of the presented system is the creation of a practical tool kit to guarantee and cost-effectively promote air quality standards. This solution provides a relevant dataset to support interventions and can be used for clinical decision support. Air quality data can be used to support medical reports because it is possible to correlate the health complications of specific groups of people who share the same living environment with the location air quality data.
Nevertheless, the main limitation of the proposed method is associated with the main challenge of the standard GPS systems and relies on the post-processing of the GPS data. In most indoor environments, it is not possible to collect GPS data when the satellite signal is down. However, the use of mobile technologies brings a significant advantage since it is possible to get using the Internet provider when GPS data reception fails. Furthermore, the proposed method has limitations associated with the sensors used. The main limitations of the air pollution sensor employed in this study are related to its preheating and response time.

Conclusions
IoT, AAL and mHealth research fields contribute to the design and development of enhanced architectures for smart living and public health. Moreover, the relevant capabilities for sensing and connecting provided by mobile computing technologies provide an adequate structural base for real-time monitoring methods. This document has proposed a real-time air quality monitoring system based on IoT, which incorporates a cyber-physical system for data collection and mobile computing software for data consulting. This architecture makes possible the measurement and mapping of air quality levels considering the spatial-temporal information. The proposed method connects different technological fields as IoT, mHealth, AAL and mobile computing. Further, this solution provides a low-cost and efficient method for air quality monitoring and integrates a smartphone application for data access and enhanced data analysis. The main contribution of this paper is the proposal of a low-cost system which can be easily installed and configurated inside vehicles to monitor IAQ on the move. The proposed methods incorporate numerous benefits when associated with other supervision solutions such as modularity, portability, easy installation and configuration, as well as mobile computing technologies integration. The collected data can support the design of strategies and policies to increase air quality. The tests conducted confirm the implementation of the proposed architecture and present a relevant contribution to the air quality supervision systems available in the literature. However, the proposed method has limitations and needs additional experimental validation to increase sensor calibration and accuracy.
In the future, numerous improvements are planned to adjust this method to particular use cases such as the installation of the system on the exterior of public vehicles which are always moving around the city and can measure and map air quality in real-time. In this context, it will be possible to monitor the city air quality continually considering the geographical coordinates to create a relevant dataset which can be used to regulate traffic at specific hours of the day and promote public health. It is also planned to perform additional tests to evaluate the accuracy of the sensors with different types of technologies. Air quality monitoring allows the detection of unhealthy behaviours in real-time and should be incorporated in all living environments and be a fundamental part of the daily routine to promote health and well-being. The authors believe that architectures like the one proposed will provide ELE in smart cities.
Author Contributions: All authors were responsible for study design; acquiring, preparing, and analyzing data; and writing the original manuscript. All authors have read and agreed to the published version of the manuscript.
Funding: This research was funded by Basque Government grant SaludAIR and IT905-16.