Societal Project Report
Societal Project Report
MASTER OF TECHNOLOGY
IN
Submitted by
SUDHA S KATTEGOUDRA
[4UB22LDN07]
Under the guidance of
Smt. Dr. Geetha V M.tech, Phd
Associate Professor
Dept. of Electronics and Communication Engineering
UBDTCE, Davanagere
2023-2024
UNIVERSITY B. D. T COLLEGE OF ENGINEERING,
DAVANAGERE-577004
( A constituent college of Visvesvaraya Technological University, Belagavi, Karnataka )
CERTIFICATE
This is to certify that the societal project work entitled “IOT BASED AIR POLLUTION
MONITORING SYSTEM” carried out by SUDHA S KATTEGOUDRA bearing USN
(4UB22LDN07), a bonafide student of University B D T College of Engineering, Davanagere in
partial fulfillment of the requirement for the award of Master of Technology in Digital
Communication And Networking of the Visvesvaraya Technological University, Belagavi during
the year 2023-2024. The societal project has approved as it satisfies the academic requirements for
the said degree.
2023-2024
DECLARATION
I hereby declare that the entire work embodied in societal project is IoT Based Air Pollution
Monitoring System using Internet of Things to Visvesvaraya Technological University as a part of
the M.Tech curriculum, is a record of an original work done by me under the guidance of Smt. Dr.
GEETHA V , Associate Professor and this societal project is submitted in the partial fulfillment of
requirements for the post graduation.
I also confirm that the report is only prepared for my academic year requirement, not for
any other purpose.
SUDHA S KATTEGOUDRA
[4UB22LDN07]
ACKNOWELEDGEMENT
I would like to thank our Principal Dr. D P NAGARAJAPPA, UBDTCE, Davanagere for providing
an inspiring environment to carry out academic works in the college.
I would like to thank our Dr. RAVINDRA P RAJPUTH, Professor and Chairman, Department of
studies in Electronics and Communication Engineering, UBDTCE Davanagere, who is inspiring
person and excellent advisor to carry out my project.
I would like to express my immense gratitude to my Guide Dr. GEETHA V Professor, Department
of studies in Electronics and Communication Engineering, UBDTCE, Davanagere, for his skillful
guidance, motivation, timely suggestion and also for providing the right ambience, constant
encouragement, guidance and support.
I intend to thank all the teaching and non-teaching staff of our Department of Electronics &
Communication Engineering for their immense help and co-operation.
SUDHA S KATTEGOUDRA.
[4UB22LDN07]
TABLE OF CONTENTS
CHAPTER1: Introduction.................................................................................01-02
1.1 Aim………………………………………………………..............................01
1.2 Literature Survey………………………………………….............................01-02
REFERENCES ...............................................................................................32
APPENDIX
Chapter 1
INTRODUCTION
Air is getting polluted because of the release of toxic gases by industries, vehicle emissions
and increased concentration of harmful gases and particulate matter in the atmosphere.
The level of pollution is increasing rapidly due to factors like industries, urbanization,
increase in population, vehicle use which can affect human health. Particulate matter is one
of the most important parameters having a significant contribution to the increase in air
pollution. This creates a need for measurement and analysis of real-time air quality
monitoring so that appropriate decisions can be taken in a timely period.
This paper presents real-time standalone air quality monitoring. Internet of Things (IoT)is
nowadays finding profound use in each and every sector, plays a key role in our air quality
monitoring system too. The setup will show the air quality in PPM on the webpage so that
we can monitor it very easily.
In this IoT project, we can monitor the pollution level from anywhere using your computer
or mobile.
The explanation of the Air Quality Index (AQI) and its standard ranges are described in [1].
From 0-100 ppm the atmosphere is safe for living. If the ppm level increases above 100 then
it moves out of the safety zone. If the ppm value rises above 200 then it becomes extremely
dangerous for human life.
The DHT11 sensor module is used to measure the temperature and the humidity of the
surroundings [2]. The MQ-135 gas sensor is used to measure the air quality of the
surroundings [3]. It can be calibrated with respect to fresh air, alcohol, carbon dioxide,
hydrogen and methane. In this project, it has been calibrated with respect to fresh air [9], [10].
In [4] the controlling action of Node MCU has been described. This research has shown the
uses of C++ as the programming language for scripting the software code. It has an inbuilt
Wi-Fi module which allows the project to implement IoT easily. Arduino IDE is used to
implement the coding part of the project [5], [8]. Thing Speak cloud is used for the cloud
service. It has a free version which requires a delay of 15 seconds to upload an entry in the
cloud [6], [7]. As this project uses two sensors, both of them have internal heater elements
and withdraw more power(P=V*I), so though both sensors are turned ON, their output
voltage levels vary and show unpredictable values due to insufficient power drive. So, we
used a separate power supply for the sensors as Node MCU alone is not sufficient to drive
two sensors [9].
Chapter 2
THEORY & DESCRIPTION OF THE COMPONENTS
the Apple Watch. This could be a dedicated app or iOS native applications such as Siri. This
can be demonstrated in the case of Lenovo's Smart Home Essentials, which is a line of smart
home devices that are controlled through Apple's Home app or Siri without the need for a
Wi-Fi bridge. There are also dedicated smart home hubs that are offered as standalone
platforms to connect different smart home products and these include the Amazon Echo,
Google Home, Apple's Home Pod, and Samsung's SmartThings Hub. In addition to the
commercial systems, there are many non-proprietary, open-source ecosystems; including
Home Assistant, Open HAB and Domoticz.
Significant numbers of energy-consuming devices (e.g. lamps, household appliances, motors,
pumps, etc.) already integrate Internet connectivity, which can allow them to communicate
with utilities not only to balance power generation but also helps optimize the energy
consumption as a whole. These devices allow for remote control by users, or central
management via a cloud-based interface, and enable functions like scheduling (e.g., remotely
powering on or off heating systems, controlling ovens, changing lighting conditions, etc.)
.The smart grid is a utility-side IoT application; systems gather and act on energy and power
related information to improve the efficiency of the production and distribution of electricity.
Using advanced metering infrastructure (AMI) Internet-connected devices, electric utilities
not only collect data from end-users but also manage distribution automation devices like
transformers.
Another example of integrating the IoT is Living Lab which integrates and combines research
and innovation processes, establishing a public-private-people-partnership. There are
currently 320 Living Labs that use the IoT to collaborate and share knowledge between
stakeholders to co-create innovative and technological products. For companies to implement
and develop IoT services for smart cities, they need to have incentives. The governments play
key roles in smart city projects as changes in policies will help cities to implement the IoT
which provides effectiveness, efficiency, and accuracy of the resources that are being used.
For instance, the government provides tax incentives and cheap rent, improves public
transport, and offers an environment where start-up companies, creative industries, and
multinationals may co-create, share a common infrastructure and labor markets, and take
advantage of locally embedded technologies, production process, and transaction costs. The
relationship between the technology developers and governments who manage the city's
assets is key to providing open access to resources to users in an efficient way.
In this project, we have tried to implement the concept of IoT to monitor the temperature,
humidity and air quality of the surroundings
Hardware Components
1. Node MCU V3
2. DHT11 Sensor Module
3. MQ-135 Gas Sensor Module
4. Veroboard(KS100)
5. Breadboard
6. Connecting Wires
7. AC-DC Adapters
8. LEDs emitting green, yellow and red colours
9. Resistors
SOFTWARE COMPONENTS
1. Think Speak Cloud
2. Arduino IDE
Node MCU V3
Node MCU V3 is an open-source ESP8266 development kit, armed with the CH340G
USBTTL Serial chip. It has firmware that runs on ESP8266 Wi-Fi SoC from Es press if
Systems. Whilst cheaper, CH340 is super reliable even in industrial applications. It is tested
to be stable on all supported platforms as well. It can be simply coded in Arduino IDE. It has
a very low current consumption between 15 µA to 400 mA.
The pinout Diagram of NodeMC3 is shown in Fig. 2.1.
Temperature Measurement: For measuring the temperature, the DHT11 sensor uses a
negative temperature coefficient thermistor, which causes a decrease in its resistance value
with an increase in temperature. To get a wide range of resistance values, the sensor is made
up of semiconductor ceramics or polymers.
Veroboard (KS100)
Veroboard is the original prototyping board.
Sometimes referred to as ‘stripboard’ or ‘matrix
board’ these offer total flexibility for hard wiring
discrete components. Manufactured from a
copper clad laminate board or Epoxy based
substrate, it is offered in both single and double
sided formats. Vero boards are available in a
wide range of board sizes and in both imperial
and metric pitch – Veroboard is an ideal base for
circuit construction and offers even greater
adaptability using our range of terminal pins and (Fig 2.5 Veroboard assemblies.)
As with other stripboards, in using
Veroboard, components are suitably positioned and soldered to the conductors to form the
required circuit. Breaks can be made in the tracks, usually around holes, to divide the strips
into multiple electrical nodes enabling increased circuit complexity. This type of wiring board
may be used for initial electronic circuit development, to construct prototypes for bench
testing or in the production of complete electronic units in small quantities.
components to function, while an incandescent bulb can and usually does operate directly
from an unregulated DC or AC power source.
Resistors
A resistor is a passive two-terminal electrical
component that implements electrical resistance as
a circuit element. In electronic circuits, resistors
are used to reduce current flow, adjust signal
levels, to divide voltages, bias active elements,
and terminate transmission lines, among other
uses. High-power resistors that can dissipate many
watts of electrical power as heat may be used as
part of motor controls, in power distribution systems, or as test (Fig 2.8 Resistors)
loads for generators. Fixed resistors have resistances that only change slightly
with temperature, time or operating voltage.
Arduino IDE
The Arduino IDE is open-source
software, which is used to write
and upload code to the Arduino
boards. The IDE application is
suitable for different operating
systems such as Windows, Mac
OS X, and Linux. It supports the
programming languages C and
C++. Here, IDE stands for
STEP 1. Firstly, the calibration of the MQ-135 gas sensor module is done. The sensor
is set to preheat for 24 minutes. Then the software code is uploaded to the
Node MCU followed by the hardware circuit to calibrate the sensor has been
performed.
STEP 4. The final working code is then uploaded to the Node MCU.
STEP 5. Finally, the complete hardware circuit is implemented.
The software codes and the hardware circuits are described in the following chapters.
Chapter 3
HARDWARE MODEL
STEP 1 : The Vcc pin of the DHT11 sensor module was connected with the VU pin of
Node MCU.
STEP 2 : The Gnd pin of the DHT11 sensor module was connected with the Gnd pin
of Node MCU.
STEP 3 : The Node MCU is powered with a 12V DC via AC-DC adapter for 20 minutes.
STEP 4 : The setup was then disconnected.
13 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
STEP 1 : The Vcc pin of the MQ-135 gas sensor module was connected with the VU pin
of Node MCU.
STEP 2 : The Gnd pin of the MQ-135 gas sensor module was connected with the Gnd pin
of Node MCU.
STEP 3 : The Node MCU is powered with a 12V DC via AC-DC adapter for a day.
STEP 4 : The setup was then disconnected.
The following steps were performed to calibrate the MQ-135 gas sensor module
STEP 1 : The Vcc pin of the MQ-135 gas sensor module was connected with the VU pin
of Node MCU.
STEP 2 : The Gnd pin of the MQ-135 gas sensor module was connected with the Gnd pin
of Node MCU.
STEP 3 : The analog DATA pin of the MQ-135 gas sensor module was connected with
the A0 Pin of the Node MCU.
14 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
STEP 4 : The software code to calibrate the sensor is then uploaded to the Node MCU
and the value of R0 in fresh air is collected from the serial monitor of the Arduino IDE.
STEP 5 : The setup was then disconnected.
STEP 1 : The Vcc pin of the MQ-135 gas sensor module and DHT11 sensor module was
connected via Veroboard with an adapter delivering around 5V.
STEP 2 : The Gnd pin of the MQ-135 gas sensor module, DHT11 sensor module and the
cathode of the LED indicators was connected via Veroboard with the Gnd pin of the
Node MCU.
STEP 3 : The analog DATA pin of the MQ-135 gas sensor module was connected with
the A0 Pin of the Node MCU.
STEP 4 : The DATA pin of the DHT11 sensor module was connected with the D0 pin of
the Node MCU.
STEP 5 : The anode of the three LED indicators (green, yellow, and red) were connected
to the D2, D3, and D4 pins of the Node MCU respectively.
STEP 6 : The software code to execute the project was then uploaded to the Node MCU.
15 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
STEP 7 : The setup was then powered with 9V DC via AC-DC adapter.
It can be now turned ON/OFF as per the requirements. Fig 3.4 represents the circuit diagram
of the setup.
16 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Chapter 4
SOFTWARE IMPLEMENTATION
17 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
I=V/R………………………… ……(1)
From Fig 4.1, we can obtain the output voltage at the load resistor using the value obtained
for I and Ohm’s Law at a constant temperature, V = I x R.
18 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Eqn. 9 helps us to find the internal sensor resistance for fresh air.
From the graph shown in fig 4.2, we can see that the resistance ratio in fresh air is a
constant:
RS / R0 = 3.6…………………………..………… (10)
Value 3.6 which is mentioned in eqn. 10 is depicted in the datasheet shown in Fig 4.2. To
calculate R0, we will need to find the value of the RS in the fresh air. This will be done by
taking the analog average readings from the sensor and converting them to voltage. Then we
will use the RS formula to find R0. First of all, we will treat the lines as if they were linear.
This way we can use one formula that linearly relates the ratio and the concentration. By
doing so, we can find the concentration of a gas at any ratio value even outside of the graph’s
boundaries. The formula we will be using is the equation for a line, but for a log-log scale.
From above Figure 4.2, we try to derive the following calculations.
y = mx + b…………………..…………………….(11)
19 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Let’s find the slope. To do so, we need to choose 2 points from the graph. In our case, we
chose the points (200,2.6) and (10000,0.75). The formula to calculate slope m(here) is the
following:
m = −0.318……………………………………………………(16)
Now that we have m, we can calculate the y-intercept. To do so, we need to choose one
point from the graph (once again from the CO2 line). In our case, we chose (5000,0.9)
b=1.13 ((19)
Now that we have m and b, we can find the gas concentration for any ratio with the
following formula:
However, in order to get the real value of the gas concentration according to the log-log plot
we need to find the inverse log of x:
x = 10 ^ [{log(y)−b] / m] ……………………………………(21)
Using eqns. 9 and 21, we will be able to convert the sensor output values into PPM (Parts per
Million). Now we developed the Code and flashed into the Node MCU giving proper
connections.
20 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
void setup()
{
Serial. begin(9600); //Baud rate
Pin Mode(A0,INPUT);
}
void loop()
{
float sensor_volt; //Define variable for sensor
voltage float RS_air; //Define variable for sensor
resistance float R0; //Define variable for R0
float sensorValue=0.0; //Define variable for analog readings
Serial.print("Sensor Reading = ");
Serial.println(analogRead(A0));
#include <ESP8266WiFi.h>
#include <DHT.h>
#include <Thing Speak.h>
21 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
WiFiClient client;
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED_GREEN,OUTPUT);
pinMode(LED_YELLOW,OUTPUT);
pinMode(LED_RED,OUTPUT);
pinMode(MQ_135, INPUT);
WiFi.begin("WiFi_Name", "WiFi_Password");
while(WiFi.status() != WL_CONNECTED)
{
delay(200);
Serial.print(".");
}
Serial.println();
Serial.println("Node MCU is
connected!");
Serial.println(WiFi.localIP());
dht.begin();
Thing Speak.begin(client);
}
void loop()
{
float sensor_volt; //Define variable for sensor voltage
float RS_gas; //Define variable for sensor resistance
float ratio; //Define variable for ratio
int sensorValue;//Variable to store the analog values from MQ-135
float h;
float t;
float ppm_log; //Get ppm value in linear scale according to the the ratio
value float ppm; //Convert ppm value to log scale
h = dht.readHumidity();
delay(4000);
t = dht.readTemperature();
22 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
delay(4000);
sensorValue = analogRead(gas_sensor); //Read analog values of sensor
sensor_volt = sensorValue*(5.0/1023.0); //Convert analog values to voltage
RS_gas = ((5.0*1.0)/sensor_volt)-1.0; //Get value of RS in a gas
ratio = RS_gas/R0; // Get ratio RS_gas/RS_air
ppm_log = (log10(ratio)-b)/m; //Get ppm value in linear scale according to the ratio value
ppm = pow(10, ppm_log); //Convert ppm value to log scale
ThingSpeak.writeField(myChannelNumber, 1, t, myWriteAPIKey);
delay(20000);
ThingSpeak.writeField(myChannelNumber, 2, h, myWriteAPIKey);
delay(20000);
ThingSpeak.writeField(myChannelNumber, 3, ppm, myWriteAPIKey);
delay(20000);
if(ppm<=100)
{
digitalWrite(LED_GREEN,HIGH);
digitalWrite(LED_YELLOW,LOW);
digitalWrite(LED_RED,LOW);
}
else if(ppm<=200)
{
digitalWrite(LED_GREEN,LOW);
digitalWrite(LED_YELLOW,HIGH);
digitalWrite(LED_RED,LOW);
}
else
{
digitalWrite(LED_GREEN,LOW);
digitalWrite(LED_YELLOW,LOW);
digitalWrite(LED_RED,HIGH);
}
delay(2000);
}
23 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Chapter 5
RESULTS
The working of the designed prototype has been investigated for the 5 sets of experiments as
described in the following sections
EXPERIMENT 1:
Aim: To demonstrate the working of the system in a warm and humid outdoor atmosphere.
Experimental Condition: The experiment was performed on a warm sunny day in a local
outdoor area.
24 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
Setup:
Conclusion: We have taken the reference from the Samsung mobile weather app for
verifying the values. It matched with a +1.20 error with the temperature data, +5 error with
the humidity data and +0.11 error with the PPM data. Hence, we can conclude that the setup
has measured the temperature and humidity around the setup area successfully.
EXPERIMENT 2:
Aim: To demonstrate the working of the system in the presence of alcoholic gases.
25 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
Conclusion:
We can observe from the results that the presence of alcohol vapours near the setup can be
easily detected by the system. We have taken the reference from the Samsung mobile weather
app for verifying the values. It matched with a +1.30 error with the temperature data, +5 error
with the humidity data and +0.25 error with the PPM data. Hence, it can be concluded that
we can detect the presence of alcoholic vapours with the help of this monitoring system.
EXPERIMENT 3:
Experimental Condition: The experiment was performed in the presence of smoke coming
from an incense stick placed near the setup.
26 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
Setup:
Conclusion:
27 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
We can observe from the results that the presence of smoke near the setup can be easily
detected by the system. We have taken the reference from the Samsung mobile weather app
for verifying the values. It matched with a +1.80 error with the temperature data, +4 error
with the humidity data and -0.7 error with the PPM data. Hence, it can be concluded that we
can detect the presence of smoke with the help of this monitoring system.
EXPERIMENT 4:
Aim: To demonstrate the working of the system in a warm and humid outdoor atmosphere.
28 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
Setup:
Conclusion:
We have taken the reference from the Samsung mobile weather app for verifying the values.
It matched with a +1.20 error with the temperature data, +5 error with the humidity data and
0.08 error with the PPM data. Hence, we can conclude that the setup has measured the
temperature and humidity around the setup area successfully.
EXPERIMENT 5:
29 | Page
IOT BASED AIR POLLUTION MONITORING SYSTEM
Setup:
Conclusion:
We have taken the reference from the Samsung mobile weather app for verifying the values.
It matched with a +0.6 error with the temperature data, +2 error with the humidity data and -
0.03 error with the PPM data. Hence, we can conclude that the setup has measured the
temperature and humidity around the setup area successfully.
30 | Page
Chapter 6
CONCLUSION
In this project IoT based on measurement and display of Air Quality Index (AQI), Humidity
and Temperature of the atmosphere have been performed. From the information obtained
from the project, it is possible to calculate Air Quality in PPM. The disadvantage of the
MQ135 sensor is that specifically it can’t tell the Carbon Monoxide or Carbon Dioxide level
in the atmosphere, but the advantage of MQ135 is that it is able to detect smoke, CO, CO2,
NH4, etc harmful gases.
After performing several experiments, it can be easily concluded that the setup is able to
measure the air quality in ppm, the temperature in Celsius and humidity in percentage with
considerable accuracy. The results obtained from the experiments are verified through
Google data. Moreover, the led indicators help us to detect the air quality level around the
setup. However, the project experiences a drawback that is it cannot measure the ppm values
of the pollutant components separately. This could have been improved by adding gas sensors
for different pollutants. But eventually, it would increase the cost of the setup and not be a
necessary provision to monitor the air quality. Since it’s an IOT-based project, it will require
a stable internet connection for uploading the data to the Thing Speak cloud. Therefore, it is
possible to conclude that the designed prototype can be utilized for air quality, humidity and
temperature of the surrounding atmosphere successfully.
31 |
IOT BASED AIR POLLUTION MONITORING SYSTEM
REFERENCES
[1] https://gaslab.com/blogs/articles/carbon-monoxide-levels
[2] https://www.instructables.com/Measuring-Humidity-Using-Sensor-DHT11
[3] https://pdf1.alldatasheet.com/datasheet-pdf/view/1307647/WINSEN/MQ135.html
[4] https://components101.com/development-boards/nodemcu-esp8266-pinout-
featuresand-datasheet
[5] https://www.arduino.cc
[6] https://thingspeak.com
[ 7 ] Pasha, S. (2016). Thing Speak based sensing and monitoring system for IoT with Matlab
Analysis. International Journal of New Technology and Research, 2(6).
[ 8 ] Kumar, N. S., Vuayalakshmi, B., Prarthana, R. J., & Shankar, A. (2016, November).
IOT based smart garbage alert system using Arduino UNO. In 2016 IEEE Region 10
Conference (TENCON) (pp. 1028-1034). IEEE.
[ 9 ] IoT based Air Quality monitoring system using MQ135 & MQ7 with Machine Learning
analysis by Kinnera Bharath Kumar Sai M.Tech CSE VIT University, Vellore Subhaditya
Mukherjee B.Tech CSE VIT University, Vellore Dr. Parveen Sultana H Associate
Professor Department of CSE, VIT University.
[ 10 ] https://www.codrey.com/electronic-circuits/how-to-use-mq-135-gas-sensor
32 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Page
Appendix
Description:
33 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Control Pins EN, RST The pin and the button reset the microcontroller
GPIO Pins GPIO1 to Node MCU has 16 general purpose input-output pins on
GPIO16 its board
SPI Pins SD1, CMD, Node MCU has four pins available
for SPI communication.
SD0, CLK
UART Pins TXD0, RXD0, Node MCU has two UART interfaces, UART0 (RXD0
TXD2, RXD2 & TXD0) and UART1 (RXD1 & TXD1). UART1 is
used to upload the firmware/program.
I2C Pins Node MCU has I2C functionality support but due to the
internal functionality of these pins, you have to find
which pin is I2C.
34 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
The ESP8266WiFi library provides a wide collection of C++ methods (functions) and
properties to configure and operate an ESP8266 module.
The DHT sensor library provides a wide collection of C++ methods (functions) and properties
to configure and operate the DHT11 sensor module.
The Thing Speak library provides a wide collection of C++ methods (functions) and
properties to configure and operate the Thing Speak cloud.
35 | P a g e
IOT BASED AIR POLLUTION MONITORING SYSTEM
Total 982
36 | P a g e