100% found this document useful (1 vote)
537 views

Weather Monitoring System Using NodeMCU

The document is a project report for an IoT based weather monitoring system using NodeMCU. It was submitted by 4 students to fulfill the requirements for a diploma in electronics and telecommunication engineering. The project aims to help users access real-time weather data anywhere using sensors and the internet of things. It describes building a weather station to collect measurements of temperature, humidity, air pressure and more to provide information for weather forecasts.

Uploaded by

Badade Mahesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
537 views

Weather Monitoring System Using NodeMCU

The document is a project report for an IoT based weather monitoring system using NodeMCU. It was submitted by 4 students to fulfill the requirements for a diploma in electronics and telecommunication engineering. The project aims to help users access real-time weather data anywhere using sensors and the internet of things. It describes building a weather station to collect measurements of temperature, humidity, air pressure and more to provide information for weather forecasts.

Uploaded by

Badade Mahesh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 49

March 2022

A PROJECT REPORT
ON
“IoT Based Weather Monitoring System using NodeMCU”
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE AWARD
OF
DIPLOMA IN
ELECTRONICS AND TELECOMMUNICATION ENGINEERING

SUBMITTED TO
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION,
MUMBAI
SUBMITTED BY
Name Of Students Enrollment No.

1. Kamble Sahil Mahendra 1710510196


2. Yalmulkar Nitin Baban 1710510197
3. Lande Akash Kondu 1710510199
4. Chemate Sonali Rajendra 1810510008

GUIDED BY
Smt. Pathan J.J.
Government Polytechnic, Awasari (Kh)
2019-2020
March 2022

“COIN INSERTION BASED MOBILE CHARGING SYSTEM”

Submitted by
Name Of Students Enrollment No.

1. Kamble Sahil Mahendra 1710510196


2. Yalmulkar Nitin Baban 1710510197
3. Lande Akash Kondu 1710510199
4. Chemate Sonali Rajendra 1810510008

In partial fulfillment of
Diploma in
Electronics and Telecommunication Engineering

Guided by
Smt. Pathan J.J.

Government Polytechnic, Awasari (Kh)


Institute code-1051
2021 – 2022
March 2022

CERTIFICATE
This is to certify that the project report entitled “Coin Insertion Based
Mobile Charging System” was successfully completed by student of sixth
semester Diploma in Electronics and Telecommunication Engineering
Dighe Atul Sambhaji
Borkar Prathmesh Balu
Bangar Sushant Manjaba
Revgade Abhishek Punjaram
In partial fulfillment of the requirements for the award of the Diploma in
Electronics and Telecommunication Engineering of Government
Polytechnic, Awasari (Kh.) work carried out during a period for academic
year 2021-2022 as per curriculum.

Smt. A. R. Bansode Dr. P. S. Sharma


Project Guide Head Of Department

Dr. D. R. Nandanwar
External Examiner Principal
March 2022

ACKNOWLEDGEMENT

This project done as final year project title “Coin Insertion Based
Mobile Charging System” in partial fulfillment of the requirements for the
award of the Diploma in Electronics And Tele-communication Engineering.
We are really thankful to the Principal Dr. D. R. Nandanwar, and the
Head of Department Dr. P. S. Sharma, Electronics and Telecommunication
Engineering Department, Government Polytechnic, Awasari (Kh.) for their
valuable guidance and assistance without which the accomplishment of the
project would have never been possible.
We also thank Smt. Pathan J. J. for guiding and giving this opportunity
to explore into the real world, realize the interrelation without which a project can
never progress. We are also grateful to parents, friends and all staff of
Electronics and Telecommunication Engineering Department, for providing
us relevant information, and support.

1. Dr. Sharma P.S.


2. Smt. Bansode A.R.
3. Smt. Devkule S.S.
4. Smt. Hande M.B.
March 2022

ABSTRACT

This project was developed because to help user access data about

weather anywhere in real-time. There is a difference between real-time weather

station and weather forecast. The weather forecast is to predict the weather

according for a given location and time. Weather forecasts are made by collecting

quantitative data on the current state of the atmosphere in a particular place.

Meanwhile, real-time weather station is a device that collects data related to the

weather and environment using many different sensors. Weather station is a

facility that can use for measuring atmospheric conditions like temperature,

humidity and air pressure to provide information for weather forecasts and to

study the weather and climate. Due to the fact that without weather station, user

can’t be alerted of the strong winds, heat waves or any other weather-related

emergency. This means that we need weather station to make forecasts and

collects data related to the weather. To overcome the problems faced, there are

techniques that can be implemented to assist this project. This project will use

Internet of Things with sensors to build weather station. The weather station can

help provide data for forecasts.


March 2022

Content
______________________________________________

CHAPTER 1 - INTRODUCTION….…………………………..….1
CHAPTER 2 -BLOCK DIAGRAM………………………………..3
2.1 Block Diagram …………………………………....………………4
2.2Component Used In Block Diagram…………......………………..5
2.3 Block Diagram Description………………………………….……6
CHAPTER 3 – Circuit Diagram…………………………......……..8
3.1 Circuit Diagram………………………..………………….………9
CHAPTER 4- INTRODUCTION OF NodeMCU…………………..10
4.1Introduction……………………………………………………..…11
4.2Pin Diagram………………………………………………………..17
4.3 Features……………………………………………..……………..19
CHAPTER 5 –HARDWARE DESCIPTION…………………..…..20
5.1 Power Supply………………………….........................………....21
5.2 MQ135 Sesnor…………......……………………………………..27
5.3 Relay Module .........……………………..…………………..…....30
5.4 BMP280……….……………………………………………….…32
5.5 Rain Drop Sensor……………………………………………….…..34
5.6 LED……….……………………………………………………....39
CHAPTER 6- PROGRAMMING………………………………...….41
6.1 Algorithm…………………………………………………….....…..42
6.2 Flowchart……………………………………………………….…..43
6.3Program……………..………….…………………………..……….44
CHAPTER 7 – RESULT, CONCLUSION AND FUTURE SCOPE
7.1 Result………………………………………………………………..52
March 2022

7.2 Conclusions…………………………………………….…………...54
7.3 Future scope………………………………………….……………..54
CHAPTER 8 – REFERENCES…………………………….…….......55
8.1 Books……………………………………………………………….56
8.2 Websites……………………………………………….…………....56
CHAPTER 9 –APPENDIX………………………………………........57
List of Component with Price……………..…………………….…..….58
March 2022

CHAPTER 1
INTRODUCTION
March 2022

A weather station is a device that collects data related to the weather and

environment using many different sensors. Weather station is also a facility that

can use for measuring atmospheric conditions to provide information for weather

forecasts and to study the weather and climate. The measurements taken include

temperature, atmospheric pressure, humidity, wind speed, wind direction, and

precipitation amounts. Weather stations are also called weather centers, personal

weather stations, professional weather stations, home weather station and weather

forecaster. There are a difference between real-time weather station and weather

forecast. The weather forecast is to predict the weather according for a given

location and time. Weather.

forecasts are generated by collecting as much data as possible on current

atmospheric conditions and using insights into atmospheric processes to

determine how the weather will change in the future. Meanwhile, real-time

weather station is a device that collects data related to the weather and

environment using many different sensors and get accurate weather readings in

real time. Therefore, Weather Station using Internet of Thing is proposed to help

user access data about weather anywhere in real-time. User can collect the

measurements by the sensors at any time. It can even be viewed on smartphone

or tablet. This means that whenever user want to know what the temperature is,

user can have access to information in real time.


March 2022

CHAPTER 2
BLOCK DIAGRAM
March 2022

2.1 BLOCK DIAGRAM :


March 2022

2.3 BLOCK DIAGRAM DESCRIPTION:

In this block diagram I will shows how to work the project in a simple method.

In this project the main part is controller that is ESP12-E based nodemcu. I will

connect different peripherals to the nodemcu. In this we connect BMP280 Sensor,

Relay Module, Rain Drop Sensor, MQ135 Air Quality Sensor, Led, etc. This

Weather Station project only involves user to view the data of weather such as

temperature, humidity, air pressure, dew point, altitude, rainfall, and air quality. In

this project, BMP280 Sensor, Rain Drop Sensor, MQ135 Air Quality Sensor will be

used to build weather station. Last, weather station also require an internet

connection to send data to users.


March 2022

2.2 COMPONENT USED IN PROJECT:

1. Nodemcu

2. DC Power Adapter.

3. BMP280 Sensor

4. Rain Drop Sensor

5. MQ135 Air Quality Sensor

6. LED

7. Header Strips

8. Relay module

9. Diode

10. Resistor
March 2022

CHAPTER 3
CIRCUIT DIAGRAM

3 .1 CIRCUIT DIAGRAM :-
March 2022
March 2022

CHAPTER 4
INTRODUCTION TO NodeMCU

4.1 INTRODUCTION TO NODEMCU:-


March 2022

Fig: Nodemcu Board

The NodeMcu is an open-source board with inbuilt ESP-12E WIFI module.

This is not a weakling like the Arduino's, with 512kb of memory and a processor

at 40Mhz there is not a shortage of sources. This sign is extremely suitable for

starting IoT (Internet of Things) applications. Programming the NodeMcu is

slightly different than normal, with the API that looks like NodeJS, this module

receives the commands through the LUA scripts that are uploaded.

This concerns version 3 of the NodeMCU series, which is somewhat wider than

the previous version and therefore no longer fits neatly on a breadboard. To make

this right, an I / O shield has been designed to fit this NodeMCU perfectly. This

version contains the CH340G version to save costs instead of the CP2102 serial

chip.

4. 2 PIN DIAGRAM:-
March 2022

Fig: Pin diagram of Nodemcu

 Properties
Wireless 802.11 b / g / n standard
Supports STA / AP / STA + AP
Standard on 9600 baud
Built-in TCP / IP protocol stack to support multiple TCP Client connections (5
MAX)
D0 ~ D8, SD1 ~ SD3: used as GPIO, PWM, IIC, etc., port driver capability
15mA
AD0: 1 channel ADC
Power input: 4.5V ~ 9V (10VMAX), USB powered
Current: continuous transmission: ≈70mA (200mA MAX), Standby: <200uA
Transfer rate: 110-460800bps
Support UART / GPIO data communication interface
March 2022

Remote firmware upgrade (OTA)


Support Smart Link Smart Networking

4.3 FEATURES:-
 Microcontroller: Tensilica 32-bit RISC CPU Xtensa LX106
 Operating Voltage: 3.3V
 Input Voltage: 7-12V
 Digital I/O Pins (DIO): 16
 Analog Input Pins (ADC): 1
 UARTs: 1
 SPIs: 1
 I2Cs: 1
 Flash Memory: 4 MB
 SRAM: 64 KB
 Clock Speed: 80 MHz
 USB-TTL based on CP2102 is included onboard, Enabling Plug n Play
 PCB Antenna
 Small Sized module to fit smartly inside your IoT projects
March 2022

CHAPTER 5
HARDWARE DESCRIPTION

5.1 POWER SUPPLY CIRCUIT:-

Fig: Block diagram of Power Supply


March 2022

Each of the blocks is described in more detail below:

 Transformer - steps down high voltage AC mains to low voltage AC.

 Rectifier - converts AC to DC, but the DC output is varying.

 Smoothing - smoothes the DC from varying greatly to a small ripple.

 Regulator - eliminates ripple by setting DC output to a fixed voltage.

Bridge rectifier:

A bridge rectifier can be made using four individual diodes, but it is also available
in special packages containing the four diodes required. It is called a full-wave
Rectifier because it uses the entire AC wave (both positive and negative sections).

1.4V is used up in the bridge rectifier because each diode uses 0.7V when
conducting and there are always two diodes conducting, as shown in the diagram
below. Bridge rectifiers are rated by the maximum current they can pass and the
maximum reverse voltage they can withstand (this must be at least three times the
supply RMS voltage so the rectifier can withstand the peak voltages

Smoothing:

Smoothing is performed by a large value electrolytic capacitor connected across


the DC supply to act as a reservoir, supplying current to the output when the varying
DC voltage from the rectifier is falling. The diagram shows the unsmoothed varying
DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly
near the peak of the varying DC, and then discharges as it supplies current to the
output.

Voltage regulator:

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or
variable output voltages. They are also rated by the maximum current they can pass.
Negative voltage regulators are available, mainly for use in dual supplies. Most
March 2022

regulators include some automatic protection from excessive current ('overload


protection') and overheating ('thermal protection'). Below is the circuit diagram of
power supply which gives output of 5V, as only that much is required for
microcontroller. Its circuit diagram and designing calculation are given below.

Fig: Circuit diagram of 12V Power Supply

The +12 volt power supply is based on the commercial 7812 voltage
regulator IC. This IC contains all the circuitry needed to accept any input voltage
from 15 to 24 volts and produce a steady +12 volt output, accurate to within 5%
(0.25 volt). It also contains current-limiting circuitry and thermal overload
protection, so that the IC won't be damaged in case of excessive load current; it
will reduce its output voltage instead.

The advantage of a bridge rectifier is you don’t need a center tap on the
secondary of the transformer. A further but significant advantage is that the ripple
frequency at the output is twice the line frequency (i.e. 50Hz) and makes filtering
somewhat easier.
March 2022

The use of capacitor c1 and c2 is to make signal ripple free. The capacitor
used before the regulator is to make ac signal ripple free and then later which we
are using is for safety, if incase there is a ripple left after regulating, then c2nwill
remove it.

We require 12V at the o/p of the regulator.

The drop out voltage of the regulator is 2V As per the data sheet)

Vdc = 12+2 = 14V

So at the regulator input, the voltage applied should be of 14V.

According to the formula,

Vdc = 2Vm/Pi

Assuming there is no ripple Capacitor from

Vm= Vdc .pi/2

=12 x 3.14)/2

=18.84V

Vm= 18.84V

During one cycle, two diodes are conducting

Drop out voltage of one diode = 0.7V

Drop out voltage of two diode = 1.4V

Vim = Vm+ 1.4V

=18.84+1.4= 20.24V

Vim=20.24V

Vrms = Vim/sqrt(2)

= 20.24/sqrt(2)
March 2022

= 14.31V

Vrms = 14.31V

So we select transformer of 15V.

Similarly

Im=Idc x pi/2

Im=700m x 3.14/2

= 1.099A.

Irms= Im/sqrt(2)

= 1.099A/sqrt(2)

` = 777.11mA

Irms = 777.11mA

So we select the transformer of current rating 1A.

Considering the above transformer rating,

We take the transformer of 0-15V/1A

TRANFORMER – 0-15V/1A Stepdown transformer.

2. Rectifier Design:

PIV of diode = Vm = 12.39V

Im= 628mA

BRIDGE RECTIFIER –

So, we select the bridge IC of 1Ampere rating.

R = Vdc/Idc
March 2022

= 15 / 400m

= 37.5Ohms.

Vr = 2(Vim – Vdc)

= 2(20.24 – 12)

= 8.24V

C = Vdc/ (FxRxVr)

= 12/ (100x17.5x8.24)

= 832.17uF

So for Safe working we select capacitor of 1000uF

C1 = 1000uF / 35V Electrolytic Capacitor.

C2 = 0.1uF Ceramic Capacitor.

So the power supply made from the above mentioned components gives the
output of 12V.

5.2 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
March 2022

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 pre-heating 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.

5.3 BMP280 Sensor:-

This BMP280 is a cheapest and tiny Atmospheric Sensor Breakout to measure


barometric pressure, and temperature readings all without taking up too much
space. Basically, anything you need to know about atmospheric conditions you
can find out from this tiny breakout. The BMP280 Breakout has been design to be
used in indoor/outdoor navigation, weather forecasting, home automation, and
even personal health and wellness monitoring.
March 2022

This module uses an environmental sensor manufactured by Bosch with


temperature, barometric pressure sensor that is the next generation upgrade to the
popular BMP085/BMP180/BMP183 Sensor. This sensor is great for all sorts of
weather sensing and can even be used in both I2C and SPI! This precision sensor
from Bosch is the best low-cost, precision sensing solution for measuring
barometric pressure with ±1 hPa absolute accuraccy, and temperature with
±1.0°C accuracy. Because pressure changes with altitude, and the pressure
measurements are so good, you can also use it as an altimeter with ±1 meter
accuracy.

The BMP280 is the next-generation of sensors, and is the upgrade to the


BMP085/BMP180/BMP183 - with a low altitude noise of 0.25m and the same
fast conversion time. It has the same specifications, but can use either I2C or SPI.
For simple easy wiring, go with I2C. If you want to connect a bunch of sensors
without worrying about I2C address collisions, go with SPI.

5.4 Rain Drop Sensor:-

Raindrop Sensor is a tool used for sensing rain. It consists of two modules, a rain
board that detects the rain and a control module, which compares the analog
value, and converts it to a digital value. The raindrop sensors can be used in the
March 2022

automobile sector to control the windshield wipers automatically, in the


agriculture sector to sense rain and it is also used in home automation systems.

 Raindrop Sensor Features:

 Working voltage 5V
 Output format: Digital switching output (0 and 1), and analog voltage
output AO
 Potentiometer adjust the sensitivity
 Uses a wide voltage LM393 comparator
 Comparator output signal clean waveform is good, driving ability, over
15mA
 Anti-oxidation, anti-conductivity, with long use time
 With bolt holes for easy installation
 Small board PCB size: 3.2cm x 1.4cm

5.5 LED:-

A light-emitting diode (LED) is a semiconductor light source that emits light


when current flows through it. Electrons in the semiconductor recombine
with electron holes, releasing energy in the form of photons. The color of the light
(corresponding to the energy of the photons) is determined by the energy required
for electrons to cross the band gap of the semiconductor.[5] White light is
obtained by using multiple semiconductors or a layer of light-emitting phosphor
on the semiconductor device.
March 2022

Fig: Light Emitting Diode

WORKING PRINCIPLE:-
A light-emitting diode is a two-lead semiconductor light source. It is a p–n
junction diode that emits light when activated. When a suitable voltage is applied
to the leads, electrons are able to recombine with electron holes within the device,
releasing energy in the form of photons. This effect is called electroluminescence,
and the colour of the light (corresponding to the energy of the photon) is
determined by the energy band gap of the semiconductor.
March 2022

Fig: Working Principle of LED

FEATURES:

 Energy Saving:- The LEDs are extremely efficient low energy light sources.
 Light gains:- In 2005 the white LEDs reached outputs of over 30 lumens /
Watt and coloured versions 50 lumens / Watt.
 Long operational life:- up to 50,000 hours.
 Compact light source:- no other lamp possesses such small dimensions for a
comparative light output.
 No radiation:- the LEDs do not emit ultraviolet (UV) or infrared (IR)
radiation.
 Durable lamps:- The LEDs are durable against impact and vibration.
 Dimmable LEDs:- the LEDs can be dimmed.
 Coloured lamps:- Coloured light can be produced effectively – over 16
million colours.

5.6 RELAY MODULE


March 2022

A power relay module is an electrical switch that is operated by an

electromagnet. The electromagnet is activated by a separate low-power signal

from a micro controller. When activated, the electromagnet pulls to either open or

close an electrical circuit.

A simple relay consists of wire coil wrapped around a soft iron core, or

solenoid, an iron yoke that delivers a low reluctance path for magnetic flux, a

movable iron armature and one or more sets of contacts. The movable armature is

hinged to the yoke and linked to one or more set of the moving contacts. Held in

place by a spring, the armature leaves a gap in the magnetic circuit when the relay
March 2022

is de-energized. While in this position, one of the two sets of contacts is closed

while the other set remains open.

When electrical current is passed through a coil, it generates a magnetic

field that in turn activates the armature. This movement of the movable contacts

makes or breaks a connection with the fixed contact. When the relay is de-

energized, the sets of contacts that were closed, open and breaks the connection

and vice versa if the contacts were open. When switching off the current to the

coil, the armature is returned, by force, to its relaxed position. This force is

usually provided by a spring, but gravity can also be used in certain applications.

Most power relays are manufactured to operate in a quick manner.

For distribution of power in high current applications, GEP Power

Products is the industry leader in high power relay module design and

manufacturing.

Rated up to 70 amps, GEP’s power relay modules are designed for

seamless integration in high power distribution applications. The convenient

integral mounting brackets provide easy installation and accessibility. With

endless options such as terminal position assurance available for wire retention,

GEP Power Products’ power distribution solutions and off-road industry

knowledge are second to none.


March 2022

5.4 DC ADAPTER

DC power supplies are power supplies which produce an output DC

voltage. Power supplies are devices that deliver electric power to one or several

loads. They generate the output power by converting an input signal into an

output signal (in this case, a DC output).

Features:-

 Excellent Quality

 Short Circuit, Over Voltage & Over Current Protection


March 2022

 Incredibly Low Fault Rates

 No Minimum Load

 This power supply is a regulated Center Positive power supply

 It's plug design is for Indian power socket so, no plug converter is required

 Compact size & light weight

 High Reliability

 Regulated Stable Voltage

 Good quality SMPS Based Adapter

 Stabilized Output, low ripple & low interference

 Single Output Voltage

 High Efficiency & low energy consumption

Specifications:-

 Input - 100-240 VAC 50/60Hz  

 Category - Switch Mode Power Adaptor (SMPS)

 Output Type - DC

 Output - 5Volts 1Amp


March 2022

CHAPTER 6
PROGRAMMING

6.1 ALGORITHM:
March 2022

1) Start

2) Establish Connection with internet and telegram

3) Send Web address to the user via telegram

4) Send data to the webpage

5) If user request to update data

6) Then update data

7) End

6.2 FLOW CHART:


March 2022
March 2022

6.3 PROGRAM:

// Load Wi-Fi library


#include <ESP8266WiFi.h>
#include <Wire.h>
#include <Adafruit_BMP280.h>
#include <Adafruit_Sensor.h>
#include "MQ135.h"
//uncomment the following lines if you're using SPI
/*#include <SPI.h>
#define BME_SCK 14
#define BME_MISO 12
#define BME_MOSI 13
#define BME_CS 15*/

#define SEALEVELPRESSURE_HPA (1013.25)


#define relay D0
Adafruit_BMP280 bme; // I2C
//Adafruit_BME280 bme(BME_CS); // hardware SPI
//Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); //
software SPI

// Replace with your network credentials


const char* ssid = "Mahesh";
const char* password = "123456789011";

// Set web server port number to 80


WiFiServer server(80);

// Variable to store the HTTP request


String header;
String Weather="";
double rain;
double air;

void setup() {
pinMode(relay, OUTPUT);
digitalWrite(relay, LOW);
Serial.begin(115200);
bool status;
March 2022

// Connect to Wi-Fi network with SSID and password


Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
// Print local IP address and start web server
Serial.println("");
Serial.println("WiFi connected.");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
server.begin();
// default settings
// (you can also pass in a Wire library object like &Wire2)
//status = bme.begin();
if (!bme.begin(0x77)) {
Serial.println("Could not find a valid BME280 sensor, check wiring!");
while (1);
}
}

void loop(){

WiFiClient client = server.available(); // Listen for incoming clients

if (client) { // If a new client connects,


Serial.println("New Client."); // print a message out in the serial port
String currentLine = ""; // make a String to hold incoming data from
the client
while (client.connected()) { // loop while the client's connected
if (client.available()) { // if there's bytes to read from the client,
char c = client.read(); // read a byte, then
Serial.write(c); // print it out the serial monitor
header += c;
if (c == '\n') { // if the byte is a newline character
// if the current line is blank, you got two newline characters in a row.
// that's the end of the client HTTP request, so send a response:
if (currentLine.length() == 0) {
// HTTP headers always start with a response code (e.g. HTTP/1.1 200
OK)
// and a content-type so the client knows what's coming, then a blank line:
March 2022

client.println("HTTP/1.1 200 OK");


client.println("Content-type:text/html");
client.println("Connection: close");
client.println();

rain = analogRead(A0);
rain = map(rain, 0, 1023, 100, 0);
delay(5000);
digitalWrite(relay, HIGH);
delay(5000);
MQ135 gasSensor = MQ135(A0);
air = gasSensor.getPPM();
delay(5000);
digitalWrite(relay, LOW);

// Display the HTML web page


client.println("<!DOCTYPE html><html>");
client.println("<head><meta name=\"viewport\" content=\"width=device-
width, initial-scale=1\">");
client.println("<link rel=\"icon\" href=\"data:,\">");
// CSS to style the table
client.println("<style>body { text-align: center; font-family: \"Trebuchet
MS\", Arial;}");
client.println("table { border-collapse: collapse; width:35%; margin-
left:auto; margin-right:auto; }");
client.println("th { padding: 12px; background-color: #0043af; color:
white; }");
client.println("tr { border: 1px solid #ddd; padding: 12px; }");
client.println("tr:hover { background-color: #bcbcbc; }");
client.println("td { border: none; padding: 12px; }");
client.println(".sensor { color:white; font-weight: bold; background-color:
#bcbcbc; padding: 1px; }");

// Web Page Heading


client.println("</style></head><body><h1>Weather Station using
esp8266</h1>"); //Title

client.println("<table><tr><th>MEASUREMENT</th><th>VALUE</th></tr>");

client.println("<tr><td>Temp. Celsius</td><td><span
class=\"sensor\">");
double Temperature = bme.readTemperature();
client.println(Temperature);
March 2022

client.println(" *C</span></td></tr>");

client.println("<tr><td>Temp. Fahrenheit</td><td><span
class=\"sensor\">");
client.println(1.8 * bme.readTemperature() + 32);
client.println(" *F</span></td></tr>");

client.println("<tr><td>Humidity</td><td><span class=\"sensor\">");
double Humidity = bme.readTemperature()/100*160;
client.println(Humidity); //humidity
client.println(" %</span></td></tr>");

client.println("<tr><td>Dew Point</td><td><span class=\"sensor\">");


double DewPoint = DewPointFast(Temperature, Humidity);
client.println(DewPoint); //humidity
client.println(" *C Td</span></td></tr>");

client.println("<tr><td>Pressure</td><td><span class=\"sensor\">");
client.println(bme.readPressure() / 100.0F);
client.println(" hPa</span></td></tr>");

client.println("<tr><td>Approx. Altitude</td><td><span
class=\"sensor\">");
client.println(bme.readAltitude(SEALEVELPRESSURE_HPA));
client.println(" m</span></td></tr>");

client.println("<tr><td>Rainfall</td><td><span class=\"sensor\">");
client.println(rain);
client.println(" %</span></td></tr>");

client.println("<tr><td>Air Quality</td><td><span class=\"sensor\">");

client.println(air); //humidity
client.println(" PPM</span></td></tr>");
client.println("</body></html>");

// The HTTP response ends with another blank line


client.println();
// Break out of the while loop
break;
} else { // if you got a newline, then clear currentLine
currentLine = "";
}
} else if (c != '\r') { // if you got anything else but a carriage return character,
March 2022

currentLine += c; // add it to the end of the currentLine


}
}
}
// Clear the header variable
header = "";
// Close the connection
client.stop();
Serial.println("Client disconnected.");
Serial.println("");
}
}

// DewPoint Calculation
double DewPointFast(double celsius, double Humidity)
{
double a = 17.271;
double b = 237.7;
double temp = (a * celsius) / (b + celsius) + log(Humidity * 0.01);
double Td = (b * temp) / (a - temp);
return Td;
}
March 2022

CHAPTER 7
RESULT, CONCLUSION AND
FUTURE SCOPE
March 2022

7.1 RESULT:

After detecting the data from different sensor devices, which are positioned in particular

area of interest. The sensed data will be automatically sent to the webserver, when a proper

connection is recognized with server device. The webserver page which will allow us to

monitor the data. By clicking on the received link on telegram we will get the equivalent web

page. The web page gives the information of the weather parameters in that particular region,

where the embedded monitoring system is placed.

7.2 CONCLUSION:
March 2022

This project is developed to help user to access data anywhere in real-time.

User can collect the measurements by the sensors at any time. This means that

whenever user want to know what the weather is, user can have access to

information in real time. Then, real-time alerts which allow the user to plan the

day accordingly. Having insights into these alerts can help avoid emergency

situations.

7.3 FUTURE SCOPE:

In the technological future, there are many features that can be improved upon in

this project. Among the suggestions that can be improved are:

 Adding more sensors in the project weather station.

 The weather station can provide data for forecasts. Once a weather station

is connected, user can view the history of information as well.


March 2022

CHAPTER 8
REFERENCES
March 2022

8.1 BOOKS:

1. Arduino programming by ryan turner


2. Introduction to Arduino by Christina bagain
3. Internet of things with esp8266 by macro schwartz
4. Internet of Things(IOT)Based Weather Monitoring system. AUTHOR:
Bulipe Srinivas Rao, Prof. Dr. K. SrinivasaRao, Mr. N. Ome

8.2 WEBSITES:
1. https://www.arduino.cc/
2. Steps to Setup Arduino IDE for NODEMCU ESP8266 : 14 Steps -
Instructables
3. What is a Gas Sensor? | Fierce Electronics
4. Rain Sensor : Working, Pin Configuration and Applications
(elprocus.com)
March 2022

CHAPTER 9
APPENDIX
March 2022

LIST OF COMPONENT WITH PRICE:

SR. COMPONENT SPECIFICATION UNIT QUANTITY COST


NO. PRIZE

1 NodeMCU ESP12E 450 1 450

2 Dc Jack - 10 1 10

3 DC Power 5v 1Amp 190 1 190


Adapter
4 BMP280 Sensor - 680 1 680

5 Relay 5V 10 1 10

6 Resistors 220Ω 5 2 10

7 Diode 1N4007 1 5 5

8 LED 3.3V/20mA 5 2 10

9 Rain Drop - 150 1 150


Sensor
10 MQ135 Air - 350 1 350
Quality Sensor
11 Header Strips Male/female 10 2 20

12 Copper Clad - 60 1 60
PCB
- TOTAL - - - 1945

You might also like