Iot Based Live Weather Station Monitoring System
Iot Based Live Weather Station Monitoring System
SUBMITTED BY:
SUPERVISED BY:
Tanmoy Roy
Lecturer
Department of Electrical & Electronic Engineering
i
Certificate
This is to certify that the report entitled “Design and Construction of an ioT
based Live Weather Station Monitoring System” is the valid record of the bona
fide work done by Tanmoy Roy our supervision in partial fulfillment of the award
of the degree of Bachelor of Science in Electrical and Electronics Engineering
from the Anwer Khan Modern University (AKMU).
-----------------------------
Signature of Supervisor
Tanmoy Roy
Lecturer
Department of Electrical and Electronics Engineering
Anwer Khan Modern University
ii
DECLARATION
We hereby do solemnly declare that the work presented in this project has been
carried out by us. This project is submitted as a particular fulfillment of the
requirement for the degree of Bachelor of Science in Electrical and Electronic
Engineering commenced from of ANWER KHAN MODERN UNIVERSITY
(AKMU) is the result of our own project work. We hereby declare that no part of
this project consists of materials copied or plagiarized from other published or
unpublished source have either been put under quotation or duly acknowledged
with full reference in appropriate places.
Thanking You,
Sammit Hossain
ID: 13-202-0037
Department of Electrical and Electronic Engineering
iii
ABSTRACT
Where pollution has become a major problem around the world, air pollution is
the most dangerous, shocking and severe pollution among other pollutions e.g.
water pollution, soil pollution, noise pollution, light pollution, thermal pollution
etc. Air pollution is the major cause of diseases like asthma, cancer, bronchitis,
birth defects and immune system like diseases. Air pollution affects our day to
day activities and quality of life. It poses a threat to the ecosystem and the quality
of life on the planet. The dire need to monitor air quality is very glaring, owing to
increased industrial activities over the past years. People need to know the extent
to which their activities affect air quality. This project proposes an air pollution
monitoring system. The system was developed using the Arduino microcontroller.
The air pollution monitoring system was designed to monitor and analyze air
quality in real-time and display it to LCD. Air quality measurements were taken
based on the Parts per Million (PPM) metrics. The air quality measurements taken
by the designed system was accurate. The goal is to make the system as reasonable
as possible so that people from every society background can use this and if some
research organization wants to do further research then if some nominal amount
of money is invested then it would be a great solution to install a weather station
thus air quality monitoring system.
iv
Table of Content's
CHAPTER 1 INTRODUCTION 1
1.2 Background Study 1
1.3 Objective 2
1.4 Project Organization 2
v
CHAPTER 4 RESULT AND DISCUSSION 25
4.1 Introduction 25
4.2 Results 25
4.3 Application 26
4.4 Advantage 26
4.5 Limitation 26
4.6 Discussion 26
4.7 Cost Estimation 27
CHAPTER 5 CONCLUSION 28
5.1 Conclusion 28
5.2 Future Recommendation 28
References 29
Appendix 31
vi
List Figures
Fig 2. 1: Arduino Nano 4
Fig 2. 2: NodeMCU microcontroller 10
Fig 2. 3: Blynk application communication feature 11
Fig 2. 4: Blynk application widget box 11
Fig 2. 5: Optical Dust Sensor 12
Fig 2. 6: Temperature and humidity Sensor 14
Fig 2. 7: Temperature Sensor 15
Fig 2. 8: Arduino and temperature sensor connection 16
Fig 2. 9: LCD Display 17
Fig 2. 10: 220v to 12v step down transformer. 17
Fig 2. 11: Diode 18
Fig 2. 12: Full wave rectifier is a circuit diagram 19
Fig 2. 13: Full wave rectifier wave from 19
Fig 2. 14: DC-DC Buck Converter 20
Fig 3. 1: Block Diagram 21
Fig 3. 2: Circuit Diagram 22
Fig 3. 3: Programming platform for ARDUINO 23
Fig 3. 4: Project Picture 24
Fig 3. 5: Normal Status 37
Fig 3. 6: Temperature Alarm 25
Fig 3. 7: Smoke Alarm 37
Fig 3. 8: Dust Alarm 25
vii
CHAPTER 1
INTRODUCTION
1.1 Introduction
Considering the daily newspapers and any other electronic or print media, a
devastating news which is spreading day by day is people is becoming sick and
the climate is changing such a way that it has become miserable for living of
people. From the aspect from top to bottom, every people are suffering the curse
of climate change. The main reason for the climate change and people health is air
pollution. It has brought changes in climate like global warming, global dimming,
over raining, drought, storms, acid rain, foggy weather etc. The living things on
earth and under water are suffering many problems like change in life due to lack
of proper facilities of life.
Air is the most useful thing for each and every living thing. Researching on this
serious issue this system’s main purpose was to estimate the quality of air for
people and any other living thing which exist on earth. Very important to know
for our living is that how much safe we are now and how the weather and climate
has changed for air pollution and it will sustain sound. This system will ease to
know the answers for air quality.
Dust is responsible for the most air pollution, in this system we use optical dust
sensor and Temperature & Humidity Sensor. Noise sensor is also added to measure
the presence of noise in the environment. A server and an android app have been
made to know the statistics because now days almost everyone has an android
operating device and access to internet.
1
A lot of improvements have been made to existing air pollution monitoring
systems. For example, proposed a system for monitoring air quality at home. The
system transmits sensor data wirelessly by making use of the “request and
respond” protocol along with a combination of address and data centric protocols.
The system monitors the indoor air quality of a home and displays the sensor
reading on a screen. The researchers in employed an Unmanned Aerial Vehicle
(UAV) based system to monitor the air pollution in areas with poor accessibility.
The system was equipped with a Pixhawk autopilot for UAV control and a
Raspberry Pi for sensing and collating air pollution data. An adaptive algorithm
was used to analyze the gathered pollution data. A participatory sensor system for
monitoring air pollution in Sydney was proposed by scientists. In the proposed
system, sensors were mounted on vehicles and a mobile application was used to
upload data to a centralized repository. The system gave information to the user
about their private vulnerability to pollution in the air.. Recursive Converging
Quartiles (RCQ) algorithm aggregates and eliminates data duplicates by removing
invalid readings. This saves energy. The system consisted of sensor nodes and
wireless communication links to a server. The sensor nodes collated data
automatically and passed it on through the network to the server.
1.3 Objective
To create a device which will monitor the quality of air of our environment
Content of dust, temperature and humidity present in air or area around us.
Display the data on LCD.
Make conscious for reduce air pollution
To take action by local authority for prevent air pollution
2
CHAPTER 2
THEORY OF THE PROJECT
2.1 Weather Monitoring System
This chapter includes the total over view of the device. In this chapter we have
followed-up the theory of Arduino Nano, LCD Display, Resistor, Capacitor,
Temperature & Humidity sensor and Optical Dust Sensor, briefly describe of
Microcontroller (ATMEGA 328P), Crystal, LCD display (16x2), Vero board, and
other components. Here we can know that the total system overview of the
projects. And we will also know that how the equipment are working with each
other.
2.2 Theory
We’ve developed the system that can measure dust in air and also can measure
temperature and humidity of environment. In this project we use three optical dust
sensor and three temperature and humidity sensor. We assume three zones and
each zone contain a dust sensor and a temperature and humidity sensor. All sensor
of those three zone are connected to a microcontroller. Here we use Arduino Nano
microcontroller development board which is based on ATmega328p
microcontroller. A LCD is connected with this so that anyone can see the dust
status and environment status.
3
2.4 Arduino Nano
Microcontroller, as the name suggests, are small controllers. They are like single
chip computers that are often embedded into other systems to function as
processing/controlling unit. For example, the remote control you are using
probably has microcontrollers inside that do decoding and other controlling
functions. They are also used in automobiles, washing machines, microwave
ovens, toys ... etc, where automation is needed.
Arduino is an open-source prototyping platform based on easy-to-use hardware
and software. Arduino boards are able to read inputs - light on a sensor, a finger
on a button, or a Twitter message - and turn it into an output - activating a motor,
turning on an LED, publishing something online. We can tell this board what to
do by sending a set of instructions to the microcontroller on the board. To do so
you use the Arduino programming language and the Arduino Software (IDE),
based on Processing.
Technical specifications:
Table 1. 1: Technical specifications of Arduino Nano
Microcontroller ATmega328P
Operating Voltage 5V
Input Voltage 7-12V
(recommended)
Digital I/O Pins 14 (of which 6 provide PWM output)
PWM Digital I/O Pins 6
Analog Input Pins 8
4
DC Current per I/O Pin 20 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328P)of which 0.5 KB used by
bootloader
SRAM 2 KB (ATmega328P)
EEPROM 1 KB (ATmega328P)
Clock Speed 16 MHz
Microcontroller ATMEGA328P
The Atmel® picoPower® ATmega328/P is a low-power CMOS 8-bit
microcontroller based on the AVR® enhanced RISC architecture. By executing
powerful instructions in a single clock cycle, the ATmega328/P achieves
throughputs close to 1MIPS per MHz. This empowers system designer to optimize
the device for power consumption versus processing speed.
The Atmel AVR® core combines a rich instruction set with 32 general purpose
working registers. All the 32 registers are directly connected to the Arithmetic
Logic Unit (ALU), allowing two independent registers to be accessed in a single
instruction executed in one clock cycle. The resulting architecture is more code
efficient while achieving throughputs up to ten times faster than conventional
CISC microcontrollers. The ATmega328/P provides the following features:
32Kbytes of In-System Programmable Flash with Read-While-Write capabilities,
1Kbytes EEPROM, 2Kbytes SRAM, 23 general purpose I/O lines, 32 general
purpose working registers, Real Time Counter (RTC), three flexible
Timer/Counters with compare modes and PWM, 1 serial programmable USARTs
, 1 byte-oriented 2-wire Serial Interface (I2C), a 6- channel 10-bit ADC (8
channels in TQFP and QFN/MLF packages) , a programmable Watchdog Timer
with internal Oscillator, an SPI serial port, and six software selectable power
saving modes. The Idle mode stops the CPU while allowing the SRAM,
Timer/Counters, SPI port, and interrupt system to continue functioning. The
Power-down mode saves the register contents but freezes the Oscillator, disabling
all other chip functions until the next interrupt or hardware reset. In Power-save
mode, the asynchronous timer continues to run, allowing the user to maintain a
5
timer base while the rest of the device is sleeping. The ADC Noise Reduction
mode stops the CPU and all I/O modules except asynchronous timer and ADC to
minimize switching noise during ADC conversions. In Standby mode, the
crystal/resonator oscillator is running while the rest of the device is sleeping. This
allows very fast start-up combined with low power consumption. In Extended
Standby mode, both the main oscillator and the asynchronous timer continue to
run. Atmel offers the QTouch® library for embedding capacitive touch buttons,
sliders and wheels functionality into AVR microcontrollers. The patented charge-
transfer signal acquisition offers robust sensing and includes fully debounced
reporting of touch keys and includes Adjacent Key Suppression® (AKS™)
technology for unambiguous detection of key events. The easy-to-use QTouch
Suite toolchain allows you to explore, develop and debug your own touch
applications. The device is manufactured using Atmel’s high density non-volatile
memory technology. The On-chip ISP Flash allows the program memory to be
reprogrammed In-System through an SPI serial interface, by a conventional
nonvolatile memory programmer, or by an On-chip Boot program running on the
AVR core. The Boot program can use any interface to download the application
program in the Application Flash memory. Software in the Boot Flash section will
continue to run while the Application Flash section is updated, providing true
Read-While-Write operation. By combining an 8-bit RISC CPU with In-System
Self-Programmable Flash on a monolithic chip, the Atmel ATmega328/P is a
powerful microcontroller that provides a highly flexible and cost effective solution
to many embedded control applications. The ATmega328/P is supported with a
full suite of program and system development tools including: C Compilers,
Macro Assemblers, Program Debugger/Simulators, In-Circuit Emulators, and
Evaluation kits.
6
VIN: it is the input power supply that will have the same voltage that we
are supplying the Arduino with the external power supply
5V: power supply of 5V, this voltage may come from VIN pin and a
voltage regulator or from the USB connection.
3.3V: power supply that will provide 3.3V generated by an internal
regulator, with a maximum current of 50 mA.
GND: grounding pins
Analog inputs
Arduino Nano has 8 analogical inputs, from A0 to A7, and each one offers
abresolution of 10 bits (1024 states). By default, there is a voltage of 5V, but that
range can be modified using the pin AREF and using the function
analogReference(), where the user introduces the DC external signal he wants to
use as reference.
7
2.5 NodeMCU
The ESP8266 is a low-cost Wi-Fi microchip with full TCP/IP stack and
microcontroller capability produced by manufacturer Espressif Systems. This
small module allows microcontrollers to connect to a Wi-Fi network and make
simple TCP/IP connections using Hayes-style commands. However, at first there
was almost no English-language documentation on the chip and the commands it
accepted. The ESP8285 is an ESP8266 with 1 MiB of built-in flash, allowing for
single-chip devices capable of connecting to Wi-Fi.
Microcontrollers Applications:
Some basic applications of a microcontroller are given below.
1. Used in biomedical instruments.
2. Widely used in communication systems.
3. Used as a peripheral controller in PC.
4. Used in robotics.
5. Used in automobile fields.
8
NodeMCU Arduino Compatible ESP8266:
This NodeMCU development board is based on the ESP8266, which is a Wi-Fi
communication IC built by Espressif. At its core is a microcontroller that runs at a
blazing 80 MHz and includes a built-in TCP/IP stack and transceiver, which allows
for Wi-Fi communication. This low-cost option can, not only, add Wi-Fi capability
to your next project, it can run it. This board is a standalone microcontroller
development board that can be easily programmed using the Arduino IDE. Some
of the peripherals provided by that ESP8266 include 9 GPIOs, 1 analog input,
UART, SPI, and TWI/I2C, and Wi-Fi. It operates at a 3.3V logic level and it can
be powered from the USB voltage or AC adapter input. The NodeMCU D1 uses
the ESP 8266 microcontroller that is 2 x faster than an Uno, has 160Kbs of Ram
compared to the 2K of an Uno and a 100x the amount of Flash memory! And each
I/O pin is interruptible!
Technical Specs:
Supply Voltage (Vin): 5 – 15V
Logic Voltage: 3.3V
Wi-Fi, UART, I2C, SPI
Digital I/Os: 9
Analog Inputs: 1
Resources
Installing ESP8266 Support in Arduino IDE
ESP8266 Arduino Core Reference
ESP8266 Arduino Libraries
Over-the-Air Update/Programming
ESP8266 Datasheet
9
NodeMCU® Wi-Fi ESP8266 Development Board is
programmable via Arduino IDE.
11 digital input/output pins, all pins have
interrupt/pwm/I2C/one-wire supported (except D0)
1 analog input (3.3V max input)
A Micro USB connection
A power jack, 9-24V power input.
Compatible with Arduino
Compatible with nodemcu
10
Fig 2. 3: Blynk application communication feature
Major features
“Blynk app” It can control hardware remotely, it can display sensor data, it can
store data, visualize it and do many other cool things. There are three major
components in the platform: Blynk App - allows to you create amazing interfaces
for our projects using various widgets.
11
2.7 Optical Dust Sensor
Sharp's GP2Y1010AU0F is an optical air quality sensor, designed to sense dust
particles. An infrared emitting diode and a phototransistor are diagonally arranged
into this device, to allow it to detect the reflected light of dust in air. It is especially
effective in detecting very fine particles like cigarette smoke, and is commonly
used in air purifier systems.
12
Specifications:
Low Current Consumption (MAX: 20mA)
Typical Operating Voltage: 4.5V to 5.5V (MAX: 7V)
The presence of dust can be detected by the photometry of only one pulse
Enable to distinguish smoke from house dust
Dimensions: 1.81 x 1.18 x 0.69'' (46.0 x 30.0 x 17.6mm)
The sensors used in this work is temperature and humidity sensor-DHT11. The
sensor-DHT11 is an Analog sensor designed to sense the physical change in heat
and moisture when exposed in air with suitable wiring and programming.
Its small size, cheap price, low power consumption, quick responses are the
character-istics for being one of the best choices for many users. The sensor
DHT11 is applicable in HVAC (heating, ventilation and air conditioning), it can
be used in testing and inspect-ing equipment and consumer goods. It is also
applicable to use in building a weather station or a humidity regulator. The use of
13
DHT11 sensor has shown its usefulness measuring and controlling temperature
and humidity in home appliances, medical and many other sector (Anon., 2017)
The Figure 2 shows the DHT11 temperature and humidity sensor. The sensor
DHT11 has following performance range and accuracy. A detailed datasheet is
included in Ap-pendices.
Measurement range:
Temperature: 0 to 50°C
Humidity: 20 to 90 % RH
Accuracy:
Temperature: ±2 %
Humidity: ±5 %
Where the operating Voltage remains between 3V to 5.5V (Anon., 2017)
14
The sensor DHT11 detects moisture in the air by measuring the electrical
resistance between electrodes. It is fabricated with a moisture holding substrate.
When substrate absorbs moisture, ionization takes place and results in the increase
in conductivity be-tween the electrodes. The relative humidity is proportional to
the change in resistance between electrodes due to moisture absorbed.
The typical circuit diagram for DHT11 is shown in Figure 2.7 and the detailed
datasheet for DHT11
15
Fig 2. 8: Arduino and temperature sensor connection
16
Fig 2. 9: LCD Display
2.11 Buzzer
A buzzer is an electrical device that makes a buzzing noise and is used for
signaling. A buzzer has a piezo disc and an oscillator inside. When the buzzer is
powered, the oscillator generates a frequency around 2-4 kHz and the piezo
element vibrates accordingly to produce the sound. Assoon as the gas leak is
detected, the buzzer automatically rings to alert the users about the gas leak.
2.12 Transformer
A transformer is a passive electrical device that transfers electrical energy between
two or more circuits. A varying current in one coil of the transformer produces a
varying magnetic flux, which, in turn, induces a varying electromotive force across
a second coil wound around the same core. Electrical energy can be transferred
between the two coils, without a metallic connection between the two
circuits. Faraday's law of induction discovered in 1831 described the induced
voltage effect in any coil due to changing magnetic flux encircled by the coil.
17
Transformers are used for increasing or decreasing the alternating voltages in
electric power applications, and for coupling the stages of signal processing
circuits.
Basically, transformer are two types.
1. Step up transformer
2. Step down transformer
We have used step down transformer as required for our project. Which is 220v to
9v 600ma step down transformer.
2.13 Diode
A diode is a specialized electronic component with two electrodes called the anode
and the cathode. Most diodes are made with semiconductor materials such as
silicon, germanium, or selenium. Some diodes are comprised of metal electrodes
in a chamber evacuated or filled with a pure elemental gas at low pressure. Here
we used converted AC into DC using a bridge-wave rectifier that consists of
four diodes
18
positive and negative sections). Each diode uses 0.7v when conducting and there
are always two diodes conducting.
19
2.15 Buck Converter Module
A buck converter (step-down converter) is a DC-to-DC power converter, which
steps down voltage from its input to its output. The basic operation of the buck
converter has the current in an inductor controlled by two switches. In the idealised
converter, all the components are considered to be perfect. Specifically, the switch
and the diode have zero voltage drop when on and zero current flow when off, and
the inductor has zero series resistance. Further, it is assumed that the input and
output voltages do not change over the course of a cycle
20
CHAPTER 3
SYSTEM DESIGN
3.1 Introduction
In this Chapter we are going to Explain about the system Design construction
through Hardware and development of software. In addition, the chapter
elaborates the hardware and the software stage by stage. All the operations of
hardware and software are also included in this chapter.
21
3.3 Circuit Diagram
22
makes it easy to write code and upload it to the input/output board. Here we use
ARDUINO-1.6.8 platform.
To configure software, we have to use ARDUINO -1.6.8 named arduino.exe
Serial communication
It is used for the communication between Arduino and a computer or other
devices. Every Arduino board has at least one serial port. This ports
communicates thanks to the digital pins 0 (RX) and 1 (TX), and with the
computer thanks to the USB connection.
Serial.begin(speed)
It establishes the speed of data in bits per second (bauds) for the transmission
of data in serial communication.
Serial.read()
It reads the data from the serial port.
Serial.print(val,[format])
It prints the data to the serial port as ASCII text
Serial.println(val,[format])
It prints the data to the serial port as ASCII text but it jumps to a new line.
23
Serial.available()
It gives back the number of available bytes to be read by the serial port. It refers
to data that has already been received and is available in the buffer of the port.
3.6 Summarization
In this chapter all hardware and software configuration and implementation and
simulation are explained properly. ARDUINO is an open source platform so clear
concept is necessary to work with ARDUINO. After study this chapter concept
will be clear about Arduino Nano and project related all other equipment.
24
CHAPTER 4
RESULT AND DISCUSSION
4.1 Introduction
This chapter contains the results obtained and discussion about the project. We
have also covered discussions about advantages, disadvantages, and limitation of
current version of the protection system
4.2 Results
The Final Project was tested and the following were the obtained results:
Dust particle of air can be monitor properly
Temperature and humidity is measured properly
Air status of can be monitor
All sensor data displaying using LCD display
25
4.3 Application
This project can be used at
Roadside pollution Monitoring.
Industrial Perimeter Monitoring.
Indoor Air Quality Monitoring.
To make this data available to the common man.
To make this data available for Authority.
Industry
Garments
Pharmaceutical
Laboratory
It also can be used at office or industries for avoiding illegal use of electricity.
4.4 Advantage
Easy to install
Fully automated
No maintenance cost
No need checker
4.5 Limitation
The system can monitor only temperature, Humidity, Smoke and Dust.
Data transfer using NodeMCU is depends on internet connectivity.
It can monitor environment of a limited area.
For more area it needs more sensor.
4.6 Discussion
In the proposed model, every parameter is provided with an automated meter with
inbuilt sensor to monitor the data consumed at regular intervals, the Atmega
microcontroller can be employed at supervisor to monitoring and collecting sensor
data from the sensor. sensors send data continuously and microcontroller processes
data. The project has met all the objectives as listed previously. The objective as
26
defined earlier was to Environment Pollution Monitor which is fulfill. Some
excellent features also can be add such as IOT or wireless Environment Pollution
Monitor which may need to add Ethernet or wifi module but it needs internet
connection.
27
CHAPTER 5
CONCLUSION
5.1 Conclusion
Where pollution has become a major problem around the world, air pollution is
the most dangerous, shocking and severe pollution among other pollutions e.g.
water pollution, soil pollution, noise pollution, light pollution, thermal pollution
etc. Air pollution is the major cause of diseases like asthma, cancer, bronchitis,
birth defects and immune system like diseases. The goal is to make the system as
reasonable as possible so that people from every society background can use this
and if some research organization wants to do further research then if some
nominal amount of money is invested then it would be a great solution to install a
weather station thus air quality monitoring system.
28
References
[1] Tudose, D. Ş., Pătraşcu, N., Voinescu, A., Tataroiu, R., and Ţăpuş, N. , “Mobile
Sensors in Air Pollution Measurement.”, in Positioning Navigation and
Communication (WPNC), IEEE , pp. 166-170, 7 Apr 2011.
[2] TERI. 2015. Air Pollution and Health. Discussion Paper by The Energy and
Resources Institute: New Delhi by Rinki Jain (Associate Fellow,TERI),
KarnikaPalwa (Research Associate, TERI)
[3] João Ramos Maria, João Dias, “Analyses of Indoor Environmental Quality and
Ventilation in a Building of a School of Higher Education in Portugal”, in the
4th Advanced Research in Scientific Areas conference, pp. 273-278, 1 Nov
2015.
[4] Dias, M. J. et al., (2010). “Indoor Air Quality Evaluation in School Buildings
Ventilated by Natural and Mechanical Systems”. Clima pp. R6-TS62-0P02,
Turkey: REHVA. ISBN Code of the CD 978-975-6907-14-6, 2010.
[5] Olesen, B. W., &Brager, G. S., “A Better Way to Predict Comfort: The New
ASHRAE Standard 55-2004”, ASHRAE Journal, pp. 20-26, 8 Aug 2007.
[6] Al-Haija, Q. A., Al-Qadeeb, H., & Al-Lwaimi, A.,“Case study: Monitoring of
air quality in king Faisal University using a microcontroller and WSN”,
Procedia Computer Science, volume 21, pp. 517–521, 31 Dec 2013.
[7] Sricharan, K. S., Shrivasan, M. A., & Kumar, S. S., “An Intelligent Automated
Emission Quality Monitoring System Designed to Test the Vehicles in the
Signal”, in Green Computing, Communication and Conservation of Energy
(ICGCE), International Conference on IEEE , pp. 590-593, 12 Dec 2013.
[8] Zhang, S., & Zhang, H., “A Review of Wireless Sensor Networks and its
Applications”, in Automation and Logistics (ICAL), IEEE International
Conference on pp. 386-389, 15 Aug 2012.
[9] Mahmoudzadeh, B., &Faez, K., “HCTT&R: A Complete Scheme for Object
Tracking and Recovery of Lost Objects in Cluster-Based Wireless Sensor
Networks”, in Telecommunications (IST), Sixth International Symposium
IEEE conference, pp. 691-696, 6 Nov 2012.
29
[11] Polastre, J., Szewczyk, R., Sharp, C., & Culler, D., “The Mote Revolution:
Low Power Wireless Sensor Network Devices”, in Hot Chips, Vol.6, pp. 22-
24, 22 Aug 2004.
[13] Wang, H., Wu, T., & Wu, G., “Air Quality Monitoring System Based on
Frequency Hopping System”, in Intelligent Control and Information
Processing (ICICIP), IEEE Conference, pp. 641-64, Aug 2010.
[14] Raja Vara Prasad Y, Mirza Sami Baig, Rahul K. Mishra, P. Rajalakshmi, U.
B. Desai5 And S.N. Merchant„ “Real Time Wireless Air Pollution
Monitoring System” Ictact Journal On Communication Technology: On
Next Generation Wireless Networks And Applications, Vol. 2, Issue 2, June
2011.
[15] Devarakonda, S., Sevusu, P., Liu, H., Liu, R., Iftode, L., &Nath, B., “Real-
time Air Quality Monitoring Through Mobile Sensing in Metropolitan
Areas”, in Proceedings of the 2nd ACM SIGKDD International Workshop
on Urban Computing, pp. 15, Aug 2013.
[18] Weaver LK, "Clinical practice. Carbon Monoxide Poisoning". The New
England Journal of Medicine, Vol. 3601, Issue 12,pp. 1217-1225, Mar 2009.
[19] Asmi, A., Putra, J. C. P., &Rahman, I. B. A., “A Study of Indoor Air Quality
of Public Toilet in University's Building”, in Humanities, Science and
Engineering (CHUSER), IEEE Colloquium ,pp. 403-408, 3 Dec 2012.
30
Appendix
Programming Code:
#include <SoftwareSerial.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
SoftwareSerial mySerial(A1,A0);
LiquidCrystal_I2C lcd(0x3F,20,4);
#include <EEPROM.h>
#include <DS18B20.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
DS18B20 ds(2);
uint8_t address2[] = {40, 250, 31, 218, 4, 0, 0, 52};
uint8_t selected;
int address1 = 1; //Temp Data store
byte scountt=EEPROM.read(address1);;
boolean state = true;
#define DHTPIN 8 // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11 // DHT 11
DHT_Unified dht(DHTPIN, DHTTYPE);
31
#define greenLed 5
String cdata; //
int led= A2; // White cable Using A2 pin as digital output Pin
int dust=A3; /////black cable
float voMeasured = 0;
float calcVoltage = 0;
int dustDensity = 0;
int dustlim =300;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(4,0);
lcd.print("WELCOME");
pinMode(redLed, OUTPUT);
pinMode(Buzzer, OUTPUT);
pinMode(Exhaust, OUTPUT);
pinMode(Ainc, INPUT_PULLUP);
pinMode(Adec, INPUT_PULLUP);
pinMode(smoke, INPUT);
pinMode(greenLed, OUTPUT);
digitalWrite(redLed, LOW); // Make sure led is off
digitalWrite(Buzzer, LOW);
digitalWrite(Exhaust, HIGH); // Fan is off
analogWrite(greenLed, 8);
pinMode(led,OUTPUT);
dht.begin();
Serial.println(F("DHTxx Unified Sensor Example"));
sensor_t sensor;
32
lcd.clear();
int teme=(ds.getTempC());
lcd.setCursor(0,0);
lcd.print("Temp:");
lcd.print(teme);
lcd.setCursor(14,0);
lcd.print(scountt);
lcd.setCursor(16,0);
lcd.print(".0 C");
}
void loop() {
int smokes=digitalRead(smoke);
Serial.print("! Temperature is ");
Serial.print(ds.getTempC());
Serial.print(" C");
Serial.print(" smoke ");
Serial.println(smokes);
int teme=(ds.getTempC());
lcd.setCursor(0,0);
lcd.print("Temp:");
lcd.print(teme);
if (smokes== 1)
{
lcd.setCursor(0,2);
lcd.print("Smoke: No ");
lcd.setCursor(18,2);
lcd.print(" ");
}
33
if (smokes== 0)
{
lcd.setCursor(0,2);
lcd.print("Smoke: Yes");
lcd.setCursor(18,2);
lcd.print("*E");
}
34
lcd.setCursor(16,0);
lcd.print(".0 C");
}
if (digitalRead(Adec))
{
}
sensors_event_t event;
dht.temperature().getEvent(&event);
if (isnan(event.temperature)) {
Serial.println(F("Error reading temperature!"));
}
else {
Serial.print(F("Temperature: "));
Serial.print(event.temperature);
Serial.println(F("°C"));
}
35
lcd.print("Humidity:");
lcd.setCursor(9,1);
lcd.print(event.relative_humidity);
lcd.setCursor(11,1);
lcd.print(" % ");
}
int totalVoltage = 0;
for(int i=0;i<10;i++)
{
digitalWrite(led,LOW);
delayMicroseconds(280);
totalVoltage += analogRead(dust);
Serial.println(totalVoltage);
delayMicroseconds(10);
digitalWrite(led,HIGH);
delay(100);
}
Serial.print(totalVoltage);
voMeasured = totalVoltage/10.0;
calcVoltage = voMeasured/1024.0 * 5.0;
Serial.println(calcVoltage);
dustDensity = (170* calcVoltage -0.1);
//lcd.clear();
lcd.setCursor(0,3);
lcd.print("Dust :");
lcd.setCursor(6,3);
lcd.print(dustDensity);
lcd.print(" ug/m^3 ");
Serial.print("Dust Density:");
Serial.print(dustDensity);
36
Serial.println("ug/m^3");
sdata4 = (dustDensity);
if (dustDensity<dustlim)
{
lcd.setCursor(18,3);
lcd.print(" ");
}
if (dustDensity>dustlim)
{
lcd.setCursor(18,3);
lcd.print("*E");
}
37
}
if (teme<scountt)
{
lcd.setCursor(11,0);
lcd.print(" ");
}
if (teme>scountt)
{
lcd.setCursor(11,0);
lcd.print("*E");
}
delay(10);
}
38