Wireless Weather Station
Submitted in partial fulfilment of the requirements of the subject
ECE 3501 loT Fundamentals
by
‘Yashraj Singh
19BEE0148
Anaswara Santhosh
19BEE0149
Antra Nakhasi
19BEEO162
Snehil Patel
19BEE0164
Under the Guidance of
Prof/Dr. Abhishek G
‘School of Electrical Engineering
VIT University, Vellore
December 2021Executive Summary
There has been an average increase of global temperature of 0.18°C per decade since
1981, consequently led to a seven-inch increase in the global sea level in the past 100 years;
inevitably triggering recurrent intense droughts, storms, heatwaves, and unpredictable climate
and weather. Hence, there has been a rise in demand for weather stations.
‘A weather station comprising of a few sensors can be used for measuring a variety of
parameters like temperature, pressure, humidity, indoors and as well as outdoors. In this,
project, we will be using the DHT1I sensor for monitoring temperature and humidity, with the
BMP180 sensor to calculate the pressure. Arduino Uno microcontroller board will be used
along with the ESP8266 Wi-Fi module for internet connectivity. The device is loT enabled; the
data accumulated will be sent to the ThingSpeak channel, enabling live monitoring accessed
remotely. The data will be stored there and analysed.
Weather Stations are an imperative part of industrial processes, warehouses, and
houses; to determine interior and exterior climate and humidity within walls. These IoT-
enabled devices are increasing in practice within households. In this project, we aim to create
a wireless weather station that can be used in our houses.Table of Contents
Declaration
Certificate
Acknowledgments
Executive Summary
Table of Contents
Table of Figures
1. Introduction
1.1.Objective
1.2.Motivation
rature Review
2.1 Materials Used
3. Methodology
3.1 Block Diagram
3.2.Circuit Diagram
3.3.Execution
4. Results and Discussions
5. Scope of Future Work
6. Conclusion
7. References
8. Appendix -1
vi
ii
iv
vi
Vii
2
B
14
15
16Table of Figures
Figure 1: Direct Measurements of CO2 from 2005 — present
Figure 2: Satellite sea level observations
Figure 3: Global Land Ocean Temperature Index
Figure 4: Average Arctic Sea ice extent each September since 1979
Figure 5: Wireless Weather Station available in the market
Figure 6: DHT Sensor
Figure 7: BMP180 Sensor
Figure &: ESP8266 WiFi Module
Figure 9: Arduino UNO
Figure 10: ThingSpeak
Figure 11: Block Diagram of the Project
Figure 12: Circuit Diagram
Figure 13: Hardware Circuit
Figure 14: Algorithm to calculate pressure from BMP180
Figure 15: After setting up, ThingSpeak channel will look like this
Figure 16: Humidity Graph from ThingSpeak channel
Figure 17: Teperature Graph from ThingSpeak channel
Figure 18: Pressure Graph from ThingSpeak channel
Figure 19: Values printed in the Serial Monitor
Figure 20-Graphs obtained over the period
vil
9
10
10
ulIntroduction
As Internet of Things technology has developed and became more affordable, more
devices based on this technology are being introduced. IoT is a network of physical objects
where in electronics are incorporated, along with software, sensors and microcontrollers, which
enable users to obtain accurate and timely data through various services for data exchange
among the users or other connected devices. In this loT-based wireless weather monitoring
system, environmental parameters can be retrieved through sensors,
Weather forecasting is done for predicting the weather from the values obtained from
sensors or instruments. On the basis of weather forecasting patterns, precautions can be taken
on even harsh weather conditions. A wireless weather system is a system with instruments and.
equipment for measuring atmospheric conditions to provide information for weather forecasts
and to study the weather and climate. Weather monitoring is helpful in various applications
like in the field of agriculture, medical suited environments and dis
er management. They
also play a major role in critical scientific systems or in simulation purposes.
1.1. Objective
In this project, a wireless weather station consisting of a few sensors is developed for
‘measuring a variety of parameters like temperature, pressure, humidity, indoors and as well as
outdoors, The data obtained from this can be accessed anywhere and anytime.
Sensor DHTI1 is used for monitoring temperature and humidity, along with the
BMP180 sensor to calculate the pressure, Arduino Uno microcontroller board is used along.
with the ESP8266 Wi-Fi module for internet connectivity. As the device is loT enabled, the
data accumulated will be sent to the ThingSpeak channel, enabling live monitoring access
remotely. The data will be stored there and analysed.
1.2. Motivation
Monitoring weather conditions is necessary in a lot of ways. The weather parameters
are required to be monitored to sustain the development in agriculture, to ensure the safe
working environment in industries, transportation and in overall health of living creatures. Air
pollution is a significant threat to the health of living creatures and the environmentIndustrialization and growth in traffic has greatly impacted the increase of air pollution, causing
deterioration in the air quality.
One of the major factors affecting the air quality changes are the changes in day-to-day
‘weather, as it is the weather conditions that determine how quickly the pollutants are dispersed
away from an area, Weather also plays a role in the thickness of the atmospheric layer, where
the hazardous emissions are diluted,
pial
Figure I: Direct Measurements of CO2 from 2005 ~ present
igure 2; Satelite Sea level observations
=e “OWN,
igure 3: Global Land Ocean Temperature Indes Figure 4: Average Arctic Sea ice exten each S
since 1979
¢ current level of CO2 in our atmosphere is 417 parts per million, Over the past 171
‘years, human activities have raised atmospheric concentrations of CO2 by nearly 49% above
pre industrial levels starting in 1850, There has been a 118°C temperature increase in global
temperature change since 1880. Nineteen of the hottest years have occurred since 2000. 427
billion metric tons of ice sheets are lost per year which has led to an increase in the sea level
by 7 inches. This has inevitably triggered recurrent intense droughts, storms, heatwaves, and.
unpredictable climate and weather. Hence, there has been a rise in demand for weather stations
to help people take precautions against harsh weather conditions. [1]Literature Review
Measuring and forecasting weather conditions is critical in order to understand the
formation, transformation, transport, and removal of the pollutants, Identification of the
sources, effects on mixing, transformation and transportation will help to control the air quality
and implement the required preventive actions to reduce emissions.
Remote monitoring of weather parameters is important in various applications and
industrial processes. In older times, weather monitoring systems were generally based on
‘mechanical and electromechanical instruments, Those had many drawbacks such as poor
rigidity, requirement of human intervention, associated parallax errors and durability. Whereas
the combination of sensors with data acquisition systems has proved to be a far better approach.
for weather monitoring.
Over the last decade, technological advances and scientific breakthroughs have allowed
weather forecasts and warnings to become much more specific and accurate, As computer
technology and high-speed dissemination systems evolved (c.g., Internet), customers/partners
were demanding detailed forecasts in gridded, digital and graphic formats. Traditional weather
text forecast products limit the amount of additional information that can be conveyed to the
user community. The concept of digital database forecasting provides the capability to meet
customer/partner demands for more accurate, detailed forecasts,
Figure 5: Wireless Weat
1 Station available in the market
The following are some of the researches referenced:
1. Wireless Arduino Based Weather Station: Using Arduino microcontroller, Adafiuit
C3000 Wi-Fi Shield, DHTI1 sensor, raindrop sensor module and BMP180 sensor a2.1.
weather station was created. The data was then sent to the cloud and using ThingSpeak,
it was visualised and analysed, [2]
. lo based weather station: The author uses a different sensor to scale the various
parameter like humidity, temperature, pressure, rain value & the LDR sensor is used,
The system also calculates the dew point value from the temperature prototype. The
author in this used an additional functionality of the weather monitoring as SMS alert
system and an email and tweet post alerting system, The author in this system uses node
MCU 8266, and various sensors. [3]
Remote Monitoring System of Temperature and Humidity Based on GSM: This survey
discuss, the use of many sensors that are able to continuously read some factors that
indicate the weather conditions such as temperature, humidity and light intensity in an
industrial environment. [4]
Materials Used
DHTII Temperature and Humidity Sensor: The DHTL1 isa low-cost digital sensor that
‘measures temperature and humidity, It can easily be interfaced with any
microcontroller, such as Arduino, Raspberry Pi, and so on, to measure humidity and
temperature in real time. The temperature sensing element is a thermistor and a
capacitive humidity sensing clement and a for temperature sensing. Temperature
measuring range is 0° to 50°C + 2°C while the humidity range is 20% to 80% + 5%.
With a variety of applications, including the measurement of humidity and temperature
in heating, ventilation, and air conditioning systems, itis used in this project to forecast
weather conditions,
igure 6: DHTH1 Sensor2. BMPI180 Barometric Sensor: Bosch's BMP 180 is a Digital Barometric Pressure Sensor.
It is a piezo resistive MEMS device with ultra-low power consumption. It is capable of
‘measuring atmospheric pressures ranging from 300 hPa to 1100 hPa. The actual
BMPI80 Sensor is a small device measuring 3.6mm x 3.8mm. It comes ina 7-pin LGA
package and communicates with a microcontroller via I2C or SPI. The I2C interface is
used to communicate with the BMP180 barometric sensor. This means that it only uses
two pins to communicate with the Arduino.
Figure 7: BMP180 Sensor
3. ESP8266 Wi-Fi Module: Espressif Systems’ Esp8266 Wi - fi module is a low-cost,
easy-to-use, compact-sized, and low-power Wi-Fi module that supports both TCP/IP
and Serial Protocol. The processor operates at 80MH7. It has an inbuilt regulator that
helps provide 3.3V power to the board on a continuous basis. It supports APSD, making
it an excellent solution for VoIP and Bluetooth applications. The module can work both
as an Access point (can create hotspot) and as a station (can connect to Wi-Fi), hence
it can easily fetch data and upload it to the internet making the Internet of Things as
easy as possible. It can also fetch data from the internet using APIs.
igure 8: ESP8266 Wi-Fi Module4, Arduino UNO: The Arduino UNO is an open-source microcontroller board designed
by Arduino.ce that is based on the ATmega328P microprocessor. The board has a
number of digital and analog /O pins that may be used to connect to expansion boards
and other devices. There are 14 digital pins and 6 analogue pins on the board, It may be
programmed using the Arduino IDE and a USB type B connector. It takes voltages
between 7 and 20V and may be powered by a USB connection or an external 9V battery.
It has an Atmegal 6U2 that has been coded as a USB-to-serial converter. The Arduino
UNO is the most user-friendly and widely used board in the Arduino board family.
Figure 9 Antudno UNO
5. ThingSpeak: ThingSpeak is a Ruby-based open-source programme that allows users to
speak with intemet-connected gadgets. By giving an API to both devices and social
network websites, it makes data access, retrieval, and logging easier. ThingSpeak
includes support for MathWorks! MATLAB numerical computing programme,
allowing ThingSpeak users to analyse and display submitted data using MATLAB
without having to acquire a MATLAB licence, We can feed data from the devices to
ThingSpeak, produce real-time visualisations of live data, and deliver alarms,
MATLAB
z,
oJ Sensor anaes
FigsMethodology
I. Block Diagram
Temperature and Pressure
Humidity
Microcontroller
(Arduino Uno)
ESP8266
Modul
ThingSpeak
Server
Figure 1
lock Diagram ofthe Project
Humidity, Temperature and Pressure are three basic parameters to build any Weather
Station and to measure environmental conditions. To measure the temperature and humidity,
we will be using DHT11 sensor, while the BMP180 sensor to calculate the pressure.‘The signal generated from sensors is transmitted to a Microcontroller. It collects the
{data from the sensors (DHTII and BMP180) and process the raw data to useful data. Arduino
‘UNO is used for this. To send the collected data to ThingSpeak server, ESP8266 Wi-Fi Module
is used for intemet connectivity. Sending these data to ThingSpeak server allows real-time
‘monitoring from anywhere in the world, as well as viewing the logged data on their website
and graphing it over time for analysis.
IL. Circuit Diagram
Figure 12: Cire Diagram
‘The DHTII sensor is powered by the SV pin of the Arduino and its data pin is
‘connected to pin 5 for one-wire communication. The BMP180 sensor is powered by the 3.3V
pin of Arduino and its data pins SCL (Serial Clock) and SDA (Serial Data) are connected to
the A4 and AS pin of Arduino for I2C communication,
‘The ESP8266 module is also powered by the 3.3V pin of the Arduino and its Tx and
Rx pins are connected to Digital pins 2 and 3 of Arduino for serial communication,Il. Execution
Step — 0: Connect the circuit as shown in the circuit diagram
Figure 13; Hardware Circuit
Step — 1: Include the required Libraries.
Include the necessary libraries like Wi-Fi to help connect to the internet, the DHT
library to read the values from the DHTII sensor, Software Serial Library to allow
‘communication on other digital pins of the Arduino and the SFE_BMP180 library to help
communicate with sensor. The DHT11 sends the 40-bit data that the DHT library helps the
microcontroller read. the data is in the following format:
S-bit integral relative humidity data + 8-bit decimal relative humidity data + 8-bit integral
temperature data + 8-bit decimal temperature data + 8-bit check sum
As for the SFE_BMP180, the maths behind calculating the data from the pressure sensor is
quite complicated and this library simplifies the process.s(ur- acon Acs!
aeme=2"1¢- M0)
er extee
re(oes00)
evose ose)
Lrsvescoyat
ing 20612
iedlengh “(000 2)
featean ist oxtooteo0) ip ser" 2}7e43
fesiowaoe) wen te essone] te reg-Pra seetps(er/00)"2t
secroatoes weed Crgore(me,oriaseorspue] fieler ese)
Bueecoon owen [pepmbccs usecase ricer) | [acai
aseranepya
one kavoronat
10
eid egOs'6 MBL OFT ASE) DISPLAY PRESSURE VALUES
Figure 14 Algorithm to calculate pressure from BMPI8O
Step — 2: Make the device oT enabled
Create a ThingSpeak channel. In the channel settings, define and enable the different
fields of data incoming from the circuit. There are three fields required: Humidity, Temperature
and Pressure. In the code, define the ThingSpeak server and the API key obtained from the
ThingSpeak channel, Define the Wi-Fi Router’s SSID and password and using the different
‘commands of ESP8266 connect to the internet.
Figure 15: After seting up, ThingSpeak channel will look lke thisStep — 3: Read the value from the sensors
u
Every 60 seconds read the temperature, humidity and pressure values transmitted by
the sensors. Send this data to the ThingSpeak server for the different fields already set. (See
“Appendix — 1 for the code)
Step — 4: Get the output
Print the values on the serial monitor and observe the graphs plotted on the ThingSpeak
channel Restart the Wi-Fi Module and repeat the above steps.
Figure 16: Humidity Graph from ThingSpeak channel
i,
I
Figure 17: Temperature Graph from ThingSpeak chanel
eather station
Figure 18: Pressure Graph from ThingSpeak channel
—i—
igure 19: Values printed in he Serial Monitor12
Iv. Results and Discussions
‘The hardware circuit of a wireless weather station was created. This device was loT
enabled as it sends the data received from the sensors to the ThingSpeak channel. In the channel
the graphs for humidity, temperature and pressure were plotted.
Initially, the device was only operated for a few minutes to check the functionality of it. It was
then switched ON for a few minutes a day from 24" November 2021 to 2™! December 2021.
‘The data obtained from each day was noted down and compared to the weather data available
of the area, The area is Indirapuram, Ghaziabad,
aie
igure 20:Graphs obtained over the period
‘The following table shows the values taken from the weather forecast and those from
the sensors. As the weather forecast informs the values of a place, in certain areas within the
place the values are bound to be bit different. The data obtained from the sensors shows the
weather inside a house, Hence, they are bound to more accurate to actual environment indoors.
The weather station can help us monitor the environment indoors and take decisions
accordingly. It may also be noted, that the values differ a bit from the weather forecast but are
approximately near to them.WEATHER FORECAST
SOR VALUE:
Pressure Temperature | Humidity | Pressure | ‘Temperature Humidity
Nowe] vue | 28C | atm | ANE | 0c ate
ovemver| mbar | 266 | 82% | iy | 227 | 72%
Noone) WS | awe cox | 3 | aoe | 6am
ovemver| mbar 27 | 50% |e | IRC
December | mi | 2°C | 6% | ine | tere | 70%
peccmer{ nner | 17 | 9% | ME | mre | 78%4
V. Scope of Future Work
In this project, the DHT11 and BMP180 sensors were used to measure the temperature,
pressure and humidity of an area, Other parameters can also be added to increase the scope of
the understanding of the weather of an environment. These include air pollution using the MQ
gas sensor, the Light Intensity using an LDR, rain sensor to measure rain droplet in the
atmosphere ete.
Apart from the user experience of the software can be improved by deploying an app
‘that has the data, Different analysis can also be incorporated from the data like the high and
low temperatures, average pressure and humidity ete, [5] An SMS alert system and email
notification systems for drastic change in the environment and alerts can also be included. [6]
An LCD display can be interfaced to give the data,
Zigbce and other low-cost communication networks can be incorporated. These
techniques function as communication channel in the hardware with sensor. They also are low
power and fulfil the unique needs of an [oT network. [7]
In this project, the basic foundation was laid on, Adding the above features will improve
the device and enhance its range of capabilities.15
VI. Conclusion
Weather has become increasing unpredictable; blizzards, heavy rainfall, flooding and
heatwaves have become the new normal, Whether to protect oneself and property from damage
orto make decisions, knowing the environment of an area is essential. This project concentrates
on the increasing importance of gathering and dissemination of information regarding the
‘weather especially in indoors environments.
In this project, the values of temperature, pressure and humidity were measured in an
indoor environment in Ghaziabad. This data then was sent to the ThingSpeak channel and
graphs of the variation in the different fields were plotted over a duration of a week. These
values were then compared to local weather forecast. It was observed that while the values
were not exactly the same, they were in the general vicinity of each other. Hence, indoor
environment differs from the outdoor environment and there is a need to constantly monitor so
as to not cause harm to property.16
VIL. References
[I] C. Schramek and S. Harmeling, “Climate Change,” CARE Intemational, Geneva,
Switzerland, 2001
[2] A. Katyal, R. Yadav and M. Pandey, “Wireless Arduino Based Weather Station,”
International Journal of Advanced Research in Computer and Communication
Engineering, vol. V, n0. 4, pp. 274-276, 2016.
[3] R. K. Kodali and S. Mandal, “Io based weather station,” in International Conference on
Control, Instrumentation, Communication and Computational Technologies (ICCICCT),
Kumaracoil, India, 2016.
[4] J. Ding, J. Zhao and B. Ma, “Remote Monitoring System of Temperature and Humidity
Based on GSM,” in 2009 2nd International Congress on Image and Signal Processing,
Tianjin, China, 2009.
[5] A. Munandar, H. Fakhrurroja, M. I. Rizqyawan, R. P. Pratama, J. W. Wibowo and I. A.
Fakhry Anto, “Design of real-time weather monitoring system based on mobile application
using automatic weather station,” in International Conference on Automation, Cognitive
Science, Opties, Micro Electro-Mechanical System, and Information Technology
(ICACOMIT), Jakarta, Indonesia, 2017,
[6] M. Popa and C. Japa, “Embedded weather station with remote wireless control,” in
Telecommunications Forum (TELFOR) Proceedings of Papers, Belgrade, Serbia, 2011
[7]Z. K. Hussein, H. . J. Hadi, M. R. Abdul-Mutaleb and Y. S. Mezaal, “Low cost smart
weather station using Arduino and ZigBee,” TELKOMNIKA Telecommunication,
Computing, Electronics and Control, vol. 18, no. 1, pp. 282-288, 2020,7
Appendix — 1
#finelude
ifinclude
#Hinclude
include
include
include
SFE_BMPI80 pressure;
i#define DHTPIN $
##define DHTTYPE DHTI1
DHT dht(DHTPIN, DHTTYPE);
‘define TEMPTYPE 0
‘define ALTITUDE 216 // Altitude from Bussero (MI) Italy
‘define server = "api.thingspeak.com";
String apiKey
JUUC8HZPTIP2IAWG";
char buffer{ 10];
char t_buffer(10};
char h_buffer{10];,
char P_buffer[10];
SofiwareSerial ser(2, 3); // RX, TX
void setup() {
Wire.beging;
pressure.begin();
iJ enable debug serial
Serial-begin(9600);
ser.begin(9600);
ser printhn("AT+RST"18
}
void loop)
{
Trsmission(); // ESPR266
delay(60000); // 60 seconds
}
void Trsmission()
{
int8_th = dht.readHumidity();
int16_tt = dht.readTemperature(TEMPTYPE);
char status;
double T,P,p0,a;
status = pressure.startTemperature();
if (status = 0)
{
delay(status);
status ~ pressure. getTemperature(T);
if (status !=0)
{
status = pressure.startPressure(3);
if (status = 0)
{
1! Wait for the measurement to complete:
delay( status);
status = pressure getPressure(P,);
if (status = 0)
{19
pO ~ pressure.sealevel(P,ALTITUDE); // we're at 1655 meters (Boulder, CO)
a= pressure.altitude(P,p0);
}
else Serial printin("error retrieving pressure measurementin");
3
else Serial.printIn("error starting pressure measurementin");
J
else Serial printin("error retrieving temperature measurementin"
3
float temp =
float humidity = h;
float Pression ~ pO;
String strTemp = dtostrfitemp, 4, 1, t_buffer);
String strHumid = dtostrfthumidity, 4, 1, h_buffer);
String strPres = dtostrf(Pression, 4, 2, P_buffer);
Serial.print("Temperature: ");
Serial.printin(strTemp);
Serial print("Humidity: ");
Serial.printin(strHumid);
Serial.print("Pressure: ");
Serial printin(stePres);
String emd = "AT=CIPSTARTA\"TCP\"\\"";
emd += "184.106.153.149"; //api.thingspeak.com.
emd += "\",80";
ser.printhn(emd);
iffser.find("Error")){
Serial printin("AT+CIPSTART error");
return;I
iffser.find("Error")){
Serial printin("AT+CIPSTART error");
return;
$
i prepare GET string,
String getStr="GETT /update?api_key=";
getStr += apiKey;
gelStr +=" field!
getStr += String(strTemp);
getStr +=" &field2=";
getStr += String(strHumid);
getStr +=" &field
getStr += String(stPres);
getStr+="rinirin",
1) send data length
emd = "AT+CIPSEN!
emd += String(getStr.length();
ser.println(emd);
‘ser print(getStr);
iffser.find(">")){
ser.print(getStr);
}
else{
ser.println("AT+CIPCLOSE");
alert user
Serial_printin("AT+CIPCLOS!
ser.printin("AT+RST");
}
20char buffer[10]
}
21