Design of Smart IoT Device for Monitoring Short-term Exposure to Air Pollution Peaks

Air pollution spikes have been causing harm to human beings and the environment. Most exposure to Air pollution spikes has demonstrated a significant impact on mental health, especially children at an early age. That lead to suicide or depression. Previous research concentrated on air pollution in general. Existing monitoring systems do not consider Short-term air pollution peaks. This paper presents the co-design of the hardware and software for IoT to monitor air pollution spikes for a short duration in real-time monitoring. The system comprises two technologies like edge computing to capture shortterm exposure and a mathematical model for distribution in analyzing the captured data. This system ensures the presence of the spikes start and end for each pollutant. Monte Carlo simulation has been used in this research to predict the next spike of each pollutant. Artificial Intelligent is used to analyze immutable data for a short term prediction. After the analysis, legislators based on intelligent contracts created using blockchain to reduce pollution based on its source. Keywords—Short-duration air pollution peak/spike; real-time monitoring; short-term prediction; immutable data; blockchain; AI


I. INTRODUCTION
Air pollution is the silent, prolific and invisible killer from previous years [1]. Most existing systems for monitoring air pollution are measuring the long-term peaks. Instead, the research shows that the short-term peaks are perilous [2] and can lead to different diseases such as eye and adnexa [3], brain volume, cognitive decrements, dementia development [4], heart, chronic obstructive pulmonary disease (COPD), lung cancer, migraine, acute lower respiratory infections and stroke [5]. Air pollution is exposed to more than nine to ten children and is stunting their brains, affecting their health [6]. That leads to the problem of mental health, especially in children (brain cell inflammation). Short-term spikes of air pollution are the source of increased hospital visits for childhood psychiatric. And the research shows that children from low-income families are more affected, leading to an increase of 44\% of those who visited the hospital with suicidal thoughts due to the spikes in the air pollution [7] [8].
The spikes of air pollution have more severe effects on the brain of children. The research shows that air pollution spikes can cause mental health, depression, and anxiety. It can lead to the children having a lower intelligence quotient (IQ), poorer memory, delaying their development, leaving women infertile earlier, ..... Spikes affect brain chemistry differently; for example, industries and traffics may carry toxins using tiny passageways and then enter directly into the brain [7] . In 2020, spikes increased higher than five years [9]. But until now, minor effects of short-term exposure to air pollution are known.
Spikes of air pollution are damaging the future generation of humans, and emitters do not condemn the creation of that harm. Governments have tried to prevent air pollution in general, but the research shows that none of them has been viewing the spikes as a dangerous and long-lasting killer of children. The research suggested that legislators should protect children's' exposure to air pollution to advance the initiative for their public health [10].
This research paper is composed of the following section: The section of background covers all literature reviews related to the monitoring system of Air Pollution. The following section is about the co-design of hardware and software for the prototype monitoring of the spikes. The following section is about performance analysis and simulation, where the analysis made for some data and tools used to do simulation and the results shown in that section. The last section is the conclusion, which summarizes the paper and the proposal for future research.

II. BACKGROUND
This section highlights the background of the existing systems in monitoring Air Pollution. The section deeply explains the previous research and enumerates some challenges that are still in this area that can be solved using this research.
WHO has put the Global Air quality guidelines in different years to prevent air pollution in general, but there are no measures taken for spikes [11]. Many people are victims of air pollution, and emitters of pollutants are not charged for anything because none knows the air pollution they produce. Some measures have been taken [11], but they do not regularize the correspondence of emitters and victims of spikes. When these spikes continue to be repetitive, they cause more problems of health [12].
Many people are living in big and small cities. Developing countries used to have high populations exposed to air pollution. It is also where most sources of pollutants are found [13]. Once the spikes appear in the cities, it affects a large population [14]. Spikes can appear anytime, so this may come from different sources. If the spikes are not monitored, they can affect the living of human beings, as explained above. Spikes Partnership for Skills in Applied Sciences, Engineering and Technology (PASET) under the Regional Scholarship and Innovation Fund (RSIF). occur in a short time, and most existing monitoring systems for air pollution cannot recognize their appearance. Children are the most affected, primarily their mental, leading to their future loss [7]. Emitters of spikes may not even know how they affect human beings' health because there are no systems to monitor these spikes [15].
Authorities are oriented toward monitoring air pollution in general [16] [17]. Instead, spikes are affecting the future generation and the population as well. The source of spikes allows the identification of emitters, and then authorities may take advanced majors accordingly. Victims of these spikes are more in danger once they are repetitive. That may lead to many unexpected severe health problems.
The author of [18], proposed a system that can monitor the spikes from air pollution and predict the next spike using road management data.
Air pollution spikes have a short lifetime, requiring monitoring in a smaller time resolution [19]. These spikes need to be monitored at each appearance not to affect the living. Spikes need particular ways of monitoring them that differ from the existing methods. They appear in a short time, and then they disappear. If they do not monitor their appearance, they mix with other collected results of pollution and then may result in the average instead of the over-level for pollutants. Spikes monitoring can enable counting all spikes passed, predicting the following occurring spikes in the system. Once they occur from their sources, these unexpected pollutants may damage many things because they do not prepare before. They do not last for an extended period, leading to the big mess of not monitoring them. Spikes generated due to some occurred events planned before, but no analysis of the effect may cause. Also, spikes may occur due to unexpected events from the environment or any other source without any prior planning of the event. Spikes need a real-time and a low-time resolution to react to the effects that may occur due to its presence [20] [21], sometimes to the loss of life [22].
Most existing systems for monitoring air pollution are based on cloud-centric architecture [23] [24]. These systems measure air pollution with long term exposure. The average of peaks for air pollution in a specific time is considered the result of a monitored place. That is because of allowing sensors to capture information during a specific time and wake up to send the data on the cloud, known as duty cycle mode (taking a long sleep period to save the battery energy). That is for saving battery life during the wireless communication mode of sending data to the cloud. In the design of the sensor node of IoT applications, battery life is one of the critical parameters to consider. The reporting of collected data to the remote centriccloud architecture of air pollution has a low frequency for at least 1hour to extend the battery lifetime.
The centric-cloud architecture uses wireless communication for transferring data from sensors to the remote. That leads to high energy consumption, and the sensors are sleeping within a certain period of collecting data and storing them locally. That makes sensors monitor long-term average peaks instead of capturing all peaks [25]. That leads to the miss of monitoring short duration peaks. These spikes may appear periodically or not. The air pollution peak average threshold may exceed for specific pollutants, and the system may not be aware of that unexpected change. No system can capture spikes for a short duration from the existing cloudbased systems.
Cloud-centric has failed to monitor spikes because of transferring data by waking up the sensor. The cloud-centric architecture collects data of air pollution using sensors at data gathering. It uses wireless communication to send the data to the cloud [26,27]. Then, the system does the data management for the given application in the cloud. At the first phase of data gathering, sensors collect information related to air pollution. This information is transferred to the cloud through the wireless communication channel. This communication channel consumes high energy [28]. The last phase is data management, which analyses, processes, and stores data in the cloud. These data can be used to predict air quality [29].
The cloud-centric architecture also has a latency problem due to transferring the data after a specific time. These systems also take time to react to the processed data [30]. Predicting the possible air pollution event may take longer as data processing is based on the cloud, not on edge. There is a need for data transparency and trust, and this may be difficult for the data passing in the network without additional security measures.
Therefore, there is a need for an edge-centric system to monitor short-term peaks for air pollution. This paper helps to understand the design of the edge-centric smart sensor to monitor air pollution by waking up the sensor once the air pollution variation attained the given threshold.
There are not many several systems developed to monitor and predict air pollution spikes. Artificial Intelligence technology is the predictor developed by a new wireless company, and that system can predict the following levels of air pollution within an hour. This system uses AI for analyzing weather measurements, images of CCTV cameras, air pollution sensing devices, Bluetooth, and history readings. The system links the existing real-time data to predict the next coming hour for traffic jams and air pollution. This predictor is accurate at 97%. It has been tested for implementation in some cities like Wolverhampton [18]. It is excellent and friendly to the existing technologies, but it doesn't take pollutant data on the roads or nearby since it is linked to the load management system. And this leads to the lack of identifying the source of each pollutant and the quantity. The predictor predicts air pollution in general but doesn't identify spikes that come and may arrive.
Following the previous works that researchers have done, the existing systems only measure a few pollutants. Most monitor air pollution at the cloud-centric, leading to latency, security, cost, and control problems. The existing system woke up sensors periodically, leading to the danger of an unexpected increase of pollutants. Existing systems haven't mentioned the identification of spikes and the time stay based on their appearance level.
This research takes all six primary pollutants as explained by WHO in [11], and it can be installed and not based on historical readings. 18 | P a g e www.ijacsa.thesai.org

A. Improve IoT Energy Management
In designing the embedded system for performing a realtime environment, there is the issue of the increase of power dissipation. IoT hardware design increases power dissipation from the real-time application and the device for the best performance. The problem was created during the deployment of the number of transistors comparable with the power consumption. There are two causes of power dissipation in designing lower-power IoT systems. The first one is when the power dissipation for each transistor increases with impact to the increase of density gate, which implies the increase of power density for the whole system. The second is the increase of the frequency of IoT systems for better performance.
The power dissipation problem is improving IoT energy management by waking up the device using analogue interrupts.
Energy management is still a crucial problem in today's sensors [31]. There is a need to continuously allow the sensor to stay in energy-saving deep sleep mode to solve that issue. The system needs to wake up on measurement appearance with low energy consumption. Since the energy consumption implies a decrease in battery life, the system should monitor sensors connected to use little energy.
The system stays asleep most of the time and only wakes up for the threshold's quick and effective measurement. The CPU of the system uses much energy by comparison to the rest of the other parts. That means that reducing the CPU system's busy time is the best way to reduce consumption energy. Fig. 1, the system wakes up periodically to detect events, making the CPU continuously active. The sensors capture data from the environment and send these data for processing. The analogue event creates a signal which is transformed directly to a digital signal. Fig. 2 gives the intention to look at the signal after using analogue interrupts. The sensors can record all analogue events, and once the threshold passes, the system wakes up for recording and processing.
There are two options for using analogue interrupts: The first is ADC wake up and the second is an external op-ampbased voltage comparator.  1) ADC Wake up: Sensors convert analogue measurements into electronic signals. The ADC (Analog to Digital Converter) converts the produced analogue signal to a digital signal using the frequency sampling mode based on the Nyquist theorem. Interrupts that are alerting electronic signals are sent to the Microcontroller Unit (MCU) processor, which may come as an external part of the internal peripheral or external one.
The below is an ADC component designed using the Proteus simulator. The ADC is composed of one ADC0804 Integrated Circuit, eight LEDs, one resistor of 1k, one variable resistor or potentiometer, one push button, one wero board, one nonpolar capacitor with 150pf and some jumper wires. This proteus simulation designs system that switches ON and OFF based on the voltage once the input exceeds the threshold. Then, it helps to monitor all events that come and exceed the threshold. That is useful in air pollution monitoring based on spikes only. Fig. 3 uses the button to switch off the ADC. The button is activated by the measurement to the node sensor for air pollution. The input signal is an analogue signal generating the output that can switch on LEDs. Fig. 4 shows that the data are generated from the physical environment, and then the sensor accepts these analogue measurements in the form of analogue signals. The analogue signal transforms into a digital signal and is then sent to the processor. At the input, the environment creates a signal using physical quantity. Then sensor takes that signal and makes it in the presence of an electrical signal. The signal is in analogue form and needs to transform into digital form, and then using the ADC tool; it generates the digital signal used to monitor air pollution using the given threshold.
This paper applies the sampling of analogue signals, and the system acts based on the threshold. That should be done using ADC to trigger timers precisely. That uses many MCU resources, which leads to high-power consumption since timers must be active to perform ADC. Another methodology is not to use timers and allow signals to be monitored continuously by the ADC, which consumes a high-power consumption.   The solution to be adapted that may not consume huge amounts of power is to integrate ADC in the MCU without dependency on the CPU (Central Processing Unit). That allows the CPU to disable all clocks except the one of ADC. Then the ADC wakes up the CPU and other parts of the MCU by using the logical conditions. The ADC creates interrupts to wake up the rest of the system by referencing the configured threshold.
The ADC wake up uses the voltage comparator to activate the CPU and the system. The reference voltage V ref is compared to the input voltage Vin for deciding to wake up the system or not. The V out is in digital mode, and from there, the decision to wake up the system is taken. Since that is on the sensor by detecting the measurement of the event to wake up the system, there is the optimality of this strategy because no loss of data appears and the optimization of the sleeping time.

2) External op-amp based voltage comparator:
The other way to wake up the system is to use an external operational amplifier based on the voltage comparator. This way requires extra resources to add to the system. And adding this wake-up circuit to the sensor node decreases the average power consumption, but also it may create the loss of information since the original signal was amplified.
The external op-amp compares one analogue voltage level to another and generates output based on the comparison. It detects the voltage from measurements and then switches from the sleeping mode of the system to an active mode. The switching time of the op-amp voltage comparator slows the system even though it operates on analogue voltage.
The op-amp voltage comparator uses input, amplification, and output terminals. It uses negative feedback voltage, which leads to compensation capacitance to prevent oscillation in that integrated circuit. That creates an inside power dissipation, which may increase the temperature for the chip and the selfheating.
The operational amplifier voltage comparator may present an error voltage called the input offset voltage caused by the characteristics of transistors of each terminal or by the input bias current. Therefore, based on the above comparison of ADC wake up and external op-amp voltage comparator wake up, this paper suggests using ADC wake up to activate the system from the sleeping mode to active mode. The measurements are taken from the environment and create analogue input to the sensor node, and that analogue input changes to an analogue signal with a certain amount of voltage. Then the analogue signal needs to transform into a digital signal using an ADC converter, and during that conversation, the ADC decides if it wakes up the whole system based on the comparison of the input voltage and the reference voltage. The system needs to identify the starting voltage above the threshold voltage and record these values. The following subsection explained how the system used to pick these signals that attained the threshold.

B. Peak Digital Signal Processing
Measurements captured from the environment need to be processed and analyzed. Once the ADC wakes up, it gets an analogue signal and converts it to a digital signal, quickly processing scientifically. The system is woken up based on the data that exceed the predefined threshold, allowing the system to record that event.
This research is working on air pollution spikes. These spikes are identified based on the minimum predetermined value of pollutants. WHO has defined each pollutant's threshold as shown in Table 1. These values are measured in micrograms per cubic meter.  This research detects a peak in a signal and measures its position, height, width, and/or area. When the sensor node identifies the signal that exceeds a threshold value of any type of pollutant, the system starts to record the event, and when it attains the peak, it starts to decrease, going to the value which should always be less than the threshold. The first derivative of the peak is applied to downward-going zero-crossing (threshold) at the maximum of the peak. Since the signal may have noise from measurement due to the environment, this can lead to false zero-crossing. Therefore, the smooth technique can detect only the desired peaks and ignore peaks that are too small, too wide, or too narrow.
Once they become high frequency, air pollution spikes (peaks) cause mental health problems that can lead to hypertension, suicide, and heart diseases. These peaks imply the concentration of pollutants in respect of the given time. If not reduced, that concentration cause health problems compared to normal pollutants that don't pass the threshold.
The input signal is taken in the window size measured based on the length of the signal above the threshold. The height of that signal is also identified.
The digital signal processing from ADC is set low or high. We examine all signals with high since they are above the threshold. Signals which are less than the threshold are identified as low. Then finding the peaks in the given signal that we can call X describes all points above the threshold. Each peak has its amplitude or the height of the signal.  From the input signal of the sensor node, ADC wakes up activates the system once the peak has appeared. The probability of obtaining a peek at a particular point t i of the input signal from the environment depends on its incoming voltage and the given standard threshold voltage t v .

P(Spike at tR i | Spike at tR
With C i , the set of possible voltages can rise in the interval i. V presents the voltage signal. And G[V(t)] is the Gaussian distribution.
Once peaks are detected from the given interval time and their location, the system is applied to collect these peaks. These peaks are stored in the array of integers for future analysis using Machine Learning. The system can analyze the collected peaks for notifying the appearance of pollutants and the expectation of the next peak.

A. Distribution Patterns of Air Pollution Spikes
Air pollution spikes are coming from the increase of unexpected pollution generated by emitters. All these spikes are from the environment and can be distributed in the atmosphere. The system for monitoring spikes can capture distributed pollutants either directly or indirectly from the source.
Direct spikes are captured by the system and then analyzed without adding the environment to it and for example, having the sensor node connected to the place generates pollutants. The indirect spikes are those that pass in the environment and meet with other pollutants before being measured by the system.
The system accepts measurement in any of three patterns or their combination. Spikes can be presented to the system either: uniform random and/or clumped.
Uniform spikes are these spikes that come within a given period. They occur periodically in the system. These spikes are easy to predict the next peak. These peaks can appear in different sizes and densities.
Random spikes are these peaks that are entered into the system randomly. These peaks can be very harmful since they are not easily predictable. This research suggests using a certain period to analyze all peaks appearing, and then using Machine learning, and it can predict the next peak.
Clumped spikes are predicted or unpredicted peaks with a heavy density. These peaks are perilous, and they need profound observations to analyze their prediction.
The nature of the air pollution environment can have all these above patterns of distribution of spikes. All these spikes are based on the period to predict the next appearance of the peak.
The distribution model has been used to predict the next within a specific period. Since the generated signal from the ADC wakes up converter is a digital signal, it has discrete values. The Poisson distribution is used in this paper to model the arrival rate of spikes in a specific fixed interval of time. 21 | P a g e www.ijacsa.thesai.org The performance parameters are based on the mean of signals in a period λ and the number of spikes k.
Let λ be the parameter greater than 0 and let distribution k = 1,2,3, … n be the appearance of spikes in the input signal to the sensor node; in other words, k is presenting a discrete random variable counted. The probability density function (pdf) is used to specify the random variable's probability being in the range of the values.
Then the pdf that a Poisson random variable X with the mean λ is equal to a given by the formula.
Where e is a constant approximately to 2.71828.
The pdf gives the probability of getting spikes each time by using the mean of the spikes and the number of spikes counted.
The system can identify spikes and predict finding peaks in the given time. Most existing systems for monitoring air pollution are using cloud-centric duty cycle mode. The sensor collects data related to air pollution while it is in sleeping mode to save the battery's lifetime or the harvested power for energy conservation. The sensor only wakes up after a specific period to transmit collected data to the cloud-centric for the analysis.
The duty cycle D can be defined as a ratio of pulse width (PW), a busy time and the total period of T of the signal and then expressed in percentage.

= × 100
Therefore the 60% duty cycle means that the signal is on 60% of the time but off 40%. That implies the power consumption in recording data. There is a need for much energy during the transmission of the data to the cloud-centric server. This energy consumption reduces the sensor battery lifetime or the harvest power storage of energy.
The solution of optimizing the use of sensor energy or harvest power is edge centric HW/SW Codesign smart sensor. That allows the analogue interrupt to wake up the sensor once the coming signal voltage is higher than the threshold voltage.
Only the system is active in collecting spikes for quick analysis of data. Once the spikes are over, the intelligent sensor goes back to sleep mode.
The above Fig. 7 describes the edge centric HW/SW codesign system. The measurement from the environment is those pollutants CO, CO 2 , PM 2.5 , PM 10 , SO X and NO X . Once one of these pollutants sends the value more significant than the threshold defined in the table [1], the sensor node will send all signals to ADC, which wakes up the processor, memory, protocol for analyzing the coming signal since it is a spike. The power unit is there to empower each device. That reduces the power consumption since it is waking up for recording spikes.
In edge centric HW/SW co-design, data analysis is performed locally, and there is no transmission energy of short periodical time. Only transmission can be once in a while for further analysis. The edge-centric smart sensor is a real-time monitoring system for air pollution spikes and can react to its appearance. From those spikes, it does analysis locally, and the decision is taken quickly.
The cloud-centric is still needed to analyze big data collected by sensors, while edge centric can be considered an operator of instant data. At the edge, centric analytical tools and AI tools are nearest the system, implying operational efficiency. The security and privacy are strong at the edge centric smart sensor. This system is reliable. Since one node can go down and is unreachable, the other system parts continue to operate. The speed of data at edge computing implies analytical, computational resources to the end-users, bringing quick responses and applications.

B. Performance Metrics
The energy consumption at the edge centric HW/SW codesign smart sensor and cloud-centric can be distinguished in the below metrics: • Throughput: output at the edge is generated in real-time while data is transmitted in the cloud, which consumes much energy.
• Collecting data: at this stage, edge computing uses to wake up only during the collection of spikes while the cloud uses a duty cycle which implies power consumption.
• Processing: at computing only, the system wakes up on the threshold, while the CPU and other parts of the system operate periodically for cloud-centric-the probability of identifying the subsequent spikes at edge computing within the length of the interval of spikes.
From Table 2, the designed system performs better in all performing metrics. The designed system can save energy consumption at 40% on the throughput metric since the existing systems (mostly cloud computing systems) are using a duty cycle. On the second metric of data collection, the designed system woke up on the appearance of spikes, and that can lead to quickly identifying the spike while the existing systems wake up periodically and can miss some spikes, which may be dangerous. Lastly, the processing metric is so quick at the designed system while existing systems take enough time to process and predict the next appearance of the spike for air pollution.  Peaks can be harmful to human beings, and there is a need to monitor them. For cloud computing, some peaks may be lost during the sleep mode of the sensor at the sleeping mode of the sensor. At the sleeping mode of the sensor, all peaks arrive and can be combined with the whole signal for presenting the mean of the whole period. On edge centric, the system is woken up by spikes in the input signal.

C. Monte -Carlo Simulation
This research uses Monte-Carlo simulation as a mathematical technique used to estimate the probability of possible outcomes in a process that cannot be predicted due to its uncertain appearance.
It is based on making a computational algorithm to find the numerical results of repeated random sampling. These uncertainty events can be predicted and forecasted using the Monte-Carlo technique to model them.
This research uses Monte-Carlo simulation to predict the subsequent spikes using their probabilities of occurring. As our data are stored discretely after the ADC converter, we estimate the probability of occurring in a specific period.
Let's use the same example of PM2.5 for its Poisson distribution, which was 7.1%. Then that means in the interval of a period there is a 7.1% probability to find the spikes of PM2.5. The figure below is for particulate matter data; and it uses the synthetic data generated mostly.generate. The mean λ of the data is 29, and the appearance of spikes is 27. Then the probability of getting the spikes is 0.071.
The performance of the proposed system has good accuracy since it can identify each appearance of the spike of each pollutant. Most other existing systems measure air pollution in general and are not specific on spikes prediction of each pollutant.
The signal length is sampled at 30 samples for the whole period, and the probability of finding the next peak of PM2.5 is 7.1%, as shown in Fig. 8.

V. CONCLUSION
This research designs a hardware-software smart IoT device to monitor short-term exposure to air pollution peaks. Spikes are causing significant health problems, especially children, leading to mental problems, suicide, stroke, heart diseases, lung, etc. This research improves the IoT energy by waking up the system through the appearance of digital signals using ADC wake up. The designed system performs better than the existing system through the performance metrics, as explained in Table 2. The paper explained the finding of peaks that are stored in the array. The mathematical model was generated using Poisson distribution to find the appearance of peaks. Monte-Carlo has been introduced to predict the next coming peak. The prediction showed that PM2.5 could be predicted at a 7.1% probability of the spikes to appear. This probability is high since it showed that in the appearance of spikes, there should be a 7.1% of PM2.5.
The system and authorities analyze the collected peaks to compensate for the peak emitters. As peaks are dangerous to health, there should be a proposal of fining people accordingly if they exceed the threshold. The hardware-software co-design generates a dataset of spikes signature that will be used by machine learning for future research. In future works, this research will be oriented on the security of the data transmitted across the network using blockchain. 23 | P a g e www.ijacsa.thesai.org