Art Integrated Project
Name: Uday Parmar
Class: 11 C ROll
th
IoT
based Air Pollution Monitoring Syste
m using
Arduino
In this project we are going to make an IoT
Based Air Pollution Monitoring System in
which we will monitor the Air Quality over a
webserver using internet and will trigger a
alarm when the air quality goes down beyond
a certain level, means when there are
sufficient amount of harmful gases are present
in the air like CO2, smoke, alcohol, benzene
and NH3. It will show the air quality in PPM on
the LCD and as well as on webpage so that we
can monitor it very easily.
Code Explaination
Before beginning the coding for this project, we need to first
Calibrate the MQ135 Gas sensor. There are lots of calculations
involved in converting the output of sensor into PPM value, we
have done this calculation before in our previous
Smoke Detector project. But here we are using the Library for
MQ135.
Using this library you can directly get the PPM values, by just
using the below two lines:
But before that we need to calibrate the MQ135 sensor, for
calibrating the sensor upload the below given code and let
it run for 12 to 24 hours and then get the RZERO value.
After getting the RZERO value. Put the RZERO value in
the library file you downloaded "MQ135.h": #define
RZERO 494.63
Now we can begin the actual code for our Air quality
monitoring project. In the code, first of all we have
defined the libraries and the variables for the Gas sensor
and the LCD. By using the Software Serial Library, we can
make any digital pin as TX and RX pin. In this code, we
have made Pin 9 as the RX pin and the pin 10 as the TX
pin for the ESP8266. Then we have included the library
for the LCD and have defined the pins for the same. We
have also defined two more variables: one for the sensor
analog pin and other for storing air_quality value.