0% found this document useful (0 votes)
15 views46 pages

IoT Pocket-Sized Weather Monitor

Uploaded by

Subha Goldar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views46 pages

IoT Pocket-Sized Weather Monitor

Uploaded by

Subha Goldar
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

IOT Subha Goldar

BASED Master of Computer Applications-


1st year
POCKET
Enroll No- 12021007015041
-SIZED
REAL- University of
TIME Engineering and
Management, Kolkata
WEATH
ER
MONIT
ORING
SYSTEM
TABLE OF CONTENT
[Link] -3
[Link] -4
[Link] REVIEW -5
[Link] STATEMENT -7
[Link] SOLUTION -9
[Link] ARCHITECTURE - 12
 Circuit Diagram & Connections
 Components Required
 Breadboard Circuit Pictures
 Alternate Compatible Sensors & Modules

[Link] CHART OF THE PROPOSED MODEL - 18


[Link] PROCESS - 19
[Link] (PICTURES) - 20
10. APPLICATIONS - 23
11. FUTURE SCOPE - 25
12. CONCLUSION - 27
13. BIBILOGRAPHY - 29
14. APPENDIX (Arduino Code) - 30 to 43

15.
Abstract
The living environment monitoring is a critical issue today. Many
related research focused on developing the living environment
monitoring systems by using the web-based technology, but
such information systems would increase the difficulty of
promotion and migration to others, because of needing well-
trained engineers to achieve and maintain such information
system. The IOT based Weather Monitoring and Reporting
System is prototype device to get live data of weather data, soil
moisture, pollution & CO2 data, etc. Our device is equally user
friendly, small in size, need no external power source and also
very versatile. It will Monitor temperature, humidity, moisture
and rain level, but similarly can be used with vide variety of
other sensors like UV sensor, Soil humidity sensor, Air quality
sensor, etc. Suppose Scientists/nature analysts want to monitor
changes in a particular environment like volcano or a rainforest.
And these people are from different places in the world. In order
to know the information about weather of a particular place then
they must use online weather apps, but they will still show
weather around large area, not that particular area. This paper
also focuses on the IOT application in the new generation of
environmental information and provides a new paradigm for
environmental monitoring in future. The system has been
development particularly in the view of building smart city by
giving the weather update of any place like a particular office or
room. Additionally, framework permits client to set alarms for
specific situations like weather abnormality and gives cautions
to client if the climate parameters cross safe thresholds. In this
way the IOT based climate announcing framework gives a
productive web-based climate revealing framework for users for
situation with or without available internet connection. The final
prototype of our device can be as small as a 5-inch cell phone,
having an internal rechargeable battery, required sensors, and
can even include a solar cell for charging, making it not only
pocket-sized and versatile, but very easy to use while travelling,
harsh weather conditions or for personal use.
INTRODUCTION
Monitoring weather condition plays an extensive role in every person’s
life. The impact of the environment’s condition causes numerous
challenges in various fields like agriculture, industry, constructions,
metrological as well as more other fields. But it is also true that weather
provided by most online weather stations are focussed on a broad area,
which makes it difficult to get exact and accurate weather and rain data.
Hence our focus in this project is mostly on agriculture, industry and
personal uses which require accurate data collection, while being small in
size. As we all know, agriculture perform a crucial role in India’s
Economy. Almost one fourth of India’s economy is acquired from
Agriculture. Over the recent year, smart agriculture was a debated topic
in the world. In IoT, the smart word indicates that the use of minimum
parameters produces a better result. It reduces the use of land, water,
time as well and the uses of the new technology and science for the
enhancement of crops. The security is one of the major issues in IoT
network, lot of security techniques are available but still many several
possibilities to enhance the existing security. In agriculture, Before the
yield, the Farming process consists of several phases and in that weather
plays the most extensive role. In many places rain, tornadoes, or other
weather fluctuations happens frequently, while online weather data can
only give data over a large area. Due to this situation, in many places the
farming problem occurs due to heavy rainfall. In this situation, an
indication of weather’s condition is an important aspect before sowing or
reaping the crops. Hence in this situation, the monitoring of weather’s
condition would help farmers with the help of a weather monitoring
system. It will help the farmer before reaping and sowing. This paper also
focuses on the IOT application in the new generation of environmental
information and provides a new paradigm for environmental monitoring in
future. The system has been development particularly in the view of
building smart city by giving the weather update of any place like a
particular office or room. Because of its pocket size, using it during
travelling, placing it in isolated places without power supply, and using it
in harsh places becomes possible.
LITERATURE REVIEW
In today’s world many weather monitoring systems are
designed by different environmental parameters.
Cloud Based weather monitoring systems are classified based
on technology used as
1) Wireless Sensor Networks (WSNs)
2) Satellite,
3) Microcontroller,
4) Arduino,
5) GSM,
6) Radar,
7) Zigbee,
8) Prediction based system,
9) Sensor Based System, and
10) Camera Based System.

These different technologies are used to monitor weather, and different


technology have their own pros and cons, some being more accurate, while
some being more mobile and easily usable.

Our project is base on Arduino and Sensor based system from the above
mentioned categories. We can find many simple Iot based weather monitoring
systems on the internet, but a complete device utilising this system and wireless
technology like Bluetooth or Wi-Fi while also being small and versatile is not
available much. There are no commercial product available based on this
technology even though a device like this can be helpful in many different
places and industries. Most industries use simple dedicated sensors needed for
their own work, hence a product like this is not needed much, but still it can be
helpful in many ways, but in some fields like agriculture, they don’t even have
basic or cheap devices capable of sensing weather or soil data which can be
tremendously helpful for increasing crop productivity.

Our project uses Arduino and Sensor based monitoring system. Existing system
model is presented IOT based Weather monitoring and reporting system where
you can collect, process, analyse, and present your measured data on web
server. Wireless sensor network management model consists of end device,
router, gateway node and management monitoring centre. End device is
responsible for collecting wireless sensor network data, and sending them to
both a Local Wi-Fi server, or to Iot platform Thingspeak. After receiving the data
from sensor network, Arduino extracts data after analysing and sending them to
the server. Less formally, any device that have Wi-Fi and can run a browser can
get the data from the device. Servers are used to manage network resources.
The services or information provided through the Internet that are connected
through Wi-Fi and made available for users via smart phones, web browser or
other web browser devices to make the system more intelligent, adaptable and
efficient.

Internet of Things (IOT): It is the future technology of


connecting the entire world at one place. All the objects,
things and sensors can be connected to share the data
obtained in various locations and process/analyses that
data for coordinating the applications like traffic signalling,
mobile health monitoring in medical applications and
industrial safety ensuring methods, etc
PROBLEM STATEMENT
1. Existing weather monitoring systems that are used in
the field generally consist of unconventional and heavy
machinery that consists of numerous moving parts that
require constant maintenance and need to be manually
monitored and changed frequently.

2. Power requirements are one of many major constraints


as these instruments are generally sited far from main
power supply. This adds to the cost of using such
instruments.

3. The use of thermometers to measure external


temperature; however accurate is still outdated and
constantly needs to be manually checked for any change
in temperature.

4. Data that is collected by the instruments needs to be


manually transferred from the logger to a laptop or
computer via a cable.

5. Existing systems consist of large and heavy


instruments that occupy a lot of space hence making it
difficult to install them in remote location and places
which have limited space, or mobility issues while
travelling isolated places.
6. The instruments used in the existing systems are
expensive and add up to the already high cost of
installation and maintenance.
7. The current system always faces problems such as
delay in warning people about bad weather and sudden
changes in the forecast.

8. Even while getting data from sources like online


weather sites and apps, those data tend to show weather
over a large area like city and cannot show pin-point
weather data of a single place.

9. In agriculture, Before the yield, the Farming process


consists of several phases and in that weather plays the
most extensive role, with exact factors like rain, soil
humidity, etc can severely affect plant growth and yield,
where getting weather data from online weather sites
can be severely inaccurate.

10. Getting weather data in places with no internet or


SIM connections like hills, forests, or even backward
villages is not possible even when they have mobile or
PC devices available.
PROPOSED SOLUTION
The system proposed is an advanced solution for
weather monitoring that uses IoT to make its real
time data easily accessible over a very wide range.
The system deals with monitoring weather and
other environmental changes using sensors like-

[Link], 2. Humidity, 3. Atmospheric Pressure 4.


Raindrop sensor for detecting rainfall or snow fall. 5.
Water Quality Sensor 6. Chemical/Smoke & Gas Sensor 7.
Air pollution sensor 8. Electrochemical gas sensor 9.
Chemical sensor 10. Smoke sensor 11. Fluid Level
sensors, etc

Feature and advantages of the proposed


system
1. Our proposed ‘Smart weather monitoring system’ unlike conventional
weather monitoring instruments is very small and compact allowing it to
be installed easily on rooftops, can be carried in pocket during travels,
used in small experiments freely.

2. It is light and portable; this advantage allows us to easily carry it to


remote location for installation. Due to its design, it can easily be carried
by a weather balloon to measure atmospheric changes at high altitudes.

3. The power requirements for our system (sensors and boards) is


much less compared to the existing instruments in the market hence
enabling us to use solar cells as power supply. This not only cuts down
on cost but allows us to leave the monitoring system in remote, areas
where power is not easily available, for long periods of time. Addition of
solar panels also helps our design be eco-friendly.

4. The sensors used in our product are much cheaper compared to the
ones that are used in the existing weather monitoring systems making
our design more cost effective, and price when using 3-4 sensors can
be low as Rs 2000 to produce.

5. These sensors send the data to a web page and the sensor data is
plotted as graphical statistics. The data uploaded to the web page using
local server from NodeMCU, and Thingspeak. The data gathered in
Thingspeak can also be used for future references. Unlike the existing
system where data must be physically transferred.

6. Due to the presence of fewer moving parts less amount of


maintenance will be needed cutting down on maintenance charges.

7. The product can be further developed so that it sends notifications as


an effective alert system to warn people about sudden and drastic
weather changes. This works as an efficient warning system for bad
weather and storms.
SYSTEM ARCHITECTURE
The implemented system consists of a main block
NodeMCU and sensors are connected to the NodeMCU.
NodeMCU collects the information from different sensor,
then it sends the data to thingspeak (while the WI-FI is
connected to the internet), and simultaneously creates a
local server Using the WiFi library within Arduino, our
device will be able to answer a HTTP request from any
connected device to the same Wi-Fi network using the
inbuild WiFI shield within NodeMCU. After opening a
browser and navigating to the WiFi shield's IP address,
our board will respond with just enough HTML for the
browser to display the sensor values from the program.
NodeMCU is the heart of the device. It provides the
platform for IOT. It’s a Wi-Fi module having esp8266
firmware within. All the other sensors are connected to
this microcontroller. They send the measured values to
it, and it uploads all the values to the cloud where the
values are analysed.
Circuit Diagram & Connections

Components Required:
The components needed for this project, i.e., Live
Weather Station Monitoring Using NodeMCU
ESP8266 are given below. All these components
can be purchased from amazon.
1. NodeMCU ESP8266 12E Board
2. BMP180 Pressure Sensor
3. DHT11 Humidity Temperature Sensor
4. Rain Sensor FC37
5. 3 LEDs of Red, Blue and Yellow colours
6. Breadboard
7. Connecting Jumper Wires
8. Rechargeable Battery ( preferably Li-ion or Li- po
)
NodeMCU:
It is the heart of the device. It provides the platform for
IOT. It’s a Wi-Fi module having esp8266 firmware within.
All the other sensors are connected to this micro-
controller. They send the measured values to it and it
uploads all the values to the cloud where the values are
analysed. The developer of this board is ESP8266
Opensource Community. It has an operating system
called XTOS. The CPU is ESP8266(LX106). It has an in-
built memory of 128 Kbytes and a storage capacity of 4
Mbytes.
DHT11 Humidity & Temperature
Sensor:
About DHT11 The DHT11 is a basic, ultra-low-cost digital
temperature and humidity sensor. It uses a capacitive humidity
sensor and a thermistor to measure the surrounding air and spits
out a digital signal on the data pin. It’s simple to use but requires
careful timing to grab data. The digital signal is easy to read using
any microcontroller.
BMP180 Barometric Pressure Sensor:
About BMP180 The BMP180 is the new digital barometric pressure
sensor of Bosch Sensortec, with a very high performance, which
enables applications in advanced devices such as smartphones,
tablet PCs and sports devices. It follows the BMP085 and brings
many improvements, like the smaller size and the expansion of
digital interfaces.

Rain Sensor:
Rain sensors are used in the detection of water beyond what
a humidity sensor can detect. The rain sensor detects water
that completes the circuits on its sensor boards’ printed
leads. The sensor board acts as a variable resistor that will
change from 100k ohms when wet to 2M ohms when dry. In
short, the wetter the board the more current that will be
conducted.
BREADBOARD CIRCUIT PICTURES
ALTERNATE COMPATABLE SENSOR & MODULES
Soil Moisture Sensor: Soil moisture is basically the content of water present
in the soil. This can be measured using a soil moisture sensor which consists of
two conducting probes that act as a probe. It can measure the moisture content
in the soil based on the change in resistance between the two conducting
plates. The resistance between the two conducting plates varies in an inverse
manner with the amount of moisture present in the soil.

Carbon monoxide(co) sensor: Carbon Monoxide (CO) sensor, suitable


for sensing CO concentrations in the air. The MQ-7 can sense CO-gas
concentrations anywhere from 20 to 2000ppm.

GSM 800L: SIM800L is a miniature cellular module which allows for GPRS
transmission, sending and receiving SMS and making and receiving voice calls.
Low cost and small footprint and quad band frequency support make this
module perfect solution for any project that require long range connectivity.
PIR Sensor Module: Passive Infrared Sensor or simply PIR Sensor allows
you to detect or sense any motion.

MQ2 Gas Sensor Module: Often used in safety related applications, the
MQ2 Gas Sensor Module is used to detect Smoke, Carbon Monoxide,
Hydrogen and other gases.

Water level Sensor: Able to sense water level depth in water bodies like
water tanks, wells, lakes, ponds, etc

Wind speed & Direction Monitor: Sensing direction and speed of winds.
Flow chart of the
proposed model
WORKING PROCESS- PROGRAM
STEP 1 – START and declare required header files for connected
sensors and ESP8266 Wi-Fi .

STEP 2 – Declare Thingspeak API-key and WI-FI SSID and Password


of the WI-FI network(s).

STEP 3 - Declare all constant variables required ; all required variables


needed by the sensors with their default value ; and initialize 4 flag
variables.

STEP 4 – Enter SETUP function and initialize all output pins for LEDs ;
begin Serial monitor and print in serial monitor ; begin getting data from
DHT11 sensor , Rain sensor and BMP180 sensor.

STEP 5 – Try to connect to Wi-Fi network using provided SSID and


Password, if not connecting repeat STEP 5.
STEP 6 – When connected to Wi-Fi start main program loop.

STEP 7 – Check Wi-Fi status and goto STEP 8 if Wi-Fi is connected


and repeat STEP 7 if Wi-Fi not connected ; blink Wi-Fi indication LED
according to Wi-Fi status.
STEP 8 - Calculate rain value using data obtained from rain sensor, if
sensor is giving valid data FLAG1 = 0, else FLAG1 = 1.

STEP 9 - Calculate Pressure value using data obtained from BMP180


sensor, if sensor is giving valid data FLAG2 = 0, else FLAG2 = 1.
STEP 10 - Calculate Temperature and Humidity value using data
obtained from DHT11 sensor, if sensor is giving valid data FLAG3 = 0,
else FLAG3 = 1.

STEP 11 - If FLAG1 = 0 or FLAG2 = 0 or FLAG3 = 0 then blink LED


showing sensor error else directly goto STEP 12.

STEP 12 - Start and output HTML page layout for server website.

STEP 13 - Within the HTML code (which will be opened by any


browser) output all sensor data , and output timer showing website time
since boot. At last output if all the sensors are properly connected or not
connected using value of FLAG data collected previously.

STEP 14 - Initiate connection to Thingspeak client , if connected to


Thingspeak client within 1 second , goto STEP 15 or else goto STEP
16.

STEP 15 - Send all sensor data to the provided API-key.

STEP 16 - Stop Thingspeak client.


STEP 17 - Blink LED confirming loop completion and goto STEP 6.

Working Process
Initial setup of Arduino-
First check if all the sensors are connected properly after that check if the
battery pack and other wires are properly connected. Make sure that
correct Wi-Fi SSID and password is entered and check that if the entered
thingspeak API is correct.

Startup of Arduino-
Start Arduino and let it connect to the Wi-Fi network view the indication
and it is show that it is connected to the Wi-Fi

WiFi server data access-


Connect any devices that is to be used to see the sensor data to the
same Wi-Fi network that is connected to the Arduino. After the device is
connected go to any browser preferably Chrome and then in the address
bar search the IP address 192.168 45.6. Using the Wi-Fi library, our
device will be able to answer a Http request with the WIFI Shield within
NodeMCU. After opening the browser and navigating to our Wi-Fi Shield’s
IP address (default- [Link]) the Arduino board will respond with the
HTML present within the program. The page refreshes every 5 to 10
seconds. If any sensor is not connected properly the webpage will deliver
an error message.

ThingSpeak access-
We can use thingspeak platform either using internet on any Browser or
by downloading dedicated thingspeak app from for windows , Android or
iOS. Now we have to login to our thingspeak account to access the
channel or directly enter the channel used in our project In the channels
search bar which will enable us to directly access the data collected from
the Arduino. Any data collected from the Arduino when connected to the
internet is saved within thingspeak channel which will enable us to plot
MATLAB analysis on MATLAB visualization aur graph data for future uses.
But if the Wi-Fi network connected to the Arduino is not connected to the
internet, then the data will not be e transferred to thingspeak but the
data can still be access by the local Wi-Fi server even without internet
enabling us to view data with or without internet.

Sensor error or sensor disconnection-


If the sensor is disconnected what is not giving accurate data, the Arduino
will flash sensor error LED and show cancer of prompt within Wi-Fi server
web page while thingspeak will stop accumulating data.

OUTPUT
APPLICATIONS:
Agriculture Sector
Farmers rely on weather forecasts to decide what work to do on any particular day.
For example, drying hay is only feasible in dry weather. Prolonged periods of
dryness can ruin cotton, wheat, and corn crops. While crops can be ruined by
drought, their dried remains can be used as a cattle feed substitute in the form of
silage. Frosts and freezes play havoc with crops both during the spring and fall. For
example, peach tree in full bloom can have their potential peach crop decimated by
a spring freeze. Orange groves can suffer significant damage during frosts and
freezes, regardless of their timing.

Industrial Sector
Though regional forecasts or online weather forecasts can be helpful in some
industries, most of the time the local weather doesn’t exactly reflect the regional
forecasts. I mean- aren’t we always complaining that the weatherman was wrong?
It’s important for many businesses and industries to have on-site, reliable weather
data. Real-time, local weather instruments may be required in certain industrial
applications, for example: process control, worker safety, incident response,
environmental temperature, wind loads, and precipitation volume.

Mining Sector
There are many environmental factors that must be monitored in the mining
industry. Heat stress, heavy rains, winds, and lightning are all elements that must be
closely watched to ensure personnel safety and ease of operations.

Dairy Sector
Having access to the conditions at your specific site is critical when it comes
to keeping track of the temperature-humidity index to avoid heat stress, keeping
water tanks above the freezing point, watching overnight temperature changes, and
more. To do all this, you need a local dairy weather station.

Fugitive Dust Sector


When in businesses such as building construction, agriculture, concrete and
asphalt, mining, sandblasting, and smokestacks, fugitive dust can be prevalent.
While low levels are unavoidable, many states regulate the level of particulate
matter an individual business may emit into the ambient air.

Hydrology Sector
In applications like flood lines, reservoirs, hydroelectricity, water treatment, and
urban drainage a weather station to measure rainfall, soil moisture, and other
conditions is crucial. You can rest easy knowing that the information you’re receiving
is current, accurate, and relevant.

Severe weather alerts and advisories


A major part of modern weather forecasting is the severe weather alerts and
advisories, which the national weather service’s issue in the case that severe or
hazardous weather is expected. This is done to protect life and property. Some of
the most known severe weather advisories are the severe thunderstorm and
tornado warnings, as well as the recent warnings about areas that are prone to
flood. Other forms of these advisories include winter weather, high wind, flood,
tropical cyclone, and fog. Even though many such places have warning protocols in
place, it is not always 100% accurate, so having a safe method to acquire weather
anomaly data is preferred.

Air Traffic
Because the aviation industry is especially sensitive to the weather, accurate
weather forecasting is essential because a greater number of plane crashes
recorded the world over have weather related causes. Just as turbulence and icing
are significant in-flight hazards, thunderstorms are a major problem for all aircrafts
because of severe turbulence due to their updrafts and outflow boundaries, icing
due to the heavy precipitation, as well as large hail, strong winds, and lightening, all
of which can cause severe damage to an aircraft’s in-flight. Volcanic ash is also a
significant problem for aviation, as aircrafts can lose engine power with ash clouds.

Private Sector
Increasingly, private companies pay for weather forecasts tailored to their needs so
that they can increase their profits or avoid large losses. For example, supermarket
chains may change the stocks on their shelves in anticipation of different, consumer
spending habits in different weather conditions. Weather forecasts can be used to
invest in the commodity market, such as futures in oranges, corn, soybeans and oil.
Also, members of the public use knowledge of future weather conditions to
determine what to put on, on a daily basis.

Military applications
Similarly, to the private sector, military weather forecasters present weather
conditions to the war fighters, community. Military weather forecasters provide pre-
flight weather briefs to pilots and provide real time resource protection services for
military installations. Operations in places with harsh weather also requires needing
precise weather data easily, with high portability and reliability.

FUTURE SCOPE
 Adding more sensor to monitor other environmental parameters
such as CO2, Pressure, Oxygen sensor, Wind speed, Soil Humidity,
and many more which can be interchanged easily just by changing
the code a bit.

 In aircraft, navigation and military there is a great scope of this real-


time system.

 It can also be implemented in hospitals or medical institutes for the


research & study in “Effect of Weather on Health and Diseases”,
hence, to provide better precaution alerts.

 Wireless transmission of the output data directly to the user using


Bluetooth, laser, LCD or other means.

 Directly displaying data in an LCD panel, LED panel or other display


options.

 This system can also be interfaced with solar cells, or Peltier tiles.
This can eradicate the problems of lack of electricity in remote
areas, without the need of recharging it frequently.

 The future work may also include some other protocol like GSM
module that can send messages even in offline mode or airplane
mode.

 Suspending the device from a weather balloon so that it can be


used to record atmospheric parameters at high altitudes and remote
and inaccessible areas.

 Use of a though exterior cover for the system that will act as a
protective cover enabling the device to function in harsh weather
conditions.
 Designing a method to mount the weather monitoring device onto a
buoyant platform like a buoy hence enabling the system to measure
weather changes over the sea. This data can also be shared to
Cargo ships and other nautical industries conducting operations
within the area.

 One can implement a few more sensors and connect it to the


satellite as a global feature of this system.

 Using silica gel to prevent condensation on the exterior cover as


condensation might affect the sensors readings.

 We can also add a GPS module in the design so that the location of
the surrounding will also be mailed or messaged to the user along
with the surrounding parameters, like, temperature, humidity,
pressure, light intensity etc. It can also be modified such that
whenever a message or email is sent from a particular phone
number or email id to the server, all the environmental parameters
of the device along with its location will be delivered to that phone or
email id.

Conclusion
Devices that monitor weather’s parameters with minimum cost in our proposed
system. The proposed system works on the client-side architecture model. The
proposed approach observed various environmental information using multiple
sensors. The main aim of our proposed model is to make the system cost-
effective, affordable, portable and reliable. So that everyone can use it freely. In
our proposed system, capturing multiple data from multiple sensors and send
all the data to the webpage by HTTP request protocol on the web server. It also
sent parameters for the sensor into the cloud (thingspeak). We can have all the
past data in table form, chary form, MATLAB visualisation, MATLAB analysis
with respect to their data and time and done analysis. The proposed model is
not only collecting data but also making decisions based on observed data. It is
very much helpful for farmers because it collects environmental data making an
interpretation for the former. But it is also very important for making another
decision such as or industry work purpose, transportation, forests, military
sector, mining sector, industrial sector, hospitals, etc. The vertical farming helps
to cultivate more crops based on stack formation and it occupy less acres for
such implementation uses hydroponics or aquaponics process for growing the
crops under any conditions are just some of the many ways it can affect and
help in agriculture sector. The accuracy of the proposed model nearly accurate
with real data. This model can be expanded to monitor the developing cities and
industrial zones for pollution monitoring. To protect the public health from
pollution. This system presents the smart way to track the environment and an
effective, low-cost embedded device with various models. There was discussion
of roles of different modules in the proposed architecture. The temperature,
soil moisture, rain fall intensity, humidity levels, CO levels, wind speed, etc with
the definition of Internet of Things (IoT) and are just some of the many forms
this model can be used. It also sent parameters for the sensor into the cloud
(thingspeak) for distance monitoring including a local WI-FI server creation for
internet free use, which can be used with just a single smartphone or PC with
inbuild WI-FI Hotspot. The collected data can aid in future research and can
easily be shared with other end-users. This device can also be used to monitor a
particular room or place whose environmental parameters are required to be
monitored continuously. So this model is just a Prototype or simple model
which can inspire creation of a all purpose weather and possibly even more
than just a only weather monitoring system, where we can use different
modules and sensors as per our use, while being portable, low-cost, accurate,
reliable, and versatile which can be use in variety of fields such as agriculture,
industrial, personal, military, research, hydrology, animal husbandry, etc as such
it uses can be endless where we need more accurate data than just region-wide
weather data from normal online weather sites.

BIBILOGRAPHY
[1] International Journal of Advanced Research in Computer and Communication Engineering ISO
3297:2007 Certified Vol. 5, Issue 9, September 2016
[2] International Journal of Engineering Trends and Technology (IJETT) – Volume 32 Number 2-
February 2016
[3] International Journal of Engineering Science and Computing, May 2017
[4] Sagar J. S. T. , M. S. Balamurugan and J. A. Vivek, “A wireless framework for automotive
monitoring systems,” in Indian Journal of Science and Technology, Vol 8(19), IPL0146, August 2015
[5] [Link] ensor_module.pdf
[6] [Link] torial/2017/01/24/soilmoisture_sensor.html
[7] content://[Link]/readinglist/07 [Link]
[8] [Link]
[9] [Link]
[10] S. Gangopadhyay and M. K. Mondal “A wireless framework for environmental monitoring and
instant response alert,” in 2016 International Conference on Microelectronics, Computing and
Communications(MicroCom), Jan 2016, pp. 1–6.
[11] T. Thaker, “Esp8266 based implementation of wireless sensor networkwith linux based web-
server,” March 2016.
[12] International Journal of Engineering Trends and Technology (IJETT) –Volume33-
March2016‘AnAutomatedThingSpeak Weather Monitoring System using Raspberry PI’M. Ramesh1,
Dr. S.A.K. Jilani2, Mr.S.Arun3 Department ofElectronics&Communication Engineering, MITS,
Madanapalle, India
[13] [Link]
[14] [Link]
[15] [Link] /all
[16] [Link]
[17] [Link]
[18] [Link]

APPENDIX
FULL ARDUINO – CODE

#include <ESP8266WiFi.h>
#include <DHT.h>
#include <SFE_BMP180.h>
#include <Wire.h>

#define ALTITUDE 16.0


#define DHTPIN 0 // what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11

SFE_BMP180 pressure;
DHT dht(DHTPIN, DHTTYPE);
String apiKey = "I7TTY9P9CAEYKHJ5";
const char* ssid = "Redmi"; // WIFI ssid
const char* password = "12345678"; // WIFI Password

char status;
double T,P,p0,a;
WiFiServer server(80);
const char* server2 = "[Link]";
int ra=0,i,sec,m,hr,mi,flag1,flag2,flag3,FLAG;
int rainPin = A0;
int thresholdValue = 500;
int p=1005;
int f1ag1=0;
WiFiClient client;
void setup()
{
pinMode(D0, OUTPUT); //LED Output
pinMode(D5, OUTPUT);
pinMode(D8, OUTPUT);
pinMode(D4, OUTPUT); //LED Output
pinMode(rainPin, INPUT);
//-------------------------------------------------------------------------------------------
[Link](115200); // Beginning Wifi at baud rate 11520
delay(100);
[Link]();
[Link]("\n ");
[Link]("\n IoT WEATHER STATION PROJECT WORK \n\n");
[Link]("Connecting to WiFi ... Please Wait ... ");

[Link](ssid);
delay(100);
[Link](ssid, password);
//------------------------------------------------------------------------------------------
while ([Link]() != WL_CONNECTED) // Checking Wifi status
{
delay(500);
digitalWrite(D0, HIGH);
[Link](".");
digitalWrite(D4, HIGH);
delay(100);
digitalWrite(D4, LOW);
delay(100);
digitalWrite(D8, HIGH);
}
digitalWrite(D8, LOW);
[Link]("");
[Link](" *** WiFi is connected ***");
[Link](" *** Web Server started ***");
[Link](" Connect to the below IP Address in browser on any device connected onto same wifi
network as the NodeMCU");
[Link](); //Begins the Web Server

[Link]([Link]()); //Prints the ip address


[Link]();
}
//--------------------------------------------------------------------------------------------
// Starting main program loop
//-------------------------------------------------------------------------------------------
void loop() {
while ([Link]() != WL_CONNECTED)
{
digitalWrite(D0, HIGH);
digitalWrite(D4, HIGH); // turn the LED on (HIGH is the voltage level)
delay(100);
digitalWrite(D4, LOW);
delay(100);
digitalWrite(D8, HIGH);
}
digitalWrite(D8, LOW);
m= millis();
sec= m/1000;
mi= sec/60;
hr= mi/60;

//------------------------------------------------------------------------------------------
// RAIN SENSOR
//------------------------------------------------------------------------------------------
int sensorValue = analogRead(rainPin);
if(sensorValue < thresholdValue){
ra=1;
}
else {
ra=0;
}
if(sensorValue<15)
flag3=1;
else flag3=0;
//------------------------------------------------------------------------------------------
// BMP180 BAROMETER SENSOR
//------------------------------------------------------------------------------------------
// You must first get a temperature measurement to perform a pressure reading.
status = [Link]();
if (status != 0)
{
delay(status);
status = [Link](T); //Getting Temprature from BMP180
flag1=0;
if (status != 0)
{
status = [Link](3); //Getting pressure from BMP180
flag1=0;
if (status != 0)
{
delay(status);
// Note also that the function requires the previous temperature measurement (T).
status = [Link](P,T);
flag1=0;
if (status != 0)
{
flag1=0;
}
else flag1=1;
}
else flag1=1;
}
else flag1=1;
}
else flag1=1;
//-----------------------------------------------------------------------------------------
// DHT11 HUMIDITY and TEMPERATURE SENSOR
//-----------------------------------------------------------------------------------------
float h = [Link]();
// Read temperature as Celsius (the default)
float t = [Link]();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = [Link](true);
if(h>20 && h<100)
{
flag2=0;
}
else flag2=1;
//-----------------------------------SENSOR CONNECTIVITY CHECKER--------------------------
if(f1ag1==1 || flag2==1 || flag3==1)
{
digitalWrite(D5, HIGH);

}
else digitalWrite(D5, LOW);

//----------------------------------------------------------------------------------------
for(i=0;i<5;i++)
{
digitalWrite(D0, HIGH);
delay(200);
digitalWrite(D0, LOW);
delay(100);
}
//----------------------------------------------------------------------------------------
// Starting HTML layout for server website

WiFiClient client = [Link]();


[Link]("HTTP/1.1 200 OK");
[Link]("Content-Type: text/html");
[Link]("Connection: close"); // the connection will be closed after completion of the response
[Link]("Refresh: 1"); // update the page after 10 sec
[Link]();
[Link]("<!DOCTYPE HTML>");
[Link]("<html>");
[Link]("<style>html { font-family: Cairo; display: block; margin: 0px auto; text-align: left;color:
#333333; background-color: #FFFFFF;}");
[Link]("body{margin-top: 30px;}");

[Link]("hr.new1 {border-top: 1px dotted red;}");


[Link]("hr.new2 {border-top: 2px dotted #0000FF;}");
[Link]("hr.new3 {border-top: 2px dashed red;}");
[Link]("hr.new4 {border-top: 5px solid red;border-radius: 1px;}");

[Link]("h1 {margin: 50px auto 30px; font-size: 55px; text-align: center; background-color: #ffcccc;
border:4px solid Tomato;}");
[Link]("h3 {margin: 50px auto 30px; color:#0000CD; font-size: 35px; text-align: center;background-
color:#66e0ff; border:3px solid Tomato;}");
[Link]("h4 {margin: 50px auto 30px; font-size: 28px; text-align: center;}");
[Link]("h5 {margin: 50px auto 30px; font-size: 30px; text-align: center; border:3px solid
Tomato;background-color: #ffe6e6; color: #DC143C;}");
[Link](".side_adjust{display: inline-block;vertical-align: middle;position: relative;}");
[Link](".text1{font-weight: 180; padding-left: 15px; font-size: 35px; width: 170px; text-align: left;
color: #00008B;}");
[Link](".data1{font-weight: 180; padding-left: 70px; font-size: 40px;color: #DC143C;}");
[Link](".text2{font-weight: 180; padding-left: 10px; font-size: 40px; width: 170px; text-align: left;
color: #DC143C;}");
[Link](".text3{font-weight: 180; padding-left: 15px; font-size: 35px; width: 250px; text-align: left;
color: #374048;}");
[Link](".text4{font-weight: 180; padding-left: 15px; font-size: 35px; width: 150px; text-align: left;
color: #374048;}");
[Link](".data3{font-weight: 180; padding-left: 50px; font-size: 35px;color: #00e600;}");
[Link](".data{padding: 10px;}");
//-----------------------------------------------------------------------------------------------
[Link]("table {width:100%;}");
[Link]("table, th, td {border: 1px solid black; border-collapse: collapse;}");
[Link]("th, td {padding: 8px;text-align: left;}");
[Link]("table tr:nth-child(even) {background-color: #00FA9A;}");
[Link]("table tr:nth-child(odd) {background-color: #fff;}");
[Link]("table th {background-color: black;color: white;}");
//-----------------------------------------------------------------------------------------------
[Link]("</style>");
[Link]("</head>");
[Link]("<body>");
[Link]("<div id=\"webpage\">");
//-----------------------------------------------------------------------------------------------
[Link]("<h1>Weather Station server</h1>");
[Link]("<hr class=\"new4\">");
//------------------------------------------------------------------------------------------------
[Link]("<div class=\"data\">");
[Link]("<div class=\"side_adjust text1\"> Humidity:</div>");
[Link]("<div class=\"side_adjust data1\">");
[Link](h);
[Link]("<div class=\"side_adjust text2\">%</div>");
[Link]("</div>");
//-----------------------------------------------------------------------------------------------
[Link]("<hr class=\"new2\">"); //Horizontal line
[Link]("<div class=\"data\">");
[Link]("<div class=\"side_adjust text1\"> Temperature:</div>");
[Link]("<div class=\"side_adjust data1\">");
[Link](t);
[Link]("<div class=\"side_adjust text2\"> *C</div>");
[Link](f);
[Link]("<div class=\"side_adjust text2\"> *F</div>");
[Link]("</div>");
//-----------------------------------------------------------------------------------------------
[Link]("<hr class=\"new2\">"); //Horizontal line

[Link]("<div class=\"data\">");
[Link]("<div class=\"side_adjust text1\">Pressure:</div>");
[Link]("<div class=\"side_adjust data1\">");
[Link](p);
[Link]("<div class=\"side_adjust text2\">mb</div>");
[Link]("</div>");
[Link]("</div>");

[Link]("<hr class=\"new2\">"); //Horizontal line


//------------------------------------------------------------------------------------------------
[Link]("<div class=\"data\">");
[Link]("<div class=\"side_adjust text1\">Rain :</div>");
if (ra==1)
{
[Link]("<div class=\"side_adjust data1\">It's Raining</div>");
}
else
{
[Link]("<div class=\"side_adjust data1\">It's Not Raining</div>");
}
[Link]("<hr class=\"new4\">");
[Link]("<hr class=\"new3\">");
[Link]("</div>");
//-------------------------------------------------------------------------------------------------
[Link]("<div class=\"data\">");
[Link]("<div class=\"side_adjust text3\"> Time Since Boot: </div>");
[Link]("<div class=\"side_adjust data3\">");
[Link](sec);
[Link]("<div class=\"side_adjust text4\"> Second</div>");
[Link](mi);
[Link]("<div class=\"side_adjust text4\"> Minute </div>");
[Link](hr);
[Link]("<div class=\"side_adjust text4\"> Hour </div>");
[Link]("</div>");
[Link]("<hr class=\"new3\">");
[Link]("<hr class=\"new4\">");
if(flag1==1 || flag2==1 || flag3==1)
{
[Link]("<h1>*** WARNING ***<br>*** Sensor(s) is disconnected or malfunctioning ***</h1>");
FLAG=1;
}
else
{
FLAG=0;
}
//-------------------------------------------------------------------------------------------------
[Link]("<h3><u>Internet of Things(Iot) Project Work </u><br> MCA 1st year</h3>");
//-------------------------------------------------------------------------------------------------
[Link]("<h4>Group Members</h4>");
[Link]("<table>");
[Link]("<tr>");
[Link]("<th>Name</th>");
[Link]("</tr>");

[Link]("<tr>");
[Link]("<td>Subha Goldar</td>");
[Link]("</tr>");
//----------------------------------------------------------------------------------------------------

[Link]("<hr class=\"new1\">");
[Link]("<h4><u>Weather Fields Used in current Web Page</u><br></h4>");
[Link]("<h5><u>Humidity</u>: Humidity is the amount of water vapor in the air. <br><u>Unit
used</u> : Percentage(%) of saturation of water vapours in air</h5>");
[Link]("<h5><u>Temprature</u>: Atmospheric temperature is a measure of temperature at
different levels of the Earth's atmosphere. It is governed by many factors, including incoming solar
radiation, humidity and altitude. <br><u>Unit used</u> : Celcius(*C) and Fahrenheit(*F)</h5>");
[Link]("<h5><u>Pressure</u>: Atmospheric pressure is the pressure of the atmosphere on the
Earth's surface.<br><u> Unit used </u>: millibars (mb),the unit of pressure found on weather maps,
Average pressure at sea level is 1013.25 mb. </h5>");
[Link]("<h5><u>Rain</u>: It uses the rain sensor to check if it is raining or not in real time. It does
not show numerical values as output </h5>");
//------------------------------------------------------------------------------------------------------
[Link]("<hr class=\"new4\">");
[Link]("<h4>1. This Webpage is created with HTMLserver in NodeMCU and it doesn't require
internet access to work.</h4>");
[Link]("<h4>2. All data is uploded via WIFI from sensors onboard connected to NodeMCU.</h4>");
[Link]("<h4>3. The page is updated every 2-5 seconds automatically, giving almost Real Time
Weather Data. </h4>");
[Link]("<h4>4. Any Device connected to the same WIFI network as the NodeMCU can access this
server Webpage by typing the IP address in browser. </h4>");
[Link]("<h4>5. If any field is giving (nan) outpur or empty field, that means that sensor is
disconnected from NodeMCU. </h4>");
[Link]("<hr class=\"new4\">");
[Link]("<h4>THANKS FOR VISITING OUR PAGE<br></h4>");

[Link]("</body>");
[Link]("</html>");
//--------------------------------------------------------------------------------------------------------
if ([Link](server2,80))
delay(1000) ;
{
String postStr = apiKey;
postStr +="&field1=";
postStr += String(t);
postStr +="&field2=";
postStr += String(h);
postStr +="&field3=";
postStr += String(p);
postStr +="&field4=";
postStr += String(ra);
postStr +="&field5=";
postStr += String(FLAG);
postStr += "\r\n\r\n\r\n\r\n\r\n";

[Link]("POST /update HTTP/1.1\n");


[Link]("Host: [Link]\n");
[Link]("Connection: close\n");
[Link]("X-THINGSPEAKAPIKEY: "+apiKey+"\n");
[Link]("Content-Type: application/x-www-form-urlencoded\n");
[Link]("Content-Length: ");
[Link]([Link]());
[Link]("\n\n");
[Link](postStr);
[Link]("Temperature: ");
[Link](t);
[Link]("* Celcius, Humidity: ");
[Link](h);
[Link](", Pressure: ");
[Link](p);
[Link](", Rain: ");
[Link](ra);
[Link]("... Sending to Thingspeak...");
}
delay(500);
[Link]();
//--------------------------------------------------------------------------------------------------------
delay(700);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500);
digitalWrite(LED_BUILTIN, LOW);
delay(700);
}

You might also like