Você está na página 1de 42

CHAPTER 1

INTRODUCTION

Air quality refers to the air condition in our environment. The good air quality refers
to air with clean and free from pollutants such as smoke, dust, and smog among other
airborne gaseous impurities. When air pollution reaches high concentrations, people's
health, crops, wildlife and natural resources are threatened. A person inhales about
11,000 litres of air each day on average, and the presence of contaminants in this air
can negatively affect the health of individuals. Natural or man-made sources can
degrade air quality. Air pollution's health effects are severe, one-third of stroke, lung
cancer and heart disease deaths are caused by air pollution. It's difficult to ignore air
pollution, because it's all around us. Subatomic air pollutants can slip past the defences
of our body, penetrate deep into our respiratory and circulatory system and damage
our lungs, heart and brain.
Air pollution occurs when harmful substances including particulates and
biological molecules are introduced into Earth's atmosphere [1]. Human taking breathe
over 3000 gallons of air in each day [2]. Vehicles responsible for 65% of pollutant,
stationary source produce 21 % and area sources contributes 14% of pollutions [3].
Which contain dangerous substances, such as LPG gas, smoke, carbon monoxide, and
methane [4]. Harmful gases affect human wellness and can induce lung cancer or
chronic heart disease even though in indoor environments [5]. Several studies showed
that people spend up to 90% of their time in enclosed environments such as offices,
schools, homes, and shopping malls where air can penetrate easily [6]. Air pollution is
accountable for the death of 7 million persons worldwide each year or one in eight
premature deaths yearly [7]. Harmful effects of pollution include bronchitis, heart
2

diseases, pneumonia, lung and aggravated asthma [8]. So, the authorities need to keep
action and prevent the course before it got worse especially in urban area. Furthermore,
the crowded high constructions and heavy transport also prevent the dispersion of air
pollutants [9]. By creating a product can exchange the data frequently, the authorities
can monitor through wireless system to view the pollution level [10].
This final year project, the development of Air quality Monitoring System
based on IoT (Internet of Thing) that uses the Internet to monitor pollution levels on a
web server and software applications for ease to access and more user-friendly. Based
on MQ135 sensor, which is the best option for air quality monitoring as it can detect
the most harmful gasses and can accurately estimate the amount. Public can monitor
the level of pollution from just about anywhere using your computer or mobile in this
IoT project. Ease to deploy this system anywhere and while trigger a certain medium
to alert the public if pollution goes beyond a certain level.

1.1 Problem Statement

The air quality was essentially in human daily and also planet earth. There many
problems came along with air pollution which can cause death for human in certain
situation. The problem came with the observing the air itself which futile because of
nature of air that can’t be seen by naked eyes. To help the human limitation, the
technology to keep track the pollution in air need to develop. There was various project
that can detect the unwanted gas in air but it still not efficiency and convenient enough
for human to analyse it. There was also no effective way to warn the people when the
air quality was drop for public to prepare. The current technology with the concept IR
4.0, IoT concept can simplify the process of monitoring the quality of air.

1.2 Project Objective

The project’s objective is:


i. To develop a product which more mobility and efficiency to monitoring the
air pollution.
ii. To build IoT air quality monitoring device along with Industrial Revolution
4.0 technology that is light and easy to carry.
3

iii. To find the best method and most effective way to deliver the warning message
about the air condition to the public.
iv. To analyse developed system performance through experiments and testing.

1.3 Project Scope

This project will be using the standard level of Air Pollution was based on API in
environment for several places. The scope for this project is:
i. The hardware was based on NodeMCU ESP8266 Wi-Fi module and MQ135
gas sensor that monitor the air quality of study area.
ii. This product will implement the technology of Internet of Thing (IoT) using
the bases Platform, Blynk software.
iii. The study also analyses and find suitable way to use of social media, Twitter
account as a medium for delivering the message to alert about the air
condition.
iv. The air pollution consists multiple level of air particle such as harmful gas
material which can be tested during operation on multiple spot.
CHAPTER 2

LITERATURE REVIEW

The literature review will cover some aspect that need to be elaborate more information
to better understanding the concept of this project. In this chapter covered the theory
or project of others on the making of Air Quality Monitoring based on IoT product.
The various research will be examined and understand the concept, the process, and
the material used for each research.

2.1 Review Paper

Table 2.1: The review of previous work


Year of
No. Author Publica- Project Title Summary
tion
The focus of this project was air pollution
monitoring over web server using the internet
that will trigger the alarm if the air level reaches
the certain level where CO2, alcohol, smoke
and NH3. The air pollution level will display
on 16x2 LCD as well along-side web server.
K.Nirosha, IoT based Air The main sensor used for this project was
B. Pollution MQ135 gas sensor while the microcontroller
1 2017
Durgasree, Monitoring that this project using was Arduino Uno. For
N. Shirisha System [1] connection IoT, they used Wi-Fi Module
ESP8266 to connect to internet. Buzzer was
used for alerting when air became unhealthy.
This project used their own web server instead
using the commercial IoT platform. The view
only shown the Part Per Million (PPM) value
for air pollutant concentrations.
5

Table 2.1 (continued)

This project using multiple sensor monitored


the amount air pollution in an area. This paper
was proposed the system name to Wireless
Sensor Network (WSN) Air Pollution
Monitoring System which will setup across
D.Arunkuma
many places. This project used the Air Quality
r,
Smart Air Index (AQI) standard. The output of this
K.Ajaykanth
Pollution project was produced by using new data
,
2 2018 Detection and aggregation algorithm that merge and filter the
M.Ajithkann
Monitoring data to show real time monitoring system. The
an,
Using IoT [2] sensor was used in this project is Gas sensor,
M.Sivasubra
Temperature sensor, Smoke sensor, Humidity
manian
sensor and Rain Sensor. The main controller
was Arduino Uno. The bridge connection
between internet and the endpoint device was
using GSM modem. This project also including
GPS to pinpoint the location device.
Based on this project, the idea was to implant
the Air Quality Monitoring system inside a
house or office. Instead used the device at
outdoor environment, this project tends to
focus household air pollution level. This
Sagar M. Implementatio
product used 3 main sensor which is MQ135
Godase, n of IoT based
Air Quality sensor, MQ2 Smoke sensor and
Rahul C. Indoor Air
3 2018 MQ7 Gas Sensor that helped detect the
Padalkar, M. Quality
unnecessary particle in air. Microcontroller
K. Monitoring
used for this project was Arduino Uno using
Bhanarkar System [3]
Atmega328p chip and ESP8266 as Wi-Fi
module. For the IoT platform, the device is
connecting to commercial platform,
ThingSpeak.com. The uses buzzer and LED to
indicate of exceed dangerously gas level.
This project used a different type of sensor
compare to previous paper. Instead used
MQ135 Gas sensor, this project design as air
quality device using 3 sensors, MQ2 for smoke
detection, MQ7 for carbon monoxide and
F. N. IoT based Air
zh03a particle sensor used for PM1.0, PM2.5
4 Setiawan, I. 2017 Quality
and PM10(dust). This project using NodeMCU
Kustiawan Monitoring [4]
(ESP8266) as main microcontroller and also
Wi-Fi module to connect to the internet. The
output will display on LCD and the Internet
using ThingSpeak.com as IoT platform to
monitor.
6

Table 2.1 (continued)

This project was proposed to be integrated


system low-cost air quality sensor using 2
sensor and Microcontroller Unit (MCU) that
connected to cloud. Provide a real-time
monitoring system through a webpage. The 2
main sensors used was MQ135 for Air Quality
Wireless
Nurul Azma measure and DHT-22 sensor for temperature
Internet of
Zakaria, and humidity reading. The MCU of this project
Things-based
Zaheera was Raspberry Pi 2 as brain for this operation.
Air Quality
5 Zainal 2018 The Raspberry Pi board had Wi-Fi Module
Device for
Abidin, build in, so there no need to has additional Wi-
Smart
Norharyati Fi module such ESP8266. But need external
Pollution
Harum Analog to Digital Converter (ADC), MCP3008
Monitoring [5]
(ADC for Raspberry Pi) to convert input of
sensor (analog) to digital. The data reading will
transfer to Cloud database for IoT Platform,
ThingSpeak.com and also will send
notification to email if the level of air quality
become unhealthy.
On this paper, the project was focus on real-
time indoor air quality monitoring (IAQM)
using wireless sensor network (WSN). The
Mohieddine
sensors using in this project is CO2, CO, SO2,
Benammar,
A Modular NO2, O3 CI2, ambient temperature and relative
Abderrazak
IoT Platform humidity sensor nodes. It monitors for each
Abdaoui,
for Real-Time concentration of six gases and temperature and
6 Sabbir H.M. 2018
Indoor Air humidity of the air. Using ATmega1281
Ahmad,
Quality microcontroller support seven analog input and
Farid Touati,
Monitoring [6] 8 I/O for digital. Added the backup 6600 mAh
Abdullah
rechargeable battery in case main power was
Kadri
down. It also included its own gateway that
been made by Raspberry Pi2 model B with
Xbee-2B module.
This project proposes a surveillance system for
air pollution. The Arduino microcontroller was
Kennedy used to develop the system. The air pollution
Okokpujie, control system has been designed to monitor air
Etinosa quality and analyse data on a remote server in
Noma- A Smart Air real time and to keep data up to date over the
Osaghae, Pollution internet. The sensor was based on MQ135 gas
7 2018
Odusami Monitoring sensor. Measurements of air quality have been
Modupe, System [7] made using Microsoft Excel based on Part per
Samuel Million (PPM) metrics. The ESP8266 Wi-Fi
John, Oluga Module will used as bridge between endpoint
Oluwatosin device and cloud system. It will display on
LCD 16x2 and also via the cloud system on any
mobile device.
7

Table 2.1 (continued)

This project is about IoT based monitoring the


air pollution which can view over the web
server through internet and trigger the alarm
Poonam Pal,
IoT Based Air when the air pollution rise a beyond the
Ritik Gupta,
Pollution unhealthy level. Using the MQ135 gas sensor
Sanjana
8 2017 Monitoring for detection pollutant gases that connected to
Tiwari,
System Using Arduino Uno. The Wi-Fi module use for this
Ashutosh
Arduino [8] project was ESP8266 that to cloud database so
Sharma
it can display on web server or mobile device.
It will also display on LCD 16x2 and will
trigger the buzzer when necessary.
This project is to build the air quality
monitoring system that provide the high
Jen-Hao Liu,
resolution of collected data that suitable to
Yu-Fan An Air
micro-scale air quality measuring. The system
Chen, Chih- Quality
based on Wireless Sensor Network and
Hong Sun, Monitoring
connected with GSM. The network consist
Tzu-Shiang System for
sensor, gateway and LabView cloud database.
Lin, Chia- Urban Areas
9 2012 The sensor nodes used was Octopus 2 based on
Pang Chen, Based on The
Texas Instrument MSP430F1611 architecture
Po-Tang Technology of
contains light sensor and humidity sensor. The
Chen, Tzai- Wireless
Octopus 2 had 5 I/O with feature digital-to-
Hung Wen, Sensor
analog converter. The CO sensor also been
Jehn-Yih Networks [9]
used along side the Octopus 2. Used a bridge
Juang
module to regulates power supply to CO gas
sensor and wireless communication module.
This paper design to develop the effective way
for pollution monitoring system. This project
mainly focuses to 2 main sensor, CO and CO2
gas sensor that been calibrated at appropriate
V.S.Revathy
calibration. Using data aggregation algorithm
, K.Ganesan,
Air Pollution to display a real-time update of pollution data
K.Rohini,
10 2016 Monitoring on internet. Temperature and humidity sensor
S.Tamil
System [10] been used as an extra parameter along with gas
Chindhu,
concentration sensor. The MCU used for this
T.Boobalan
project is CC3200 module LaunchPad,
integrates with Wi-Fi module. Using Energia
software to program a CC3200 Wi-Fi module
device.

2.2 Comparison

Most of the project had been made was based on Wireless Sensor Network (WSN).
The WSN can be used simultaneously for real-time monitoring the air pollution at
targeted area. Several previous works had based on this system which is more
efficiently and will be discussed the material and device used on the previous project.
The project created by K. Nirosha et al. [1] established the air quality project
that can monitor the air quality level on mobile device. The MQ135 gas sensor was
used for main sensor on this project while Arduino Uno was act as the microcontroller.
Wireless Internet access was used to connect to the IoT with the ESP8266 Wi-Fi
8

module. On 16x2 LCD as well alongside the web server, the air pollution level is
displayed. Instead of using the commercial IoT platform the project used its own web
server. Advantage in this project is the used of its own web server platform to perform
IoT. Reduce the cost to buy or rent space on commercial IoT platform such as
ThingSpeak.com, Blynk etc. Disadvantages can be picked was the used of their own
IoT platform. The data been view without much of infographic and the past
information on the web server as can be seen on Figure 2.1. It also needs to refresh the
page to view the current air pollution value.

Figure 2.1: The Air Quality Index levels on web page

D. Arunku et al. [2] proposes an idea for large scale of Wireless Sensor
Network Air Pollution Monitoring System (WAPMS) to monitor locally by using
wireless sensors deployed in large numbers in the area. It consists MQ2 smoke sensor,
MQ135 air quality sensor and DHT11 temperature and humidity sensor. Along-side
with Arduino Uno as Microcontroller that connected to IoT modem device for
connection to the cloud. The use of GPS to determine the location of each WAPMS in
large area. The advantages are the portability of compact device combined with IoT
concept using cloud database system. Disadvantage on this project was the lack of
medium to view of output which important in monitoring system.
Sagar M. Godase et al. [3] implemented a device used specific inside a
building. Unlike a previous where tend to focus on outside area. The MQ135 Air
Quality sensor, MQ2 Smoke sensor and MQ7 Gas Sensor were the main products that
helped detect unnecessary particulate matter in the air. Arduino Uno was using
Atmega328p and ESP8266 as Wi-Fi module as a microcontroller for this project. The
device connects with ThingSpeak.com, the commercial platform. Buzzer and LED are
9

used to indicate that the gas level is above risky. Advantages this project is that it added
two more sensor, smoke and gas sensor for more accuracy on collected data. The
disadvantages were those new two sensors only help to detect the concentration of gas
inside small space and not suitable for outside used.
F. N. Setiawan et al. [4] presented a project based on three sensors, MQ2 for
smoke detection, MQ7 for carbon monoxide and zh03a as lase dust sensor. Its different
compare to other project which used of MQ135 air quality sensor. In this project only
using ESP8266 as microcontroller and Wi-Fi module simultaneously to send the data
to ThingSpeak.com cloud along with LCD. Advantages for this product is the used of
ZH03A which good selectivity and stability. But the ZH03A bigger size compare to
MQ135. The lack of indicator when the air level raise above unhealthy condition
become the big disadvantages for this product.
Nurul Azma Zakaria et al. [5] proposed the low-cost air quality monitoring
device. Consists 2 sensors and a cloud connected MCU (Microcontroller Unit). The
two main sensors used were Air Quality measurement MQ135 and DHT-22
temperature and humidity measurement sensors. This project's MCU was Raspberry
Pi 2 which had built-in Wi-Fi module. MCP3008 is needed to convert analog input to
digital output and send the collected data to ThingSpeak.com. The notification will be
sent through email if the air become unhealthy. The advantages using email instead of
buzzer or LED as indication when the air pollution become worse was for portability.
The user can be apart from the device while still can manage a countermeasure when
air not suitable to breath-in. The disadvantages of this product are the needed of
external Analog-to-Digital Converter (ADC) because Raspberry Pi lack of that
features.
Mohideddine Benammar et al. [6] develop a project based on indoor air quality
monitoring (IAQM) using a standard WSN system where it can monitor through
internet webserver. Using ATmega1281 SoC as operating microcontroller connect to
XBee Pro radio module for communication module. The sensor node will use Libelium
sensor that connect multiple sensor processing and store data on Waspmote. Include
the power backup battery with capacity 6600 mAh trigger when power was down. This
project created its own gateway that consist Raspberry Pi 2 Model B with additional
XBee 2B module. This gateway act as bridge to the internet database. Several IAQM
device connect to gateway inside the library. The advantages of this system are
manageable IAQM connected to one gateway to process a real-time data monitoring
10

can be more efficient in term of data collecting. Disadvantages is the price in the
making the product was to expensive and more suitable for a large scale implemented
project.
Kennedy Okokpujie et al. [7] present the system that same as others previous
project. Consist Arduino Uno as microcontroller that connect with ESP8266 Wi-Fi
module to access cloud database. The sole sensor used on this product was MQ135 gas
sensor that collected the data and display on LCD 16x2 along with visualize graph
online on the ThingSpeak.com cloud. The advantages from this project is the visualize
a live update that easy to understand. Disadvantages was this project do not have
counter measure when the pollution can harm human’s health.
Poonam Pal et al. [8] develop the project IoT based Air Pollution monitoring
using Arduino. The Arduino will use the MQ135 gas sensor to detect the harmful
particles in air send through ESP8266 Wi-Fi module to the internet cloud. The data
viewing can be display on LCD and webpage. The buzzer will trigger when the data
collected exceed 1000 PPM. The advantages of this project where it alert using buzzer
when trigger a certain point in close range but lack of effectiveness in provide
information in long distance.
Jen-Hao Liu et al. [9] build the device to monitor the air quality based WSN
system focus on urban area. The difference from another previous work, the used of
GSM to send the information. By using Octopus 2’s sensor nodes which support light
and humidity sensor and additional external CO gas sensor. Build with GPS on every
microcontroller each sensor nodes that introduce to Mobile Air Quality Monitoring
Network (MAQUMON). By sending data to database through GSM, the LabView
system will process and control the information to be view on internet. Advantages on
this project is the data collected will be sending their own private database before
publicly display on the internet. The main disadvantages of using GSM interferences
by other electronic device which can affect the output.
V. S. Revathy et al. [10] design a simple yet effective on monitoring air
pollution. Using two sensor, CO and CO2 sensor connected to LaunchPad CC3200
Wi-Fi module which also act as a microcontroller that connected to Energia software.
This outcome will be display on webpage. The advantages from this product is the
used of their focus to collect the data with most accurate value using CO and CO2 gas
sensor. The disadvantage is the product outcome where there was no alert system when
the harm particles in air reach the limit.
11

2.3 Summary of Chapter

There were many papers been review on this chapter and there were many ideas about
IoT based air quality monitoring. The product air quality monitoring with IoT-based
still in early stage of development because most of papers was published in recent year.
This chapter cover a lot about material selection, the method used and the platform of
IoT. The gathering data on previous project gives the general idea about this project
flow.
The basic information on the previous work is standard for air quality
measurement. Most of them used Air Quality Index (AQI) as a standard but in
Malaysia used Air Pollution Index (API) as the standard. This project will be used the
API standard to match with Malaysia standard.
The most of previous product was design based on Wireless Sensor Network
(WSN) which connect the air pollution device to internet database to process. To
ensure the real-time data be monitored, most of researcher used the Internet of Thing
(IoT) concept to provide information to the cloud. It enabled the data to be monitored
online. When the data exceed the dangerous level based on standard AQI, the sensor
nodes will send a signal to another indicator device via buzzer [1], LED [3], email [5]
and SMS [7] to notify the public.
This project will be based on WSN system because the effectiveness distributed
the information to the endpoint device. MQ 135 air quality sensor was choose by the
detection of multiple type gas including NH3, NOx, alcohol, Benzene, smoke, CO2,
etc. The IoT concept will be implemented on this project using ESP8266 Wi-Fi module
as endpoint device and Blynk application as IoT platform. After the comparison
between the most used microcontroller on the previous project, the NodeMCU was
choose based on built-in feature of Wi-Fi module ESP8266 on board. The small size
of the board makes easier for its mobility of the product. Along with Analog-to-Digital
Converter (ADC) to convert the collect analog data by MQ 135 sensor to cloud of
Blynk server for processing the data in digital form. The results show that air pollution
data in real time can be accessed from anywhere in the network on application through
smartphone. This project also designs to trigger an alarm whenever the air quality
drops. The sensor nodes will create an announcement on social media using Twitter
platform to alert the public when the air quality in hazard level
CHAPTER 3

METHODOLOGY

Methodology is the method to describe the procedure approach in this thesis. The
methodology essential part to understand the concept the making of the product. There
a lot of aspect will be discuss on this chapter. For first part will discuss for the
reasoning in the making of this product and also the specific approach to information
obtained. Second, will described the practical approach used to make this product to
achieve the expected result.
Methodology chart will show the general step of procedure will be conduct
during the making of this product. This chapter will organize the flow of the step
procedure to make it easy to understand the method use for this project.

3.1 Block Diagram

This system monitors the current state of pollution. In the web server or specific
application, this will be update frequently. We can monitor through the internet
anywhere. The current pollution status is also monitored by the Blynk application.
Based on block diagram shown in Figure 3.1, the figure will be explained in detail
about the project flows.
13

Figure 3.1: Block diagram for Air Quality Monitoring with IoT

3.1.1 Air Pollution Index (AQI)

The API measure how clean or polluted the air is, and what health consequences might
be of potential problem to people. By using their standard to set which level is good
and which level of bad for air quality to breath in.

Figure 3.2: The Air Pollution Index pollution levels


14

The range for AQI level is from 0 until 500 as shown in Figure 3.2. The larger
the API value, the higher the air pollution level and the greater the health concern. The
API status indicator was split into a couple of categories, good, moderate, unhealthy,
very unhealthy, and hazardous. It is categorized based on the highest values of the
index of five major air pollutants: particulate matter < 10μm (PM10), ozone (O3),
carbon monoxide (CO), sulphur dioxide (SO2) and nitrogen dioxide (NO2) over a
specific period of time [11]. For example, SO2 and PM2 measure average value for an
hour and need to be running for 24 hour period.
Based on Figure 3.3, API tends to focus on the health effects that people may
experience after inhaling polluted air within the next few hours or days. The API is a
clear and detailed approach to air quality classification, which can be easily understood
by the general public.

Figure 3.3: The Air Pollution Index levels precautious level

3.1.2 IoT Endpoint

IoT Endpoints are devices that monitor a service, process or machine and collect and
return data for analysis. It can be device the one that collect data or the one to view
result. The concept of Endpoint in IoT perspective is that the physical device will
collect the data and send the data through Internet gateway for further analysis on IoT
platform then send back the data to view on another endpoint device.
15

In this project, the endpoint device use to collect data and to view the data. For
collecting data from and other gas. The pollution level will measure by PPM (Part per
air quality will be using MQ135 Gas Sensor. MQ135 Gas Sensor was suitable to read
Air Quality data because it can detect various type gas including detection of gas NH3,
NOx, alcohol, Benzene, smoke, CO2 Million). The collecting data from MQ135 sensor
will give output in Voltage form. The data that collect from MQ135 is analog. To send
data to database for analyse, it need convert to digital. The task will conduct by
NodeMCU which has a build in ADC (Analog-to-Digital Converter) that will convert
the data collect by gas sensor to digital. This process is important when the data save
in the cloud later.
Based API standard shown on Figure 3.3, the output will show in range of 0
until 100 PPM when there no gas nearby. The safe range of air pollution will not
exceed 100 PPM. When the level reach 200 and above, the effect of surround air will
cause headache if stay too long within the area. If the air pollution index surpasses 400
PPM level, the emergency alert will send through social media (Twitter) to warning
the people of the area to prepare. The data will be collects in real-time through Internet.
The connection to the Internet is establish using NodeMCU ESP8266 Wi-Fi
module that will program to find the gateway to access the Internet. The ESP8266 was
purpose to send the collected data to IoT Cloud for analyse and monitoring. If the level
of air pollution exceeds the dangerous phase, the ESP8266 will send emergency signal
and the data will be post on Twitter board to warn the people about the dangerous gas.

3.1.3 IoT Gateway

The purposes of IoT Gateway create a connection point between cloud and Physical
device (Endpoint). The IoT Gateway itself is physical device. The example of gateway
is access point that act as device to World Wide Web. An IoT gateway carries out
several critical functions from protocol translation to encryption, processing,
management and data filtering.
The gateway will give internet access to the air quality device that transfer the
data to IoT Platform, Blynk apps and will post the information on social media
platform when triggered.
16

3.1.4 IoT Platform (Cloud)

The IoT platform is software purpose to support all connection IoT-based device. IoT
platform was designed to keep the data in database and analyse to create a desired
output for endpoint device. The IoT platform will keep update the data at endpoint
device such as smartphone or webpage in real-time. By connecting to hardware
through gateway, it will display the result which can be any interface that user created
to view the output.
The data collect using MQ135 and process by NodeMCU will be store and
analyse the data on the cloud then later will display a desire output on any device. By
using the platform Blynk apps, it will provide a graph with based value collect by
MQ135 overtime. The feed value on the graph will update the database for each
second.

3.2 Hardware Selection

This section will discuss about the selection of material and device used on this
product. Thing had been considered when choosing this product was based on
availability, application, price and durability of device.
Air Quality Monitoring with IoT technology requires to learn to use for both
part, hardware and software. The IoT on this product act as an output for monitoring
the air quality on any device.
The main device that used on this product is microcontroller, sensor (gas
sensor), and Wi-Fi modular that interconnect to IoT Cloud based to analyse the input.

3.2.1 Gas Sensor

This product will use the MQ-series gas sensor product to achieve the desire outcome.
The gas sensor by MQ-series use a small heater inside with the electro-chemical
sensor. The MQ-series product usually used indoor or cover a small area and only
sensitive for certain range of gasses. The output shown in Figure 3.4 consist digital
and analog output. This project will use the analog signal that use to read within a
NodeMCU analog input.
17

Air Quality Monitoring with IoT will use specific gas sensor, MQ135 sensor.
The MQ135 Gas sensors are used to detect or measure NH3, NOx, Alcohol, Benzene,
Smoke, CO2 in air quality control equipment [12]. The sensor module MQ-135 comes
with a digital pin that makes the sensor work even without a microcontroller.

Figure 3.4: MQ-135 Air Quality Sensor pinout diagram

3.2.2 Microcontroller (MCU) with Wi-Fi Module

Microcontroller is a device that function as small computer along with SoC (System
on chip) and programmable option. MCU (Microcontroller Unit) also consists a one
or more processor core, embedded with memory and programmable peripherals
input/output (I/O). Microcontroller function as a device that control another device to
give the desired output automatically.
The microcontroller that suitable with Air Quality Monitoring Device using
IoT project was NodeMCU v2 device that can create the auto-connect to internet
platform. This device was chosen because the features that suitable for this research.
It can control and process both analog and digital of I/O with mixed signal. Integrating
the analog components with digital output was necessary to collect data from MQ135
sensor that are not in digital input.
18

Figure 3.5: NodeMCU ESP8266 Wi-Fi-module pinout diagram

The NodeMCU was integrated with ESP8266 Wi-Fi is a self-contained TCP /


IP protocol stack SoC which provides access to your Wi-Fi network by any
microcontroller. The ESP8266 can host an application or download all Wi-Fi
networking features from another application processor. The module offers enough
on-board processing and storage capacity to be integrated in GPIOs shown in Figure
3.5. The firmware uses the Lua scripting language which can support using Arduino
IDE program.

3.3 Software Selection

3.3.1 Blynk (IoT Platform)

IoT platforms are responsible for ongoing management tasks and data viewing to
automate their environment by users. IoT platforms are often referred to as IoT's
middleware solutions. Generally speaking, an IoT or M2M solution is a mix of multi-
vendor functions.
For this product, the IoT platform choose is Blynk IoT Analytics. Blynk
application designed for the Internet of Things. It can remotely control hardware, view
sensor data, store data, and view data. Blynk apps allows user to create incredible
interfaces for the projects with different widgets tools. Blynk server is responsible for
19

all mobile and hardware communications. User can use their Blynk Cloud or run local
Blynk private server. It is open sources, can handle thousands of devices quickly and
can even be started on a NodeMCU. It also compatible with a lot of hardware platform
and can easy to connect between Blynk server with sensor and interchange data quickly
including NodeMCU platform.

3.3.2 Arduino IDE

Integrated Development Environment for Arduino is a software that used to write and
compile the program to be upload on compatible board. It can be used on any operating
system platform. The source code support C and C++ languages. Based on software
library for programming language, it can provide the desire input and output of the
devices.
This project will used Arduino IDE because of compatibility toward Arduino
Uno device for creating and compiling the code. It also eases to use compare to another
microcontroller product which need to use a specific burner to upload into MCU.

3.4 Circuit Diagram

After researching and studied the circuit diagram from the previous project, the circuit
was designed suitable to project outcome. Based on Figure 3.6, the circuit was
designed to find the pollution level on MQ135 and constantly update through
NodeMCU ESP8266 into the cloud.

Figure 3.6: The schematic circuit diagram for this project


20

Establish both 5V and Ground line on breadboard. The MQ135 VCC will be
supply with 5V and GND to the Ground line. Connect AOUT from MQ135 to A0 on
Node MCU. This part will collect the input in form of voltage that later will covert to
digital and send to the cloud.

3.5 Flowchart

The flow of the project based on Figure 3.7 starts with the power source of the project
which use 5V power from any power source that use micro-USB type B. When the
plug-in the power, the project will be running the program instantly.

Figure 3.7: The flowchart for this project


21

The program was start with connected to Wi-Fi connection using a set of SSID
and password. Then it will use the auth key given by Blynk application that will
connect with this project application interface. The MQ135 gas sensor will read
constantly without any delay and sent to Blynk server. The data can be view live or
can past information that collected. If the reading value surpass the 50 ppm (moderate
air), it will turn on the yellow LED while if the reading below 50 ppm the LED will
stay blue. Then the data will trigger the tweet bot and tweet the warning message for
it spread the news. The value will keep display on gauge widget while the Superchart
widget will plot the graph of collected data. The process for this program will keep in
loop until the user unplug the source power.

3.6 Prototype Development

The product development on this project consists two critical part, hardware and
software development. The hardware will focus assembly of the electronic part such
as sensor and microcontroller into making of the prototype. The software will be
program and execute the instruction for prototype to give an output.

3.6.1 Hardware Development

The hardware development was based two main part which the input sensor and
programable microcontroller. By using MQ135 gas sensor as main and only input
sensor in this product and combine with NodeMCU that can control and collect the
data while share it to internet through Blynk server. The MQ135 consist four pin and
only used three main pin and that was VCC as power supply for sensor, GND for
ground the sensor and Analog pin for transmitting the reading to microcontroller.
22

Figure 3.8: The hardware circuit for the prototype

The connection on this project was based design circuit in Figure 3.6. The input
voltage on sensor was connected to VIN which supply 5V to the sensor. The sensor
reading is relied on voltage supply as the reaction of the ambient gas will react to the
resistance on the sensor plate and the voltage will change based on resistance reaction.
It’s important to use a 5V voltage for this sensor. The GND connection will connect
on GND on NodeMCU board. The analog pin on MQ135 sensor will connect to A0
pin on NodeMCU board which the only analog input on MCU. The input value from
analog pin later will convert through ADC that used for displaying data on smart device
later. The two LEDs included will function as indicator for gas detection. Two LEDs
was used, blue and yellow colour. Blue will represent the good air environment while
yellow will trigger when air become polluted. The blue LED will connect to pin 0
while yellow connect to pin 16. Both use a digital as output. The connection was made
and created a circuit in Figure 3.8.

3cm

2cm

6cm

Figure 3.9: The casing size for prototype of this project


23

The casing on this product will modified the existence alarm bell that available
in market. Based on Figure 3.9, the casing size was 6cm x 3cm x 2cm. All the hardware
component will fit into this casing.

3.6.2 Software Development

The developing program for this project used the Arduino IDE to program the
NodeMCU ESP8266 v2 by using ESP8266 and MQ135 library [13]. The program was
structured to connect to the certain Wi-Fi connection and connect directly to Blynk
server at default gateway. The data will continuously update on Blynk server with 1
second delay for each. If the air value in a certain range, the LED will indicate about
the surround air pollution. The full program code can be view through Appendix A.

Figure 3.10: The actual value (ppm)

The MQ135 sensor was declared and used the analog pin of A0 port as constant
in main program code along with the ADC input using MQ135(ANALOGPIN)
instruction code in Figure 3.8. The input from sensor was split by three part, the raw
data, Rzero and the ppm value. The raw data was the data collected through sensor
without any change of the value. The Rzero was used calibration input for ppm value
later that can measure through resistance load on MQ135 sensor. After the Rzero value
was stabilized, the ppm value can be derived from raw data based on calibration value
from Rzero. By using MQ135 library on Arduino IDE, the value of ppm was been
called using gasSensor.getPPM() that shown as in Figure3.10.
24

Figure 3.11: The calibration value and the raw data from MQ135 gas sensor

The MQ135 gas sensor need to be calibrate for sensor to read the value with
accuracy and precise. This is because of the characteristic of the MQ135 sensor was
based on Metal-Oxide architecture sensor which use heating the plate to get a chemical
reaction in air [14]. For calibration of sensor, the MQ135 need to be heated for 24
hours for it to get used for normal atmosphere before making a reading [14]. After the
sensor plate was burn for 24 hours, the sensor needs to find the average for RZero
values to adapt to the humidity and temperature around 30 minutes [14]. The data
collected during finding Rzero can view in Table 3.1. The average of calibration value
of RZero is 510.75 which had been defined and calibrated for the value became more
stabilize.

Table 3.1: Cabliration RZero value


No. Calibration values
1 410.24
2 545.18
3 494.85
4 565.64
5 511.75
6 529.81
7 482.09
8 537.39
9 518.83
10 511.75

Blynk application setup will use the auth key that given through email and used that
key in Arduino IDE program. When connect to internet, the NodeMCU will
continuously sending data from analog pin (A0) to the virtual pin (V1) setup in Blynk
widget tools in Figure 12(a).
25

(a) (b) (c)


Figure 3.12: Blynk widget setup (a) Setting for Gauge Widget (b) Setting the visual
graph (c) Connect to Twitter account in Blynk application development

The data collected will put into visualize graph that plot for every data sent.
The graph also connected with virtual pin set up as shown in Figure 12(b). The output
will show in form of visualize graph that can be view the past reading. The event
trigger when the input from the sensor reach a certain value, the Twitter widget will
connect to the Twitter account @InPagoh shown in Figure 12(c) and used that account
to tweet about the dangerous level at a certain area.

3.7 Summary of Chapter

This chapter was explained the process and hardware device use in the making of this
project’s prototype. This project used three main component NodeMCU ESP8266,
MQ135 and Blynk software. The NodeMCU act as the brain of operation on this
project control and store the reading from MQ135 gas sensor in analog value. The data
that read by MCU will be sent to Blynk software in real-time. The Blynk software will
store collected data in their server that can be access through smartphone application
that connect to their server or internet. The calibration value needs to be setup for
higher accuracy reading on MQ135. Each gas sensors have a different calibration
value.
CHAPTER 4

RESULT AND ANALYSIS

In this chapter, the data collected will be analysis and display the designed product.
The result of this product measurement been analysis and discussed. The data collected
in three different location in real time and the result acquired using Blynk software.
This product also tested the alert function through a setup twitter account used to warn
the public about the pollution.

4.1 Hardware Design

The hardware consists two main component, NodeMCU ESP8266 and MQ 135 gas
sensor. The MQ 135 was place at the top of NodeMCU and using 6.2 cm x 3.1 cm x
1.9 cm plastic case as body shield of the product. The power source was used direct
supply 5v supply to NodeMCU. Then NodeMCU will distributed power toward LEDs
and MQ 135. The two LEDs will be used in this project as indicator. Each LEDs’
colour as representative indicator from good air condition and bad air condition. Both
LEDs will be using 330-ohm resistor.
The MQ 135 gas sensor will be place in between NodeMCU in small casing
compact sized. The gas sensor must use 5v power as the data collect was varying based
on resistive of gases toward the amount of voltage. The MQ135 connect to A0, analog
pin on NodeMCU board. The data collected from sensor will be converted to ADC
signal and sent through internet connection to Blynk server. Blynk will be the interface
for projecting the value through application in smartphone.
27

(a) (b)
Figure 4.1: Hardware design (a) Circuit inside the casing (b) Full cover casing

The hardware was designed to be portable and ease to be carry in pocket with
the size of the prototype as big as thumb finger. This achieved the objective of this
project by designing a portable prototype. The used of plastic based casing was to
avoid any electromagnetic interference in the casing along with less weight
characteristic. Based on Figure 4.1(a), the sensor was place in unmoveable state on the
top the NodeMCU. The full cover casing can be shown in Figure 4.1(b) was for the
completed prototype design for this project.

4.2 Software Interface

The user interface for this project was used the available templates in Blynk application
that can be install via Google Play Store or App Store. The templates will be called
widget tools. The used for widget tools is to display or trigger the certain event.
This project used Gauge widget to view a real-time data by created the push
setting to send the data for every second. The second widget tools were SuperChart
which the visualization of graph for the data collected by sensor in the past. The x-axis
will be set as timestamp for the data while y-axis is the value of PPM in air. The Twitter
widget was used to connect to Twitter account. The Twitter account bot will tweet a
message if the air pollution value reaches a dangerous level.
28

(a) (b)
Figure 4.2: The Blynk software interface (a) The reading of usual air environment (b)
The reading detected harmful gas (Ethanol)

The data was sent in real time as it set to push configuration on Blynk widget.
The reading in Figure 4.2(a) was measured in normal environment. While in Figure
4.2(b) was tested using chemical reaction of ethanol as a trigger for harmful gas
detection. The gauge widget shown the numerical value in PPM and the chart widget
collected the overall value for certain amount of time. The output on chart can be saved
and can be plot a graph for data analysis using a different program.

4.3 Data Collected from MQ135

The data was collected from MQ 135 in form of analog signal. The data then will be
converted with ADC to able to send data through internet and store it in Blynk server
and continuously showing data on Blynk interface. Based on datasheet, the sensor
claims to detect for CO2, Alcohol, Benzene, NOx, NH3 and other gasses.
The input from MQ135 was modified according to suitable use of application
to monitoring air quality. The analog input from MQ135 was detecting the raw data
which is resistive load. The collected raw data for 24 hours can be view in detail in
Figure 4.3. MQ135 sensor consist tin dioxide that heated the plates to change resistance
29

as it will reacts to particles in air and accelerates chemical reaction. This sensor also
not sensitive toward a single gas.

Air Quality Indoor


400

350

300
Air Pollution (raw)

250

200

150

100

50

0
4:48:00 AM 9:36:00 AM 2:24:00 PM 7:12:00 PM 12:00:00 AM 4:48:00 AM 9:36:00 AM
Timestamp

Figure 4.3: The raw data from MQ135 gas sensor

The example of raw data shown in Figure 4.3 later will used as configuration
based on calibrate the gas sensor. The reading reacted toward the chemical in air to the
plate and will create a resistance value called Rzero. Rzero will be used as initial
calibration value. The peaks shown in Figure 4.3 reading was where the sensor was
been tested by harmful gas (CO2) MQ135 gas sensor to stabilize the value.

4.3.1 The Concentration of Gasses

The sensor was tested using a different type of chemical gasses for period of three
second. The testing purpose was to find the which type of gasses that MQ135 sensor
can detected and which had highest concentration value. It also tested the sensitivity
of this gas sensor toward several gasses. The reading was tested using home appliance
that frequent used on daily basis.
30

Table 4.1: Concentration value for each type of gasses


Concentration value
No. Type of gasses Test object
(ppm)
1 (Carbon Dioxide) CO2 Car 252.1
2 Alcohol Perfume 346.7
3 Butane Lighter 429.3
4 (Carbon Monoxide) CO Cigarette 178.8
5 Smoke Burning paper 220.9
Mosquito
6 Aerosol 310.9
repellent

The MQ135 can use to detect several harmful gasses. Based on Table 4.1, the
different gasses have a different and various concentration. The sensitivity also can be
affected by type of gasses. Based on the standard API level in Figure 3.3, the data
collected during tested was surpass the unhealthy level. The cause of this gasses was
harm to human body and also environment.
The reading from Carbon Dioxide (CO2) was below than expected as the CO2
have the heaviest and one of the most abundant trace gasses in the earth atmosphere.
In normal environment, the CO2 produce around 400 ppm and can be up to 4000 ppm.
While when tested, theMQ135 sensor reading only read 252.1 ppm. The other gases
have a lower abundant trace compare to the CO2.
Butane have the highest reading because of the liquid state before it exposed to
the air atmosphere. The MQ135 plate used heat on the plate as a medium to read the
chemical in gas. When heat plate exposed toward a liquid chemical it will reduce a lot
of resistance and voltage read can be much higher. The lowest reading of the gas
concentration when tested was Carbon Monoxide (CO). The reason this colourless and
tasteless gas but very dangerous gas reading was low because of this gas have less
dense particle than the air.

4.3.2 The Air Quality Monitoring Data Analysis

The sensor also was running for 1 hours on both indoor and outdoor environment to
test and compare the reading of MQ 135 gas sensor. This is because heated tin or metal
oxide and burn surrounding air for chemical concentration particle in air. For this
31

sensor to detect the gasses, humidity and temperature play role in making of sensitivity
of the sensor. The tested value for indoor and outdoor was compare in Figure 4.4
below.

OUTDOOR VS INDOOR
Outdoor Indoor

10
9
8
7
6
GAS (PP)M

5
4
3
2
1
0
1:33 1:40 1:48 1:55 2:02 2:09 2:16 2:24
TIMESTAMP

Figure 4.4: The data from MQ135 gas sensor for indoor and outdoor environment

The product was tested for both indoor and outdoor environment to compare
and to find the best possible environment that suitable for this sensor to be used around.
Based on Figure 4.4, the reading of the outdoor was higher than the reading on indoor
environment. The average outdoor value was 1.96 PPM while the average for indoor
was 0.63 PPM. The higher value in outdoor environment can be factor by the pollution
cause by vehicles. The product was test 10 meters away from parking. The emission
of CO2 has an effect toward sensor reading. For the indoor environment was conduct
in closed space which have less harmful gases can be produced within the area. The
value of outdoor reading was 32% higher than indoor environment.
32

HUMIDITY INFLUENCE ON SENSOR


High Humidity Low Humidity

2
1.8
1.6
1.4
GAS (PPM)

1.2
1
0.8
0.6
0.4
0.2
0
21:14 21:21 21:28 21:36 21:43 21:50 21:57 22:04 22:12 22:19
TIMESTAMP

Figure 4.5: The data collected on influence of humidity toward sensitivity of gas
sensor

Based on Figure 4.5, the value of the air pollution index used by MQ135 gas
sensor depend on temperature and humidity in air. The reason of this affect the
accuracy was the MQ135 sensor using heat as a method for detecting gasses in air
environment. By heat up the sensor, the value can be derived by reaction of burned
gases toward the heat plate.
The data collected in period of one hour that shown in Figure 4.5 produce a
result where the high humidity have a less value compare to the lower humidity
environment. The high humidity can lower the value reading while the lower humidity
can affect of higher reading of MQ135 sensor [15]. The high humidity can cause less
accuracy of the reading along with the temperature of environment. The heat on the
plate need to be calibrated on high humidity environment for more accurate reading.

4.4 The output from Twitter

The Twitter account was used as a medium for broadcasting the news about air
pollution on certain area. The social media became norm and can use to feed news and
information in digital world. Twitter is one the fast growth social media with having
126 million active user.
33

Figure 4.6: The tweet message when the environment on the air became unhealthy

Twitter account was connected through Blynk by using Twitter Application


Programming Interface (API). This had been added through widget Twitter from
Blynk function. The Twitter message will trigger when the reading value reach 50
ppm. The program will automatically tweet a message such in Figure 15 to warn about
condition of air pollution.

4.5 Summary of Chapter

The prototype for this project was created based on the objective and scope of the
project. The hardware was design so it can be used as a portable device or also can be
use as a static air pollution detection. By applied IoT concept to this project, the data
collection can much easier to analysis and view as all the collected data was store on
server in internet. The detection of pollution became more efficient.
Data analysis produce from this project will be use and refer in the future. The
device was suitable used for both indoor and out outdoor appliance. The gap between
indoor and outdoor reading in the range of 32.1 %. The humidity was affected the
reading of the gas sensor by 46.3 %. This reading will be affected the accuracy of gas
pollution detection by this sensor. This project also used a social media, Twitter as an
indicator for warning message for the follower when the air was polluted.
CHAPTER 5

CONCLUSION AND RECOMMENDATION

5.1 Conclusion

The air quality detector is very important to human nowadays because the air became
more polluted as the industrial and transportation became a norm. Air particles was
hard to detected and very dangerous for to surround environment. As the sensor for air
quality became more available and cheaper, the engineer can design and develop the
air quality product that can help monitoring and prevent the surround air. By using this
air quality devices, the user can prevent or control the dangerous particles in air. The
device was designed to be portable and ease to use compare to standard air quality
detector which have a bigger size. The size for this product was reduce to 60% and can
be carried in the pocket. It can use to detect a different type of gasses that harmful
human whenever or wherever. From data collected the sensor’s sensitivity against
lower humidity was 32.1% lower than average environment reading. The humidity
cause metal oxide sensor reduces the sensitive to water vapors in air. The different
value between indoor and outdoor reading was 46.3% more pollution within outdoor
environment. This higher reading of the PPM can be cause by car emission that
produce the CO2 pollution. This air quality sensor can be applied within indoor and
outdoor environment. Even with the good air quality detector, the data must also need
to be inform to the public with delay and efficient. By using this project, the air quality
level can be view and share instantly in a new growing media outlet, social media. This
can help the delivering information immediately and assume that 92% user retweet
for the first hour, the news will spread more efficient compare to the traditional way
35

of news. Therefore, this project was designed to achieve the minimal cause from air
pollution for environment. By connect the hardware and virtual world, the data can be
exchange and analysis for better outcome for earth environment.

5.2 Recommendation

The making of this project can be improve to more efficient or using alternative source
of energy to power up the device. The device was supposed to be portable and most of
the features that can be added had to be discard for the purpose to create a smaller and
weightless prototype. There are many aspects of improvement can be made on this
project to produce a better result. There few of the recommendation can be added to
improve this project in the future:
i. The accuracy of the MQ135 sensor can be improve by adding the humidity and
temperature sensor such as DHT11 that can be used as the calibration for
MQ135 sensor.
ii. Equip the Optical particle sensor such as ZH03A laser dust sensor for more
accurate reading.
iii. Added MQ811 sensor that can be used to measure a Carbon Dioxide (CO2)
which have heaviest gas particle.
iv. Equip the battery as power source that can be equip within available
microcontroller such as WeMos D1, the microcontroller that equip with
rechargeable battery.
v. Used another IoT platform that more customable and accessible.
36

REFERENCE

[1] K.Nirosha, B. Durgasree, and N. Shirisha, IoT Based Air Pollution Monitoring
System , International Journal Of Current Engineering And Scientific Research
(IJCESR), pp. 1–3, 2017.

[2] Arunkumar, D., Ajaykanth, K., Ajithkannan, M., & Sivasubramanian, M., Smart
Air Pollution Detection and Monitoring Using IoT. International Journal of Pure
and Applied Mathematics, 119(15), pp. 935–941, 2018.

[3] Sagar Godase, Rahul Padalkar, and M. K. B, Implementation of IoT based Indoor
Air Quality Monitoring System. Current Global Reviewer- Special Issue,
(Special issue), pp. 12–20, 2018

[4] Setiawan, F. N., & Kustiawan, I, IoT based Air Quality Monitoring. IOP
Conference Series: Materials Science and Engineering, 384(1), 2018

[5] Zakaria, N. A., Zainal, Z., Harum, N., Chen, L., Saleh, N., & Azni, F., Wireless
Internet of Things-Based Air Quality Device for Smart Pollution Monitoring.
International Journal of Advanced Computer Science and Applications, 9(11),
pp. 65–69, 2018.

[5] Benammar, M., Abdaoui, A., Ahmad, S. H. M., Touati, F., & Kadri, A., A
modular IoT platform for real-time indoor air quality monitoring. Sensors
(Switzerland), 18(2), pp. 1–18, 2018.

[6] Okokpujie, K., Noma-Osaghae, E., Modupe, O., John, S., & Oluwatosin, O., A
Smart Air Pollution Monitoring System. International Journal of Civil
Engineering and Technology (IJCIET, 9(9), pp. 799–809, 2018.
37

[7] Pal, P., Gupta, R., Tiwari, S., & Sharma, A., IoT Based Air Pollution Monitoring
System Using Arduino. International Research Journal of Engineering and
Technology (IRJET), 3(4), pp. 571–575, 2017.

[8] Liu, J. H., Chen, Y. F., Lin, T. S., Chen, C. P., Chen, P. T., Wen, T. H., Jiang, J.
A., An air quality monitoring system for urban areas based on the technology of
wireless sensor networks. International Journal on Smart Sensing and Intelligent
Systems, 5(1), pp. 191–214, 2012.

[9] Rewatkar, N., & Khatri, D. M., Air Pollution Monitoring System Using WSN.
International Journal of Innovative Research in Science, Engineering and
Technology, 11(2), pp. 91–97, 2017.

[10] Rani, N. L. A., Azid, A., Khalit, S. I., Juahir, H., & Samsudin, M. S. (2018). Air
pollution index trend analysis in Malaysia, 2010-15. Polish Journal of
Environmental Studies, 27(2), pp. 801–808, 2018.

[11] Tem, R., MQ-135 Sensor. 1, pp. 3–4, 2018. [Online], Available:
http://www.futurlec.com/Datasheet/Sensor/MQ-135.pdf,
www.hwsensor.com%0Ahttps://www.olimex.com/Products/Components/Sensor
s/SNS-MQ135/resources/SNS-MQ135.pdf [Accessed July 30, 2019]

[12] Smilexth. (n.d.). smilexth/MQ135-Arduino-Sensor. [Online], Available:


https://github.com/smilexth/MQ135-Arduino-Sensor/blob/master
/MQ135/MQ135.ino. [Accessed Sept. 5, 2019]

[13] Krocker, G. (n.d.). MQ135 Arduino library: Details. [Online], Available:


https://hackaday.io/project/3475-sniffing-trinket/log/12363-mq135-arduino-
library. [Accessed Sept. 5, 2019]

[14] Kalra, V., Baweja, C., & Chopra, S., International Journal of Advanced Research
in Computer Science and Software Engineering Influence of Temperature and
Humidity on the Output Resistance Ratio of the MQ-135 Sensor. 6(4), 2016.
38

APPENDIX A

A: PROGRAMMING CODE

#define BLYNK_PRINT Serial

#include "MQ135.h"

#include <ESP8266WiFi.h>

#include <BlynkSimpleEsp8266.h>

#define ANALOGPIN A0 //Pin MQ135 gas sensor

#define RZERO 510.75 //Calibrate value

MQ135 gasSensor = MQ135(ANALOGPIN);

BlynkTimer timer;

char auth[] = "SswzxLhXo5kpAjFisJc7-OGjMRKdjYII";

// Get Auth Token in the Blynk App.

char ssid[] = "Lenovo RH";

char pass[] = "sayamakanayam";

int n; //Raw data from MQ135

float rzero; //Calibration value

float ppm; // The gas in PPM Value

void setup()

Serial.begin(9600);

Blynk.begin(auth, ssid, pass);

pinMode(16,OUTPUT); // Pin ouput for Yellow LED

pinMode(0,OUTPUT); // Pin ouput for Blue LED


39

timer.setInterval(1000L, sendUptime); // Time set to 1 second for


Blynk Server

rzero = gasSensor.getRZero();

Serial.print("MQ135 RZERO Calibration Value : ");

Serial.println(rzero);

void sendUptime()

Blynk.virtualWrite(V1, ppm); // The value will write on Virtual pin 1


in Blynk app

void led()

if(ppm<50) // Healthy API value

digitalWrite(16,LOW); //LED High

digitalWrite(0,HIGH); //LED LOW

else

digitalWrite(16,HIGH);

digitalWrite(0,LOW);

void loop()

Blynk.run();

timer.run();
40

ppm = gasSensor.getPPM();

delay(1000);

Serial.print("The ppm value : ");

Serial.println(ppm);

led();

}
41

APPENDIX B

B: PSM 1 GANTT CHART

Activities W W W W W W W W W W W W W W
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Title discussion and


selection

Understanding the PSM 1


Title

Propose the block


diagram

Chapter 1: Introduction

Chapter 2: Literature
Review

Chapter 3: Methodology

Report Checking by
supervisor

Submission of report PSM


1 to supervisor

Submission of report PSM


1 to panels

Preparation of
Presentation

Presentation of PSM1

Remarks Planning Actual


42

APPENDIX C

C: PSM 2 GANTT CHART

Activities W W W W W W W W W W W W W W
1 2 3 4 5 6 7 8 9 10 11 12 13 14

Design the project’s


circuit

Develop and program the


project’s circuit

Generate raw output from


MQ135 gas sensor

Design the software


interface Blynk

Establish a connection
between hardware and
software

Calibrate the MQ135 gas


sensor

Develop the project’s


prototype

Data collection and


analysis

Preparation of technical
report and presentation

Presentation of PSM1

Report submission

Remarks Planning Actual

Você também pode gostar