Air-MIT: Air Quality Monitoring Using Internet of Things

: In both developed and developing countries, air pollution is increasing daily, compromising the air quality index and causing harm to everyone. Some of the reasons for this rapid increase in air pollution include the growing population, rising number of industries, rapid urbanization, and excessive use of fuel-consuming transportation. Hence, there is an ever-increasing need to monitor air quality using an energy-efﬁcient, ubiquitous and connected manner. In this paper, we are presenting the design, working, and results of our device named Air-MIT, which is an air quality monitoring device, which uses the Internet of Things (IoT) to populate and upload data securely to the cloud server. We have developed a low-cost IoT-based air monitoring system capable of detecting carbon dioxide (CO 2 ), Carbon Monoxide (CO), methane gas (CH 4 ), Ammonium (NH 4 ), with the provision of adding more sensors capable of detecting other harmful gases and particulates in the air as well. The system has been designed to monitor indoor air quality in real-time and to trigger an alarm if any one of the readings crosses the predeﬁned threshold. The device also has the provision of turning on the exhaust fan in the house or kitchen to clear out the air and ventilate the space to minimize the exposure of harmful gases, resulting in avoidance of any accidents or ﬁres.


Introduction
The paper presents a network of indoor air quality monitoring systems, fire alarms, and the prevention of accidents due to gas leakage.This portable device has embedded sensors that can be mounted at houses, malls, hospitals, garages, and industries.This is an IoT-based project.
In recent days, air pollution has reached alarming levels in Pakistan especially in metropolitan cities According to the Ministry of Natural Resources and Environment, there are a lot of factors that add to pollution.For instance, emissions from vehicles, development projects, industries, forest fires, power generation increase the concentration of CO 2 [1].Air pollution greatly affects human health and leaves a significant influence on industry workers and the people around them.Numerous harmful gases affect the air quality and make it unsafe to breathe in.Also, there are some gases like methane gas that can cause major accidents if not eliminated or at least detected at the correct time [2].In Pakistan, industries are more focused on equipping the fire extinguisher detectors rather than the air monitoring detector.Focusing on an individual's health is also very vital because this type of minor negligence leads to severe health concerns and sometimes even death.
Numerous gases are harmful to one's health and unable to detect by human senses.Hence, it is immensely important to keep the air pollution levels checked, specifically in the urban areas.To execute this plan, we will need to develop an air pollution detector [3].We sought a model that could detect the degree of pollution.We designed the prototype of an IoT-based air pollution detector to supervise or observe the increased air pollution levels.IoT has a vast application in today's smart world.It helps in connecting everyday elements to the internet where computers allow us to use and exchange data with very little interference from humans.One of the important applications of IoT is natural environment detection.A record of the surroundings and environment is the most important aspect of human life.IoT has caused numerous evolutions in technology like cloud and machine learning.Not just this, IoT is helping us with making improvements in processes for environment monitoring, health improvement LCD, and other fields related to human well-being [4].
Back in time, detection of pollution was a difficult task but nowadays with the help of IoT-based technologies, it is easy to detect and find solutions to rising pollution enabling people to take safety measures at least in confined spaces [5].Multiple IoT-based devices in the market are purely dedicated to environment monitoring like air quality and concentration measurement of gases.These sensors along with IoT applications create a marvelous environment for better surroundings [6].The IoT-based Air Pollution Monitoring System analyses the air quality through the internet and will trigger an alarm if the air quality drops below a particular threshold, indicating the presence of dangerous gases such as CO 2 , smoke, alcohol, benzene, NH 3 , CH 4 , and LPG.The system will display the air quality in per million on the LCD and webpage enabling easy monitoring.Moreover, the fan will also switch on to clear the pollution in the room.
The model is not very high priced and can be easily deployed in every industry, covering lesser space.In this model, with the aid of NodeMCU ESP8266.NodeMCU ESP8266 12E is a microcontroller used for IoT applications.NodeMCU gives the ability to openly perform editing, modification, and rebuilding of project programs and functions through different programming environments [7].We are remotely measuring the air quality.The threshold level is set, and once the air pollution level escalates to the threshold level, it will be notified on the web app, and things will proceed further to get rid of the excessive pollution.

System Model
The system is designed by using hardware components operated by software and programming tools that are discussed below.

Hardware Components
The hardware components used in the system is NodeMCU as a micro-controller (see Figure 1).NodeMCU gives the ability to openly perform editing, modification, and rebuilding of project programs and functions through different programming environments [7].MQ series gas sensors include MQ-7 to detect carbon monoxide [5], MQ-4 to detect methane [6], MQ-2 to detect smoke and LPG [7], MQ-137 to detect ammonia gas, and MQ 135 to detect overall pollutants [8].These sensors detect gasses like Methane, CO, LPG, and overall air quality.MQ Series Gas Sensors are composed of micro-AL 2 O 3 ceramic tubes, Tin Dioxide (SnO 2 ) sensitive layer, measuring electrodes, and heater, which is fixed into a crust, composed of plastic and stainless steel net [9].MG-811 gas senor to detect carbon dioxide is used from MG series sensors.This sensor has a rapid response and recovery characteristics with low-temperature dependency and humidity [10].

Software Components
Arduino IDE is used to program NodeMCU to run the system.It is a platform used for compiling and uploading programs to the microcontrollers.It is exceptionally userfriendly and easy to use; therefore, even non-specialists can use it.This platform supports C and C+ [13].Also, ThingSpeak to show the graphical results and PushBullet for ADS1115 is used to convert analog inputs into digital.On the single input pin in NOdeMCU [11,12].On the output side of the microcontroller, an LCD, exhaust fan, and a buzzer are connected for alarming and alerting about the rising air pollution level.

Software Components
Arduino IDE is used to program NodeMCU to run the system.It is a platform used for compiling and uploading programs to the microcontrollers.It is exceptionally user-friendly and easy to use; therefore, even non-specialists can use it.This platform supports C and C+ [13].Also, ThingSpeak to show the graphical results and PushBullet for notification purposes is used, and our own created Web App is used to collect data from both apps and present it on one platform.Figure 2 shows the connectivity between the application and the hardware.

Software Components
Arduino IDE is used to program NodeMCU to run the system.It is a platform used for compiling and uploading programs to the microcontrollers.It is exceptionally userfriendly and easy to use; therefore, even non-specialists can use it.This platform supports C and C+ [13].Also, ThingSpeak to show the graphical results and PushBullet for notification purposes is used, and our own created Web App is used to collect data from both apps and present it on one platform.Figure 2 shows the connectivity between the application and the hardware.

System Design
This project's methodology comprises investigating the rising air pollution levels in a specific environment.To precisely detect the gas level at each site or area, the deployment of different types of sensors has been made necessary.Different sensors have been connected to the microcontroller with the help of ADS1115.Each sensor measures analog values of different pollutants and the real-time data from the sensors is being processed and delivered to the microcontroller via ADC for further processing.After processing NodeMCU will send the sensor readings to the Internet and LCD connected to the microcontroller.ThingSpeak is used as a medium to read the results from NodeMCU.As long as NodeMCU connects to the Internet, the result readings can be monitored every time.We have integrated our sensors with NodeMCU using IoT.
Once the system starts, NodeMCU configuration of IP of the network takes place.It then collects data from the sensors via the ADC controller and sends it to ThingSpeak and LCD.Then it checks for the threshold value.If the detected value is greater than the assigned threshold then it will turn on the fan and the buzzer otherwise it will restart the process.
Moreover, our web application collects data from ThingSpeak to display it in a proper format along with the warning notification and records (insights).A buzzer is connected to the D4 pin of NodeMCU for alarming purposes.A relay is connected to the D6 pin of NodeMCU, which operates the fan once the threshold is reached.The flowchart below describes the pictorial representation of the hardware and software development approach.Figure 3 shows the system design flowchart.

System Design
This project's methodology comprises investigating the rising air pollution levels in a specific environment.To precisely detect the gas level at each site or area, the deployment of different types of sensors has been made necessary.Different sensors have been connected to the microcontroller with the help of ADS1115.Each sensor measures analog values of different pollutants and the real-time data from the sensors is being processed and delivered to the microcontroller via ADC for further processing.After processing NodeMCU will send the sensor readings to the Internet and LCD connected to the microcontroller.ThingSpeak is used as a medium to read the results from NodeMCU.As long as NodeMCU connects to the Internet, the result readings can be monitored every time.We have integrated our sensors with NodeMCU using IoT.
Once the system starts, NodeMCU configuration of IP of the network takes place.It then collects data from the sensors via the ADC controller and sends it to ThingSpeak and LCD.Then it checks for the threshold value.If the detected value is greater than the assigned threshold then it will turn on the fan and the buzzer otherwise it will restart the process.
Moreover, our web application collects data from ThingSpeak to display it in a proper format along with the warning notification and records (insights).A buzzer is connected to the D4 pin of NodeMCU for alarming purposes.A relay is connected to the D6 pin of NodeMCU, which operates the fan once the threshold is reached.The flowchart below the pictorial representation of the hardware and software development approach.Figure 3 shows the system design flowchart.

Results and Discussion
We tested out the project in a highly polluted and highly crowded closed environment in the metropolitan city, and results suggested that the air there is unhealthy.Data was sent to ThingSpeak by the nodeMCU; it was then collected by the web application that we created, the comparison was made against the range of pollution levels stored, and then it was declared whether the air was healthy, unhealthy, or hazardous.We were able to acquire data from all the sensors but are discussing the findings of some of them in the subsequent paragraphs.
Figure 4 shows the comparison between Smoke, CO2, and NH3 emissions (sensed by MQ2, MQ7, MQ137 sensors) in the targeted environment when the system is initialized.The data has been recorded over a long period of 1400 minutes.We emulated a house fire after which, as can be seen from the figure, during that time of the fire, the emissions rise with a rise in ambient temperature.As a result, the buzzer started to ring, and the exhaust fan is turned on.After turning on the exhaust fan, the concentration values and ambient temperature decrease due to the dispersion of gases, as evident from figure 4.
Figure 5 depicts the detection of overall Air-Quality in a highly polluted and crowded environment.As evident, over the time where we have emulated a small fire, there is a rise in the air pollutants (sensed by the MQ135 sensor).

Results and Discussion
We tested out the project in a highly polluted and highly crowded closed environment in the metropolitan city, and results suggested that the air there is unhealthy.Data was sent to ThingSpeak by the nodeMCU; it was then collected by the web application that we created, the comparison was made against the range of pollution levels stored, and then it was declared whether the air was healthy, unhealthy, or hazardous.We were able to acquire data from all the sensors but are discussing the findings of some of them in the subsequent paragraphs.
Figure 4 shows the comparison between Smoke, CO 2, and NH 3 emissions (sensed by MQ2, MQ7, MQ137 sensors) in the targeted environment when the system is initialized.The data has been recorded over a long period of 1400 minutes.We emulated a house fire after which, as can be seen from the figure, during that time of the fire, the emissions rise with a rise in ambient temperature.As a result, the buzzer started to ring, and the exhaust fan is turned on.After turning on the exhaust fan, the concentration values and ambient temperature decrease due to the dispersion of gases, as evident from Figure 4.

Conclusions
In this paper, we have presented the results of a air quality and hazardous pollutants monitoring system using IoT.We have developed the hardware composed of NodeMCU and have incorporated a range of sensors capable of detecting and gauging various kinds of hazardous gases and pollutants.Such a system can be further improved to make marketable product.

Conclusions
In this paper, we have presented the results of a air quality and hazardous pollutants monitoring system using IoT.We have developed the hardware composed of NodeMCU and have incorporated a range of sensors capable of detecting and gauging various kinds of hazardous gases and pollutants.Such a system can be further improved to make marketable product.

Figure 2 .
Figure 2. Connection between Application and Hardware.

Figure 2 .
Figure 2. Connection between Application and Hardware.

Figure 3 .
Figure 3. Flow chart of system design.

Figure 3 .
Figure 3. Flow chart of system design.

Figure 4 .
Figure 4. Comparison between Ammonia NH3, CO2, and Smoke in a highly polluted and highly crowded environment.

Figure 5 .
Figure 5. Detection of overall Air-Quality in a highly polluted and crowded environment.

Figure 4 .
Figure 4. Comparison between Ammonia NH 3 , CO 2 , and Smoke in a highly polluted and highly crowded environment.

Figure 5
Figure5depicts the detection of overall Air-Quality in a highly polluted and crowded environment.As evident, over the time where we have emulated a small fire, there is a rise in the air pollutants (sensed by the MQ135 sensor).

Figure 4 .
Figure 4. Comparison between Ammonia NH3, CO2, and Smoke in a highly polluted and highly crowded environment.

Figure 5 .
Figure 5. Detection of overall Air-Quality in a highly polluted and crowded environment.