Project Report Real
Project Report Real
A PROJECT REPORT
BY
SHIVANI
ROLL NO. 210581220077
SUBMITTED TO
HIMACHAL PRADESH UNIVERSITY -SHIMLA
IN
PARTIAL FULLFILLMENT OF THE REQUIREMENTS
FOR THE DEGREE
OF
1
1
DECLARATION
I ,”Shivani D/O Sh. Surinder Paul”, having examination Roll no. 210581220077, a
student of MCA 4th semester,Department of Computer Science, Himachal Pradesh
University, Shimla hereby declare that the project work entitled “Air Quality
Monitoring System” submitted with the Department of Computer Science,
Himachal Pradesh University, Shimla as a partial fulfillment of the requirement for
the award of the degree in Master in Computer Applications (MCA) has been carried
out by me under the guidance of “Prof. Manu Sood”.
Shivani
Exam Roll No. :- 210581220077
Class Roll No. :- 21176
Department of Computer Science
Himachal Pradesh University
Dated:
1
2
2
3
CERTIFICATE
Dated:
Prof. Manu Sood
Department of Computer Science
Himachal Pradesh University
Shimla-171005
3
4
ACKNOWLEDGEMENT
Presentation, inspiration and motivation have always played a key role in the
success of any venture.
Shivani
Roll No. 21176
4
5
Table of Contents
S.NO. CONTENTS PAGE NO.
1. Introduction 4
6 Identification 31-34
5
6
CHAPTER 1
INTRODUCTION
The cloud computing based web server introduced in this platform analyzes real-time
data and adds visual effects to illustrate the conditions of the indoor air quality. In
addition, the web server was designed to issue alert mobile application users or
facility managers of moderate or poor air quality so that responsible parties can take
immediate remedial action. Real-time monitoring and a rapid alert system produce an
efficient platform for improving indoor air quality.
(iv) We originally developed a mobile application to make the proposed IoT system
with features of anytime, anywhere.
6
7
(v) The device has been tested for reliability of the data and the platform has been implemented in a
building to test its feasibility.
2. Smart-Air
An accurate data measurement of indoor air quality is the most important factor for
the platform. Thus, Smart-Air was developed to collect accurate and reliable
data for indoor air quality monitoring. Because the monitoring area is not
constant, the device was designed to be easily customized to an environment by
using an expandable interface. Thus, various types of sensors can be installed or
adjusted based on the environment. Also, a Long-Term Evolution (LTE) modem is
mounted in the device to transmit detected data directly to the web server for
classifying and visualizing air quality. For most IOT platforms, gateway or data
loggers are installed to gather and transmit data wireless to the web server. However,
in this study, a micro controller was installed in the device to gather the data from
the sensors and transmit it to the web server using the LTE modem, eliminating
the need for a gateway and a data logger.
The most important purpose of Smart-Air is to precisely detect air quality in the
perception layer of the platform that a primitive concept design of the device .
This device has an expandable interface such that multiple sensors can be
installed simultaneously or easily added according to monitoring requirements. In
the present study, the Smart-Air device consists of a laser dust sensor, a volatile
organic compound (VOC) sensor, a carbon monoxide (CO) sensor, a carbon
dioxide (CO2) sense LED strip was installed in the center of the device to .The
AQI is an index for reporting daily air quality. It tells you how clean or polluted
your air is, and what associated health effects might be a concern for you. the AQI
for five major air pollutants regulated by the Clean Air Act: ground-level ozone, particle pollution
(also known as particulate matter), carbon monoxide, sulfur dioxide, and nitrogen dioxide.
For each of these pollutants, EPA has established national air quality standards to protect public
health. Ground-level ozone and airborne particles are the two pollutants that pose the greatest threat
to human health in this country.
7
8
IOT- based air pollution monitoring systems comprise several components that work
together to collect and analyze air quality data. The components include:
1.Sensors: Sensors are the primary components of IOT-based air pollution monitoring
systems. They measure various air quality parameters such as particulate matter, carbon
monoxide, sulfur dioxide, and nitrogen oxides. The sensors can be classified into two
categories: physical and chemical sensors. Physical sensors measure parameters such as
temperature, humidity, and pressure, while chemical sensors measure air pollutants.
8
9
4.Cloud Server: The cloud server is a centralized platform for storing, analyzing, and
sharing air quality data. It collects data from the communication module and stores it in a
database. The cloud server also provides web and mobile applications for users to access
the data
5.Power Supply: IOT -based air pollution monitoring systems require a power supply to
operate. In case of permanent installations external power supply is provided and
batteries are provided for portable devices.
6. Enclosure: The enclosure is the outer covering that protects the components from
environmental factors such as dust, water, and temperature.
9
10
CHAPTER 2
HARDWARE
➢ NodeMCUESP8266
➢ Breadboard
➢ MQ135sensor
➢ Jumper-wires
SOFTWARE
➢ Thing Speak
BLOCK DIAGRAM
10
11
The above bock diagram shows how MQ135 air quality sensor’s data is sent to Thing speak.
MQ135 is an analog air pollution sensor which converts the level of toxic gases in the
surrounding to analog values.
The Arduino collects the analog sensor values and converts it to digital value
and sends it to ESP8266 via UART / serial communication.
The ESP8266 connects to Thing speak server via internet. The sent data to Thing
speak can be accessed using a PC or a laptop by logging in to your Thingspeak
account.
Be side Arduino we have a 16 x 2 LCD to display real-time air pollution level and
other stats about air quality sensor. The LCD is connected to I2C adapter which will
reduce the number of wires that connects from Arduino to LCD to four (VCC, GND, SDA
and SC.
Node mcuesp8622
NodeMCU is an open-source LUA based firmware developed for the ESP8266 wifi
chip. By exploring functionality with the ESP8266 chip, NodeMCU firmware comes
11
12
There is Version2 (V2) available for NodeMCU Det Kit i.e. NodeMCU
Development Board v1.0 (Version2), which usually comes in black
colored PCB.
NodeMCU Development board is featured with WiFi capability, analog pin, digital pins,
and serial communication protocols.
To get started with using NodeMCU for IOT applications first we need to know about
how to write/download NodeMCU firmware in NodeMCU Development Boards. And
before that where this NodeMCU firmware will get as per our requirement.
There are online NodeMCU custom builds available using which we can easily get
our custom NodeMCU firmware as per our requirement.
To know more about how to build custom NodeMCU firmware online and download it
refer toGetting started with NodeMCU
• Processor. Tensilica
LX106. .
• RAM. 64 kB.
• Data storage. 96 kB.
• Wireless standard.
802.11 b/g/n. • Frequency.
2,4 GHz
12
13
BREADBOARD
A breadboard is derived from two words bread and board. The word breadboard was
initially used to slice the bread pieces. But, it was further named as a breadboard for
its use in electronics around the 1970s. Hence, the term breadboard refers to these
boards only and provides a quick electrical connection.
A breadboard is also categorized as a Solder less board. It means that the
component does not require any soldering to fit into the board. Thus, we can
say that breadboard can be reused. We can easily fit the components by
plugging their end terminal into the board. Hence, a breadboard is often called
a plug board.Let's discuss the materials used for creating the breadboard.
White plastic is the material that is used to create breadboards. Today, most of the
breadboards are Solder less breadboards. We can directly plug in the
electronic components and connect it with the external power supply.
The breadboards are available as per the specified point holes. For example, 400 point
breadboard, 830 point breadboard.
13
14
Breadboards are one of the most fundamental pieces when learning how to build circuits.
In this tutorial, you will learn a little bit about what breadboards are, why they are called
breadboards, and how to use one. Once you are done you should have a basic
understanding of how breadboards work and be able to build a basic circuit on a
breadboard.
JUMPER WIRE
Jumper wires are simply wires that have connector pins at each end, allowing them to be
used to connect two points to each other without soldering. Jumper wires are typically
used with breadboards and other prototyping tools in order to make it easy to change a
circuit as needed. Fairly simple. In fact, it doesn’t get much more basic than jumper wires.
Though jumper wires come in a variety of colors, the colors don’t actually mean anything.
This means that a red jumper wire is technically the same as a black one. But the colors
can be used to your advantage in order to differentiate between types of connections,
such as ground or power.
14
15
MQ135 Sensor
The MQ-135 Gas sensor can detect gases like Ammonia (NH3), sulfur (S), Benzene
(C6H6), CO2, and other harmful gases and smoke. Similar to other MQ series gas sensor,
this sensor also has a digital and analog output pin. When the level of these gases go
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 preheating before it could actually give accurate results.
The MQ135 is one of the popular gas sensors from the MQ series of sensors that are
commonly used in air quality control equipment. It operates from 2.5V to 5.0V and can
provide both digital and analog output. The pin-outs and important components on an
MQ135 Module is marked below.
Note that all MQ sensors have to be powered up for a pre-heat duration for the sensor to
warm up before it can start working. This pre-heat time is normally between 30 seconds to
a couple of minutes. When you power up the module the power LED will turn on, leave the
module in this state till the pre-heat duration is completed.
15
16
The digital output pin of the sensor can be used to detect harmful gases in the
environment. The sensitivity of the digital pin can be controlled by using the 10k
potentiometer. If the gas is detected the indicator LED D0 will turn on and the digital pin
will go from logic high to logic low (0V). The LM393 Op-Amp Compactor IC is used to
compare the actual gas value with the value set using the potentiometer. If the actual gas
value increases than the set value then the digital output pin gets low.
Because of the onboard LM393 compactor IC the MQ135 Gas sensor module can also be
used without the need of an external micro-controller. Simply power up the module and
set the sensitivity of the digital pin using the potentiometer, then when the module detects
the gas the digital pin will go low. This digital pin can directly be used to drive a buzzer or
LED with the help of simple transistors.
The Analog output pin of the sensor can be used to measure the PPM value
of the required gas. To do this we need to use an external micro controller like
Arduino. The micro controller will measure the value of analog voltage and
perform some calculations to find the value of Rs/R0 where Rs is the sensor
resistance when gas is present and R0 is sensor resistance at clean air. Once
we find this ratio of Rs/R we can use it to calculate the PPM value of required
gas using the graph below which is taken from the data sheet of MQ13
sensor.
16
17
Entity RelationshipDiagram
17
18
18
19
Chapter 3
FEASIBILITY STUDY
A wide range of industrial operators, including mining, construction, ports, landfill and
the oil and gas industry, are looking more closely at the air quality on and around their
operational sites.
Such operators, also including chemical, processing, agriculture and utilities, are under
increasing pressure to carry out environmental monitoring around their perimeter,
particularly if they are close to population bases.
Equally important is the ability to distinguish between local pollution sources, where
emissions can potentially be managed directly, and regional or background pollution,
which will require a different approach.
Health and safety of workers on site is important, as well as the exposure of local
communities. Samples of air may be taken for laboratory analysis on an ad or
scheduled basis, but this high level of accuracy cannot completely make up for the
delays levels can be logged – as frequently as every minute – and used to trigger alerts,
as well as maintaining and sharing an ongoing database, showing daily patterns and
historical information.
19
20
Arduino Software (IDE) makes it easy to write code and upload it to the board
offline. We recommend it for users with poor or no internet connection. This
software can be used with any Arduino board.
here are currently two versions of the Arduino IDE, one is the IDE 1.x.x and
the other is IDE 2.x. The IDE 2.x is new major release that is faster and even
more powerful to the IDE 1.x.x. In addition to a more modern editor and a
more responsive interface it includes advanced features to help users with
their coding and debugging.
The following steps can guide you with using the offline IDE (you can choose
either IDE 1.x.x or IDE 2.x):
20
21
2.The message area, gives feedback while saving and exporting and also
displays errors.
3.The text editor for writing your code.
4. The text console displays text output by the Arduino Software (IDE), including
complete error messages and other information.
The bottom right-hand corner of the window displays the configured board and
serial port.
21
22
2. Now, you need to select the right board & port. This is done from the toolbar.
Make sure you select the board that you are using. If you cannot find your
board, you can add it from the board manager in the sidebar.
Selecting a board & port.
3. Let’s try an example: navigate to File > Examples > 01.Basics > Blink.
Opening an example.
4. To upload it to your board, simply click on the arrow in the top
left corner. This process takes a few seconds, and it is important
to not disconnect the board during this process. If the upload is
successful, the message "Done uploading" will appear in the
bottom output area.
22
23
5. Once the upload is complete, you should see on your board the yellow LED
with the letter L next to it, start blinking. You can adjust the speed of blinking by
changing the delay number in the parenthesis to 100, and upload the Blink
sketch again. Now the LED should blink much faster.
Congratulations! You have successfully programmed your board to blink its on-
board LED! You can find more information about the Arduino Software (IDE)
here.
For Designing IOT based air quality monitoring system using Esp8622 and
MQ135 sensor sensor assemble the circuit as shown in the figure given below:
23
24
You can add the library files from sketch-->include library --->manage library
•You can search for the libraries you want to include and click install
•You will be on your device dashboard: track your device’s special parameters here.This
can be set in the device configuration(default to null)
•you can see your real time and special parameter’s graph
Click on the “Send trial data” to send a trial data to the server.
Part III: Setting Up NodeMCU
Now switch back to your NodeMCU project.
join sample device code options in http://thingsio.ai/ account and click on the Node MCU.
You will get the sample code from there.
compile the sketch by clicking on the compile icon on the top left corner
24
25
•Go in your email address and verify your account. You will get the notification for the
email verification
•After that, sign in your account with your email address and password
•Now, you will be on the project dashboard of your account. Click on the new project
option:
•Click on the add a new device option:•Go in sample device code options in
http://thingsio.ai/ account and click on the Node MCU. You will get the sample code
from there.
•compile the sketch by clicking on the compile icon on the top left corner
•You can set the special parameters (this is tracked on the dashboard) & transform it
accordingly and add new parameters
To create a graph for your device click on the “create graph option”.
•Go in sample device code options and click on the Node MCU. You will get the sample
code from there.
25
26
Code /sketch
#include<SPI.h>
#includefuit_GFX.h>i
include <Ada fruit_SSD1306.h>
#define SCREEN_WIDTH
128 #define
SCREEN_HEIGHT 64
#define OLED_RESET -1
Ada fruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
String apiKey =
"WG89GEZYSP35Q7AL"; const char
*ssid = "SHIVANI25";
const char *pass #include <Wire.h>
#include "MQ135.h"#include <ESP8266WiFi.h>=
"12345678"; const char* server = "api.thing
speak.com";
WiFiClient client;
void
setup() {
Serial.begin(115200);
display.begin(SSD1306_SWITCHCAPVCC,
0x3C) display.clear Display();
delay(10);
Serial.print ln("Connecting to
"); Serial.print ln(ssid);
display.clear Display();
display.setCursor(0,0);
display.set TextSize(1);
display.set Text Color
(WHITE);cursor_y =
cursor_x = 0; textsize =
1;
26
27
while (x<y)
{ if (f >= 0)
{
y--;
ddF_y +=
2; f +=
ddF_y;
}
x++;
ddF_x +=
2; f +=
ddF_x;
Draw Pixel(x0 + x, y0 + y,
color); draw Pixel(x0 - x, y0
+ y, color); draw Pixel(x0 + x,
y0 - y, color); draw Pixel(x0
- x, y0 - y, color); draw
Pixel(x0 + y, y0 + x, color);
draw Pixel(x0 - y, y0 + x,
color); draw Pixel(x0 + y, y0
- x, color); draw Pixel(x0 - y,
y0 - x, color);
}
}
27
28
int16_t f = 1 - r;
int16_t ddF_x = 1;
int16_t ddF_y = -2 *
r; int16_t x = 0;
int16_t y = r;
while (x<y)
{ if (f >= 0)
{
y--;
ddF_y += 2;
f +=
ddF_y; }
x++;
ddF_x += 2;
f += ddF_x;
if (cornername & 0x4) { draw
Pixel(x0 + x, y0 + y, color);
draw Pixel(x0 + y, y0 + x,
color);
}
if (cornername & 0x2) { draw
Pixel(x0 + x, y0 - y, color);
draw Pixel(x0 + y, y0 - x,
color);
}
if (cornername & 0x8) { draw
Pixel(x0 - y, y0 + x, color);
draw Pixel(x0 - x, y0 + y,
color);
}
if (cornername & 0x1) { draw
Pixel(x0 - y, y0 - x, color);
draw Pixel(x0 - x, y0 - y,
color);
}
}
}
28
29
int16_t ddF_x = 1;
int16_t ddF_y = -2 *
r; int16_t x = 0;
int16_t y = r;
while (x<y)
{ if (f >= 0)
{
y--;
ddF_y += 2;
f +=
ddF_y; }
x++;
ddF_x += 2;
f += ddF_x;
int16_t dx,
dy; dx = x1 -
29
30
x0;
dy = abs(y1 - y0);
30
31
= -1;
int16_t err = dx /
2; int16_t ystep;
31
32
while (WiFi.status() !=
WL_CONNECTED) {
delay(500);
Serial.print("."
);
}
display.clear Display();
display.setCursor(0,0);
display.set TextSize(1);
display.set Text
Color(WHITE);
display.print("WiFi
connected");
display.display();
delay(4000);
void
loop() {
MQ135 gasSensor = MQ135(D0);
float air_quality =
gasSensor.getPPM();
Serial.print("Air Quality: ");
Serial.print(air_quality);
Serial.print ln(" PPM");
Serial.print ();
32
33
display.setCursor(0,20);
display.set TextSize(2);
display.set Text
Color(WHITE);
display.print(air_quality);
display.set TextSize(1);
display.set Text
Color(WHITE);
display.print ln(" PPM");
display.display();
if (client.connect(server,
80)) {
String postStr =
apiKey; postStr +=
"&field1=";
postStr +=
String(air_quality); postStr
+= "r\n";
client.print("POST /update
HTTP/1.1\n"); client.print("Host:
api.thing speak.com\n");
client.print("Connection: close\n");
client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
client.print("Content-Type: application/ x-wow-form-
encoded\n"); client.print("Content-Length: ");
client.print(postStr.length(
)); client.print("\n\n");
client.print(postStr);
delay(2000)
;}
"Ada fruit_GFX.h"
#include "glc font.c"
#include <.h>
33
34
serial monitor
The Serial Monitor is an essential tool when creating projects with Arduino. It
can be used as a debugging tool, testing out concepts or to communicate
directly with the Arduino board.
The Arduino IDE 2 has the Serial Monitor tool integrated with the editor, which
means that no external window is opened when using the Serial Monitor. This
means that you can have multiple windows open, each with its own Serial
Monitor.You can download the editor from the Arduino Software page.
You can also follow the downloading and installing the Arduino IDE 2 tutorial
for more detailed guide on how to install the editor.
Requirements
.Arduino IDE 2 installed.
•Arduino board.
•Core installed for the board used.
Notable Changes
Integrated Monitor
One major change that was introduced with the Arduino IDE 2 is the integrated
Serial Monitor. The older versions of the editor features an external window that
matches the port/board that we select.
34
35
Get Started
Learn the basics of ThingSpeak
Visualize Data
Transform and visualize data in MATLAB
Act on Data
Use Thing Speak apps to trigger an action or transform and visualize data
API Reference
Use the REST and MQTT APIs to update Thing Speak channels and to chart numeric
data stored in channels
35
36
Advantages
A major advantage with having the Serial Monitor integrated with the editor is
the possibility to have multiple monitors open simultaneously. In the old editor,
when changing the port/board, it changed across all windows. In addition, we
were limited to one Serial Monitor window, an obstacle that the IDE 2 removes.
Thing speak
36
37
The Thing Speak service is operated by Math Works. In order to sign up for Thing Speak,
you must create a new Math Works Account or log in to your existing Math Works
Account.
Thing Speak includes a Web Service (REST API) that lets you collect and store sensor
data in the cloud and develop Internet of Things applications. It works with Arduino,
Raspberry Pi and MATLAB ( made libraries and API exists) But it should work with all
kind of Programming Languages, since it uses a REST API and HTTP.
Thing Speak allows you to aggregate, visualize and analyze live data streams in the cloud. Some
of the key capabilities of Thing Speak include the ability to:
37
38
•Easily configure devices to send data to Thing Speak using popular Io T protocols.
•Visualize your sensor data in real-time.
Once data is in a Thing Speak channel, you can analyze and visualize it, calculate new
data, or interact with social media, web services, and other devices.
38
39
39
40
2. Now, we need to choose another board. In this example, we are using an Arduino Nano 33 IoT.
If you have connected it to your computer and installed the necessary core for it, it will show up in
the board list.
40
41
3. For the new sketch, let's use the same sketch we uploaded to the other board, but
replace the
"Hello world!"
, with something else. In this example, we used
"Hello Mars!"
, as you can see in the code snippet below:
COPY
1void setup() {
2Serial.begin(9600);
3}
5void loop() {
6Serial.println("Hello Mars!");
7delay(1000);
8}
4. Upload the code to the board, and open the Serial Monitor. We should now see
41
42
42
43
For database, in the think speak you have to create the channel.
43
44
Making a Connection
Serialmonitor comes with any and all version of the Arduino IDE. To open it, simply click the
Serial Monitor icon.
The icon is located to the right of the other icons in Arduino 0023 and below.
The icon is located to the far right in Arduino 1.0 and beyond.
Selecting which port to open in the Serial Monitor is the same as selecting a port for
uploading Arduino code. Go to Tools -> Serial Port, and select the correct.
44
45
Artificial Intelligence and Machine Learning have made the automation of IOT
devices easy. Basically, AI and ML programs are combined with IOT devices
to give them proper automation.
Due to this, IOT has also expanded its area of application in various sectors.
Here, in this section, we will discuss the applications and the
45
46
Conclusion
46
47
Bibliography
➢https://www.schneier.com
➢https://docs.github.co
➢ https://www.youtube.com/watch?v=Td1d5iMF3EQ
47
48
Date work
1. 9jan-14jan Introduction to Internet Of Things
.
Log Book of March
48
49
49
50
50