Download as pdf or txt
Download as pdf or txt
You are on page 1of 37

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Belagavi-590018

MINI PROJECT REPORT


ON

ALERT AND MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL
Submi ed in the par al fulfillment of the requirement for the award of the

Degree

BACHELOR OF ENGINEERING
IN
ELECTRONICS AND COMMUNICATION ENGINEERING
Submi ed by
SHRUTI SAHAY 1BI20EC140
SRIYA DIPTEE 1BI20EC151
SRUTHI K N S CHINTA 1BI20EC153
SUSHANT SHIL 1BI20EC157

Under the guidance of

Prof. J.C.Narayanas
Assistant Professor
Department of Electronics and Communication
Engineering

Carried out at
BANGALORE INSTITUTE OF TECHNOLOGY
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING K R Road, V V
Pura, Bengaluru - 560 004
2023-2024
BANGALORE INSTITUTE OF TECHNOLOGY
(Affiliated to Visvesvaraya Technological University, Belagavi)
K R Road, V V Pura, Bengaluru-560 004

CERTIFICATE
Certified that the Mini project entitled “Alert and monitoring system for air pollution and noise levels”
work carried out by Shruti Sahay(1BI20EC140), Sriya Diptee(1BI20EC151), Sruthi K N S Chinta
(1BI20EC153), Sushant Shil (1BI20EC157) Bonafide student of Bangalore Institute of Technology in
partial fulfillment for the award of Bachelor of Engineering Degree in Electronics and Telecommunication
Engineering of the Visvesvaraya Technological University, Belagavi during the year 2021-2022. It is
certified that all corrections/suggestions indicated for internal assessment have been incorporated in the
report deposited in the Department Library. The Mini project Report has been approved as it satisfies the
academic requirements in respect of Mini project work prescribed for the said Degree.

Guide HOD
Prof. J.C.Narayanaswamy Dr.Hemanth Kumar A R

External Viva:

Name of the Examiners Signatures

1. Internal:

2. External:
ACKNOWLEDGEMENT

It would be our privilege to express our heartfelt gratitude and respect to thank all those who guided us in
the completion of the Mini Project work. We are highly indebted to Rajya Vokkaligara Sangha trust for
introducing a great educational institute for studies.

We would like to thank our Head of the Department, Department of Electronics and Communication
Engineering, Dr.HEMANTH KUMAR A.R, for his constant encouragement and support throughout
the course of engineering at the institution.

We would like to express our heartfelt gratitude to our mini project coordinator and internal guide Prof.
J.C.Narayanaswamy Associate Professor, Department of Electronics and Communication
Engineering, for his constant guidance for the project.

We are grateful to all the teaching and non-teaching staff of the Department of Electronics and
Communication Engineering, for their constant encouragement and support.
ABSTRACT
Noise pollution impacts millions of people daily. The most common health problem it causes is Noise
Induced Hearing Loss (NIHL). Exposure to loud noise can also cause high blood pressure, heart disease,
sleep disturbances, and stress. Many children who live near noisy airports or streets have been found to
suffer from stress and other problems, such as impairments in memory, attention level, and reading skill.
Studies have shown that loud noises can cause caterpillars' dorsal vessels (the insect equivalent of a heart)
to beat faster, and cause bluebirds to have fewer chicks. Animals use sound for a variety of reasons,
including to navigate, find food, attract mates, and avoid predators.

Pollution accounted for nearly 1.7m premature deaths in India in 2019, or 18% of all deaths, according
to a study that lays bare the human cost of the country’s toxic urban air. The data shows that pollution-
related deaths in India are on the rise, increasing from 1.24m in 2017 to 1.67m in 2019.Six of India’s
cities are among the top 10 most polluted in the world, according to a recent World Air Quality report,
with Delhi being top in the list. Hence, this project aims at detecting the harmful levels of gases,
temperature and noise levels present in the environment and alert the higher authorities to take quick
action to suppress its adverse effects on ecosystem.
TABLE OF CONTENTS 

SL NO. TOPIC PG NO.


ACKNOWLEDGEMENT i
ABSTRACT ii
TABLE OF CONTENTS iii
LIST OF FIGURES iv
1. INTRODUCTION 1
1.1 OBJECTIVES 2
1.2 AIM OF THE PROJECT 2
2. PROPOSED METHODOLOGY 3
2.1 BLOCK DIAGRAM 3-4
2.2 SCHEMATIC DIAGRAM 5
2.3 FLOW CHART 5
3. HARDWARE REQUIREMENTS 6
3.1 ARDUINO UNO BOARD 6
3.2 DHT11 SENSOR 7
3.3 AIR QUALITY SENSOR 8
3.4 SOUND SENSOR 9
3.5 WIFI MODULE 10
3.6 CARBON MONOXIDE SENSOR 11
3.7 GAS SENSOR 12
3.8 METHANE AND CNG SENSOR 13
4. SOFTWARE REQUIREMENTS 14
4.1 ARDUINO IDE SOFTWARE 14
4.2 THINGS SPEAK 15-16
5. RESULT 17
5.1 EXPERIMENTAL RESULTS 17
6. CONCLUSION AND FUTURE WORK 18
7. REFERENCES 19
8. APPENDIX 20
LIST OF FIGURES

SL NO. FIGURE NAME PG NO.

1.  Block diagram  3-4

2. Schematic connections of circuit 5

3. Flow chart  5

4. Arduino UNO board 6

5. DHT11 sensor  7

6. Air quality sensor  8

7. Sound sensor  9

8. Wifi module 10

9. Carbon monoxide sensor 11

10. Gas sensor 12

11. Methane and CNG sensor 13

10. Arduino IDE software 14

11. Things speak 16

12. Experimental results 17

13. Conclusion and future work 18


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

CHAPTER 1

INTRODUCTION
Air pollution and noise pollution have a negative impact on all of society — but some groups are
more affected than others. Lower socioeconomic status is generally associated with poorer
health, and both air and noise pollution contribute to a wide range of other factors influencing
human health. Noise pollution impacts millions of people daily. The most common health
problem it causes is Noise Induced Hearing Loss (NIHL). Exposure to loud noise can also cause
high blood pressure, heart disease, sleep disturbances, and stress.

These health problems can affect all age groups, especially children. Many children who live
near noisy airports or streets have been found to suffer from stress and other problem such as
impairments in memory, attention level, according to the World Health Organization (WHO),
some of the world's most polluted cities are Karachi, Pakistan; New Delhi, India; Beijing, China;
Lima, Peru; and Cairo, Egypt. Nearly 2.5 million people (about twice the population of Hawaii)
die worldwide each year from the effects of outdoor or indoor air pollution. At the end of October
1948, the communities of Donora and Webster in Pennsylvania were visited by a smog that
changed the face of environmental protection in the United States. Conservative estimates
showed that 20 individuals died, while an additional 5900—43% of the population of Donora—
were affected by the smog.

Since pollution parameters are vital to maintain a healthy environment, we suggest a affordable
Arduino based hardware which is integrated with IoT for real time monitoring and alert system
of the air and noise pollution parameter system. This monitors the real time data and collects it
through various sensors used and sends it to the cloud. The data is collected from the cloud to
thingsspeak.com where the data is pictorially represented in the form of graphs. In addition to
this, if the values cross the threshold value an alert email is given.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 1


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

1.1 OBJECTIVES

 Monitor air pollution and noise level: The sensors used in the project will measure
the level of pollutants and noise in the air and transmit the data to the cloud
platform.
 Provide real-time data: The data will be displayed on a cloud platform such as
Thing Speak, where it can be accessed by anyone with an internet connection.
 Raise awareness: By providing real-time data on air pollution and noise levels, the
project aims to raise awareness about the harmful effects of pollution.
 Support decision-making: The data collected by the project can be used by
policymakers to make informed decisions on pollution control measures.

1.2 AIM OF THE PROJECT

 Develop a real-time monitoring system for air pollution and noise levels.

 Use sensors to measure the level of pollutants and noise in the air.

 Transmit the collected data to a cloud platform (Thing Speak) in real-time.

 Identify patterns and trends in air pollution and noise level to help in identifying
the sources of pollution and taking corrective actions to reduce pollution.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 2


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

CHAPTER 2
PROPOSED METHODOLOGY
The proposed system consists of two main parts: hardware and software. The hardware
includes temperature and humidity sensors, air quality sensors, and sound sensors, a power
supply and an Arduino UNO. The software includes the Things Speak server and the Arduino
Software (IDE) as shown in figure 2.1.

The hardware consists of sensors that measure values in real time, an Arduino UNO that
converts analogue values to digital values.

The Arduino UNO, to which the sensors are linked, processes the data sensed. It helps to
convert analogue values to digital ones and is programmed using the Arduino IDE. The sensors
will continuously measure the level of pollutants and noise in the air, and the data will be
acquired using an IoT device such as an ESP8266 or Arduino. The data will be stored on the
device until it is ready to be transmitted to the cloud platform. The temperature sensor ranges
from –20 to 60 degrees Celsius. The acquired sensor data will be transmitted to the Thing
Speak cloud platform. The Thing Speak platform will receive and store the sensor data in real-
time, and it will be displayed on a dashboard for data visualization. Users can access the
dashboard to view real-time data on air pollution and noise levels.
2.1 Block diagram

Figure 2.1 Block diagram

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 3


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Temperature and Humidity sensor:


The temperature and humidity sensor (DHT11) are used to measure the temperature and
humidity of the surrounding.

MCQ135 sensor:
The MCQ135 is an air quality sensor which is sensitive to ammonia, sulphide and
benzene steam gases. It has good sensitivity and long-life span, low cost and simple drive
circuit. The sound sensors detect the sound levels to display it.

MQ7 sensor:
High sensitivity to carbon monoxide. Stable and long life. They are used in gas detecting
equipment for carbon monoxide (CO) in families and industry or car.

MQ4 sensor:
High sensitivity to CH4,Natural gas. Small sensitivity to alcohol, smoke. Fast response.
Stable and long life. Simple drive circuit. They are used in gas leakage detecting equipment
in family and industry, are suitable for detecting CH4, Natural gas. LNG, avoid the noise of
alcohol and cooking fumes and cigarette smoke.

MQ2 sensor:
Wide detecting scope Fast response and High sensitivity. Stable and long-life Simple drive
circuit. They are used in gas leakage detecting equipment in family and industry, are
suitable for detecting LPG, I-butane, propane, methane, alcohol, Hydrogen, smoke.

Thing Speak:
Thing Speak server is an open data platform and API for the Internet of Things that collects,
store, analyze, visualize, and act on data from sensors.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 4


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

2.2 Schematic diagram:

2.3 Flow chart:

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 5


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

CHAPTER 3
HARDWARE DESCRIPTION
COMPONENTS REQUIRED
 Arduino UNO board
 Temperature and humidity sensor
 Air quality sensor

 Carbon monoxide gas sensor


 Smoke and Gas Detector sensor
 Methane CNG gas sensor
 Wi-Fi module
 Thingspeak.com
 Jumpers Wires/Cables

3.1 Arduino UNO board


Arduino is an open-source prototyping platform based on easy-to-use hardware and software. It
embodies both a physical programmable circuit board and a piece of software, or IDE that runs
on your computer. Arduino is a microcontroller based prototyping board which can be used in
developing digital devices that can read inputs and turn it into output. The Arduino board can be
programmed to do anything by simply programming the microcontroller on board using a set of
instructions.

Figure 3.1.1 Arduino UNO board

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 6


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

SPECIFICATIONS

1. Microcontroller: ATmega328 SMD


2. Operating voltage: 5V
3. Input voltage: 7-12V DC
4. Digital input/output pins: 14
5. Analog input pins: 6
6. DC current per input/output pin: 40 mA
7. Flash memory: 32KB (ATmega328) of which 0.5 KB used by bootloader
8. SRAM: 2KB
9. EEPROM: 1KB
10.Clock speed: 16MHZ

3.2 DHT11 sensor

The DHT11 is a commonly used Temperature and humidity sensor that comes with a dedicated
NTC to measure temperature and an 8-bit microcontroller to output the values of temperature and
humidity as serial data. The DHT11 is a commonly used Temperature and humidity sensor.
The sensor comes with a dedicated NTC to measure temperature and an 8-bit microcontroller to
output the values of temperature and humidity as serial data. The sensor can measure temperature
from 0°C to 50°C and humidity from 20% to 90% with an accuracy of ±1°C and ±1%.

Figure 3.1.2 DHT11 sensor

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 7


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

SPECIFICATIONS

 Operating Voltage: 3.5V to 5.5V


 Operating current: 0.3mA (measuring) 60uA (standby)
 Output: Serial data
 Temperature Range: 0°C to 50°C
 Humidity Range: 20% to 90%
 Resolution: Temperature and Humidity both are 16-bit
 Accuracy: ±1°C and ±1%

3.3 Air quality sensor

The MQ-135 Gas sensor can detect gases like Ammonia (NH3), sulfur (S), Benzene (C6H6),
CO2, and other harmful gases and smoke. Like other MQ series gas sensors, this sensor also has a
digital and analog output pin. When the level of these gases goes beyond a threshold limit in the
air the digital pin goes high. This threshold value can be set by using the on-board potentiometer.
The analog output pin outputs an analog voltage which can be used to approximate the level of
these gases in the atmosphere.
The MQ135 air quality sensor module operates at 5V and consumes around 150mA. It requires
some pre-heating before it can give accurate results.

Figure 3.1.3 Air quality sensor (MQ135)

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 8


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

SPECIFICATIONS

1. Operating Voltage: 2.5V to 5.0V


2. Power consumption: 150mA
3. Detect/Measure: NH3, Nox, CO2, Alcohol, Benzene, Smoke
4. Typical operating Voltage: 5V
5. Digital Output: 0V to 5V (TTL Logic) (5V Vcc)
6. Analog Output: 0-5V (5V Vcc)

3.4 Sound sensor

Sound sensors, also known as sound level meters or acoustic sensors, can be used in air pollution
and noise level monitoring systems to measure the level of noise in the environment. They can
detect sound waves and convert them into electrical signals, which can be used to determine the
sound pressure level in decibels (dB).

Figure 3.1.4 Sound sensor

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 9


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

SPECIFICATIONS
1. Operating Voltage: 5V
2. Operating current: 30mA
3. Response time: <500msec
4. Operating Temperature: -30~+80°C

3.5 Wi-Fi module


A Wi-Fi module can be used in an air pollution and noise level monitoring system to transmit the
data collected by the sensors to a cloud platform such as Thing Speak. Wi-Fi is a wireless
communication protocol that allows devices to connect to the internet or local network without the
need for cables.

By using a Wi-Fi module, the data collected by the sensors can be transmitted in real-time to the
cloud platform, where it can be analyzed and visualized. This allows for remote monitoring and
management of the air pollution and noise level monitoring system and provides access to the data
from anywhere with an internet connection.

Figure 3.1.5 Wi-Fi module


SPECIFICATIONS
1. Operating Voltage: 3.3~5V
2. Operating current: 30mA
3. Operating Temperature: -30~+80
4. Digital I/O pins: 11
5. Analog input pins: 1
6. Clock Speed: 80MHz

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 10


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

3.6 MQ7 Sensor


High sensitivity to carbon monoxide. Stable and long life. They are used in gas detecting
equipment for carbon monoxide (CO) in families and industry or cars. The sensor can be
connected to a microcontroller such as an Arduino or ESP32, which can then transmit the
data to a cloud platform such as Thing Speak using a Wi-Fi or cellular module.
By including an MQ-7 sensor in an air pollution and noise level monitoring system, we can
measure and track the level of carbon monoxide in real-time, and use the data to identify
areas with high levels of carbon monoxide.

Figure 3.1.6 MQ7 Sensor

SPECIFICATIONS

 Detection gas: Carbon Monoxide (CO)


 Detection range: 10 to 500 ppm
 Sensitivity: 1.5 ± 0.3 mV/ppm
 Operating voltage: 5V DC
 Operating current: <150mA
 Operating temperature: -10°C to 50°C

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 11


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

3.7 MQ2 Sensor

The MQ-2 sensor is a type of gas sensor that can be used to detect various types of gases in the
air, including smoke, propane, butane, methane, alcohol, and hydrogen. The sensor works by
detecting the level of the gas in the air using a tin dioxide (SnO2) semiconductor element. When
the gas is present, it reacts with the SnO2 element, causing changes in the resistance of the sensor.
These changes in resistance are then measured and converted into an output voltage signal, which
can be processed by a microcontroller.

Figure 3.1.7 MQ2 Sensor

SPECIFICATIONS

 Detection gases: Smoke, propane, butane, methane, alcohol, hydrogen


 Detection range: 300 to 10,000 ppm (smoke), 200 to 10,000 ppm (propane), 300
to 10,000 ppm (butane), 300 to 10,000 ppm (methane), 10 to 1,000 ppm
(alcohol), 1 to 1,000 ppm (hydrogen)
 Sensitivity: 0.6 to 1.0 mV/ppm
 Operating voltage: 5V DC
 Operating current: <150mA
 Operating temperature: -10°C to 50°C

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 12


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

3.8 MQ4 Sensor


The MQ-4 sensor is a type of gas sensor that can be used to detect various types of gases in the
air, including methane (CH4) and natural gas. The sensor works by detecting the level of the gas
in the air using a tin dioxide (SnO2) semiconductor element. When the gas is present, it reacts with
the SnO2 element, causing changes in the resistance of the sensor. These changes in resistance are
then measured and converted into an output voltage signal, which can be processed by a
microcontroller.

Figure 3.1.8 MQ4 Sensor

SPECIFICATIONS

 Detection gas: Methane (CH4), natural gas


 Detection range: 200 to 10,000 ppm
 Sensitivity: 0.6 to 1.0 mV/ppm
 Operating voltage: 5V DC
 Operating current: <150mA
 Operating temperature: -10°C to 50°C

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 13


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Chapter 4
SOFTWARE REQUIREMENTS
4.1 Arduino ide software:

The program code written in Arduino IDE is known as a sketch. This IDE
contains the following parts in it.
 Text editor: This is where the interpreted code can be written using a
simplified version of C++ programming language.
 Message section: It shows errors and gives feedback on saving and
exporting the code.
 Text: The soothe displays text output by the Arduino environment along
with complete error messages and other information
 Console Toolbar: This toolbar encompasses various buttons like Verify,
Upload, New, Open, Save and Serial Monitor. On the bottom right-hand
corner of the window there displays the Development Board and the Serial
Port in use.

Figure 4.1: Arduino IDE software icon

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 14


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Figure 4.2: Arduino IDE Sketch book

4.2 THING SPEAK

Thing Speak is an Internet of Things (IoT) platform that allows users to collect, store, analyze, and
visualize data from connected devices. It is a free and open-source platform that can be used to
build IoT applications, especially those that require real-time data monitoring and analysis. Here
are some features of Thing Speak:
Features:
 Easy to use API for device connectivity
 Real-time data visualization and analytics
 Customizable charts, gauges, and maps for data representation
 Integration with MATLAB for data analysis
 Email alerts and notifications for data thresholds and events
 Remote control and interaction with connected devices
 Data security and privacy through SSL encryption and user access control

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 15


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Figure 4.3 Thing Speak

Features

 Easy to use API for device connectivity


 Real-time data visualization and analytics
 Customizable charts, gauges, and maps for data representation
 Integration with MATLAB for data analysis
 Email alerts and notifications for data thresholds and events
 Remote control and interaction with connected devices
 Data security and privacy through SSL encryption and user access control

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 1


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

CHAPTER 5
RESULTS

5.1 Experimental results


The project successfully collected temperature, humidity, smoke, sound, and air quality
data using the sensors and sent it to ThingSpeak.com for visualization and analysis. The
data collected was accurate and reliable, and the system worked continuously without any
major issues. The data was collected over a period of one month and was analyzed using
graphs and charts.

Figure 5.1: Experimental results

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 17


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

CHAPTER 6

CONCLUSION AND FUTURE WORK

The project demonstrates the use of sensors such as the DHT11 sensor for temperature and
humidity measurement, smoke sensor for detecting smoke, sound sensor for measuring sound
levels, and air quality sensor for monitoring air quality.

The data from these sensors are collected and transmitted to the Thing Speak platform, which
provides a graphical representation of the data and enables users to monitor the environmental
parameters remotely.

In conclusion, the project is a great example of how IoT technology can be used to monitor
and control various environmental parameters.

This project has a lot of potential for future development and improvement. Here are some
possible directions for future work on this project:

1. Integration with other IoT devices.


2. Machine learning-based analysis.
3. Mobile application.
4. Cloud-based analytics.
5. Integration with smart home systems.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 18


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

REFERENCES

 [1] Smith, John. "Real-Time Monitoring of Indoor Environmental Parameters." May


2023.
https://ieeexplore.ieee.org/document/9316050.

 [2] Samer Mansour; Nidal Nasser; Lutful karim; Asmaa Ali. "Wireless Sensor Network-
based air quality monitoring system". February 2014
https://ieeexplore.ieee.org/document/6785394/authors#authors.

 [3] Sayantani Bhattacharya; S. Sridevi; R. Pitchiah. "Indoor air quality monitoring using
wireless sensor network“. December 2012
https://ieeexplore.ieee.org/document/6461713.

 [4] M Pyingkodi; N R Wilfred Blessing; K Thenmozhi; K Kanimozhi; L Pavithira; P K


Sandhya Balakrishnan.
"A Smart Air Pollutants Monitoring System Using IOT Technologies" February 2023
https://ieeexplore.ieee.org/document/10100535.

 [5] Mashael M. Khayyat; Omar A. Aboulola. "Implementing an Ambient Air Quality


Monitoring System in Spaces with Inadequate Ventilation using the Internet of Things"
February 2023
https://ieeexplore.ieee.org/document/10087523.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 19


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Appendix

Program

#include <DHT.h>
#include <SoftwareSerial.h>
#include <dht.h>
#define DHTTYPE DHT11 // we are using the DHT11 sensor
#define DHTPIN A2
DHT dht(DHTPIN, DHTTYPE);
int smokeA1 = A1;
float sensorValue;
const int AOUTpin = A0; //the AOUT pin of the CO sensor goes into analog pin A0 of the
arduino
const int DOUTpin = 8; //the DOUT pin of the CO sensor goes into digital pin D8 of the
arduino
//const int ledPin=13;//the anode of the LED connects to digital pin D13 of the arduino

int limit;
int value;
const int A3_Pin = 3; // Connect AO of MQ4 with Analog channel 0 pin (A0) of Arduino
const int DO_Pin = 7; // Connect DO of MQ4 with Digital pin 8 (D8) of Arduino
int threshold_value; // A variable to store digital output of MQ4
int A3_Out; // stores analog output of MQ4 sensor
int sensorValuee;
int digitalValue;
int Analog_Pin = A5;
int Digital_Pin = 6;
#define RX 2
#define TX 3
String AP = "320"; // AP NAME
String PASS = "jatin@123"; // AP PASSWORD
String API = "6FURLLNKTXE95C0C"; // Write API KEY
String HOST = "api.thingspeak.com";
String PORT = "80";
String field = "field1";
int countTrueCommand;
int countTimeCommand;

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 20


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

boolean found = false;


int valSensor = 1;
SoftwareSerial esp8266(RX, TX);

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
esp8266.begin(115200);
sendCommand("AT", 5, "OK");
sendCommand("AT+CWMODE=1", 5, "OK");
sendCommand("AT+CWJAP=\"" + AP + "\",\"" + PASS + "\"", 20, "OK");

dht.begin();
pinMode (smokeA1, INPUT);
Serial.println("Gas sensor is giving you a warning now");
delay(1000); //Allows the MQ2 Sensor some time to react
pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
pinMode(DO_Pin, INPUT); // Configure D8 pin as a digital input pin
Serial.begin(9600); // sets the serial port to 9600
pinMode(13, INPUT);
pinMode(Analog_Pin, INPUT);
pinMode(Digital_Pin, INPUT);

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 21


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

void loop() {
delay(100);
String getData = "GET /update?api_key=" + API + "&field1=" + getTemperaturevalue() +
"&field2=" + getHumidvalue() + "&field3=" + getsmokevalue() + "&field4=" + getcovalue() +
"&field5=" + getnaturalgasvalue() + "&field6=" + getairpollutionvalue() + "&field7=" +
getsoundvalue();
sendCommand("AT+CIPMUX=1", 5, "OK");
sendCommand("AT+CIPSTART=0,\"TCP\",\"" + HOST + "\"," + PORT, 15, "OK");
sendCommand("AT+CIPSEND=0," + String(getData.length() + 4), 4, ">");
esp8266.println(getData); delay(1500); countTrueCommand++;
sendCommand("AT+CIPCLOSE=0", 5, "OK");
}

/////////////////////////////////////////////// FUNCTIONS//////////////////////////////////////////////////////

String getTemperaturevalue() {

// dht.read(DHTPIN);
Serial.print("Temperature(C)=");
float t = dht.readTemperature();
Serial.println(t);
delay(50);
Serial.println("----------------------------------------------------------------");
return String(t);

}
String getHumidvalue()
{
//dht.read(DHTPIN);
Serial.print("Humidity in%=");
float h = dht.readHumidity();
Serial.println(h);
delay(50);
return String(h);
}
String getsmokevalue() {
sensorValue = analogRead(smokeA1); // read analog pin A0

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 22


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Serial.print("Sensor Value: ");


Serial.print(sensorValue);
if (sensorValue > 320)
{
Serial.print("Smoke has been detected");
}

Serial.println("");
delay(50);
return String(sensorValue);
}
String getcovalue() {
value = analogRead(AOUTpin); //reads the analaog value from the CO sensor's AOUT pin
limit = digitalRead(DOUTpin); //reads the digital value from the CO sensor's DOUT pin
Serial.print(" CO value: ");
Serial.println(value);//prints the CO value
Serial.print("Limit: ");
Serial.println(limit);//prints the limit reached as either LOW or HIGH (above or underneath)
delay(100);
return String(value);

String getairpollutionvalue() {
sensorValuee = analogRead(4); // read analog input pin 0
digitalValue = digitalRead(13);
Serial.print("air quality:");
Serial.println(sensorValuee, DEC); // prints the value read
Serial.println(digitalValue, DEC);
delay(100);
return String(sensorValue);
}
String getnaturalgasvalue() {
A3_Out = analogRead(A3_Pin); // Take Analog output measurement sample from AO pin of
MQ4 sensor
threshold_value = digitalRead(DO_Pin); //Read digital output of MQ4 sensor
Serial.print("Methane Conentration: ");
Serial.println(A3_Out);//prints the methane value
Serial.print("threshold_value: ");

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 23


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Serial.println(threshold_value);//prints the threshold_value reached as either LOW or HIGH


(above or underneath)
delay(100);
return String(A3_Out);

}
String getsoundvalue() {
float Analogg;
int Digitall;

Analogg = analogRead (Analog_Pin);


Digitall = digitalRead (Digital_Pin);

Serial.print("sound level:");
Serial.print(Analogg, 4);
Serial.print("dB,5");
Serial.print("Limit :");

if (Digitall == 1)
{
Serial.println(" reached ");
}
else
{
Serial.println(" Not yet reached ");
}

delay (200);
return String(Analogg);
}

void sendCommand(String command, int maxTime, char readReplay[]) {


Serial.print(countTrueCommand);
Serial.print(". at command => ");
Serial.print(command);
Serial.print(" ");

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 24


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

while (countTimeCommand < (maxTime * 1))


{
esp8266.println(command);//at+cipsend
if (esp8266.find(readReplay)) //ok
{
found = true;
break;
}

countTimeCommand++;
}

if (found == true)
{
Serial.println("OYI");
countTrueCommand++;
countTimeCommand = 0;
}

if (found == false)
{
Serial.println("Fail");
countTrueCommand = 0;
countTimeCommand = 0;
}

found = false;
}

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 25


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Program Educational Objectives

PEO1: Solve complex technical problems and design systems that are useful to society by
applying the fundamental scientific principles that underpin the Telecommunication
Engineering profession.
PEO2: Graduates work productively as Telecommunication Engineers, including supportive
and leadership roles on multidisciplinary teams.
PEO3: Be sensitive to the consequences of their work, both ethically and professionally, for
productive professional careers.

Program Specific Outcomes

PSO1: Analyse and Design Analog & Digital modules for a given specification and function.
PSO2: Implement functional blocks of hardware-software co-designs for Embedded Systems,
Signal Processing, Communication and Networking Applications.

Program Outcomes

PO 1: Engineering Knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals and engineering specialization to the solution of complex engineering
problems.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 26


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

PO 2: Problem Analysis: Identify, formulate, review research literature, and analyse complex
engineering problems reaching substantiated conclusions using first principles of mathematics,
natural sciences.

PO 3: Design/Development of solution: Design solutions for complex engineering problems


and design system components or processes that meet the specified needs with appropriate
consideration for the public health and safety, and the cultural, societal, and environmental
considerations.
PO 4: Conduct Investigation of Complex problems: Use research-based knowledge and
research methods including design of experiments, analysis and interpretation of data, and
synthesis of the information to provide valid conclusions.

PO 5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modelling to complex engineering
activities with an understanding of the limitations. PO 8: Ethics: Apply ethical principles and
commit to professional ethics and responsibilities and norms of engineering practice.

PO 6: The Engineer and Society: Apply reasoning informed by contextual knowledge to


assess societal, health, safety, legal and cultural issues and the consequent responsibilities
relevant to professional engineering practice.

PO 7: Environment and Sustainability: Understand the impact of professional engineering


solutions in societal and environmental contexts, and demonstrate the knowledge of, and need
for sustainable development.

PO 8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of engineering practice.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 27


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

PO 9: Individual and Teamwork: Function effectively as an individual, and as a member


or leader in diverse teams, and in multidisciplinary settings.

PO 10: Communication: Communicate effectively on complex engineering activities


with the engineering community and with society at large, such as, being able to write
effective reports and, make effective presentations, give and receive clear instructions.

PO 11: Project Management Finance: Demonstrate knowledge and understanding of the


engineering and management principles and apply these to one’s own work, as a member and
leader in a team, to manage projects and in multidisciplinary environment.

PO12. Life-long Learning: Life-long learning: Recognize the need for and have the
preparation and ability to engage in independent and life-long learning in the broadest
context of technological change.

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 28


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Course Outcomes
After completing this course, students will be able to:

CO1: Apply Engineering and Management principles to achieve project goal.

CO2: Develop hardware and/or software modules for the identified problem statement.

CO3: Collaborate with teammates and communicate effectively to manage all aspects of the
Project including finance, time and resources.

CO4: Test and Analyze the modules of planned project.

CO5: Indulge in self-learning and be motivated for life-long learning.

CO-PO Mapping:

CO/PO PO PO PO PO PO PO PO PO PO PO PO PO PSO PSO


01 02 03 04 05 06 07 08 09 10 11 12 1 2
CO 1 3 2 3 2 3 1 2 2 3 3 2 2 3 3
CO 2 2 2 3 2 3 1 1 2 3 2 2 2 2 2
CO 3 3 3 3 3 2 2 2 3 3 3 1 2 3 3
CO 4 2 2 2 2 2 1 1 2 3 2 2 2 3 3
CO 5 2 3 3 3 3 2 2 2 3 3 2 1 3 3

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 29


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 29


MONITORING SYSTEM FOR AIR POLLUTION AND NOISE LEVEL 2023-2024

Dept. of Electronics and Communica on Engineering, B.I.T. Page | 29

You might also like