You are on page 1of 76

University of Science and Technology

Faculty of Engineering

Department of Electronic System and Computer Engineering

A Dissertation submitted in partial fulfillment of the requirement for the B.Sc.


(Honors) Degree in Electronic systems and Computer Engineering

Design and Implementation of a Weather


Monitoring System Using Internet of Things
(IoT)

Prepared by:
Ayman Abdaljbar Abdalazeem Mohammed
Basil Mohammed Abbas Hilmi
Muaz Abdullah Hussain Osman

Supervised by:

T.Mohammed Yousef Abdaldaim Eisa

JAN 2022

i
ii
‫اآلية‬

‫قَال ت َ َعالَى‪:‬‬
‫ات ُه َّن أ ُ ُّم‬
‫ات ُّم ْح َك َم ٌ‬ ‫اب ِم ْنهُ آ َي ٌ‬ ‫علَي َْك ْال ِكت َ َ‬ ‫﴿ ُه َو الَّذِي أَنزَ َل َ‬
‫ات ۖ فَأ َ َّما الَّذِينَ فِي قُلُوبِ ِه ْم زَ ْي ٌغ فَيَتَّبِعُونَ‬ ‫ب َوأُخ َُر ُمتَشَابِ َه ٌ‬ ‫ْال ِكتَا ِ‬
‫َما تَشَا َبهَ ِم ْنهُ ا ْبتِغَا َء ْال ِفتْنَ ِة َوا ْبتِغَا َء تَأ ْ ِوي ِل ِه ۗ َو َما َي ْعلَ ُم تَأ ْ ِويلَهُ ِإ ََّّل‬
‫الرا ِس ُخونَ فِي ْال ِع ْل ِم يَقُولُونَ آ َمنَّا بِ ِه ُك ٌّل ِم ْن ِعن ِد َربِنَا ۗ‬ ‫َّللاُ ۗ َو َّ‬
‫َّ‬
‫ب (‪﴾ )7‬‬ ‫َو َما َي َّذ َّك ُر ِإ ََّّل أُولُو ْاْل َ ْل َبا ِ‬

‫صدق هللا العظيم‬


‫آل عمران‬

‫‪I‬‬
‫االهداء‬
‫بعد سنين من الجهد والتعب والمثابرة كانت مسيرة دراسية كان مسك ختامها اجمل‬
‫ما فيها فقد تكللت في نهايتها بأجمل اللحظات اال ان فراق االصدقاء اثر في جمالها‬
‫فقد اختلط الفرح بالحزن اال ان جانبها المفرح طغى على حزنها الشكر هللا اوال واخي ار‬
‫كما أقدم شكري وامتناني لمن كانو سبب في استمرار واستكمال مسيرة حياتي من‬
‫بأشد الظروف ومن حفزوني على المثابرة واالستمرار وعدم اليأس أقدم‬
‫وقفوا معي ّ‬
‫لكم أجم ل عبارات الشكر واالمتنان من قلب فاض باالحترام والتقدير و إلى من‬
‫وقف بجانبي من اخواني االعزاء‬

‫واهديه إلى والدتي الغالية رحمه هللا عليها‪.‬‬

‫‪II‬‬
‫الشكر والعرفان‬
‫َن ٱ ْش ُك ْر ِهّلِلِ ۚ ومن َي ْش ُك ْر َفِإهنما َي ْش ُك ُر لِ َنْف ِس ِه ۦ‬
‫تعالى‪(:‬وَلَق ْد ءاتَ ْي َنا ُلْق ََٰم َن ٱْل ِح ْك َم َة أ ِ‬ ‫قال‬
‫َ‬ ‫ََ‬ ‫َ َ‬
‫َو َمن َكَف َر َفِإ هن ٱ هّلِلَ َغِن ٌّى َح ِم ٌيد) وقال رسوله الكريم ‪(:‬اليشكر هللا من اليشكر الناس)‬
‫الشكر والحمد هلل جل في عاله فإليه ينسب الفضل كله في إكمال ‪-‬والكمال يبقى‬
‫هلل وحده‪ -‬في هذا العمل وبعد الحمد هلل فإني اتوجه باشكر لالستاذ الفاضل محمد‬
‫يوسف في دعمه وما قدمه من معلومات التي تمت في هذا العمل ثم أتقدم‬
‫علي والدي الحبيبين على كل جهودهم منذ لحظة‬
‫بالشكر لمن فضلهما ال ينقطع ه‬
‫والدتي إلى هذه اللحظات المباركة‪ ،‬أنتم يا أبي وأمي نجاحي وفرحتي وكل شيء‬
‫أخير أتقدم بجزيل الشكر إلى كل من م هد لي يد العون والمساعدة‬
‫جميل في حياتي و ًا‬
‫في إعداد هذا البحث على أكمل وجه‪ ،‬والحمد هلل رب العالمين‬

‫‪III‬‬
Table of Contents
Title PAGE NO
‫اآلية‬ i
‫االهداء‬ ii
‫الشكر والعرفان‬ iii
List of Content iv
List of Figures vi
List of Tables viii
List of Abbreviations ix
List of Symbols x
Abstract xi
‫المستخلص‬ xii
CHAPTER ONE
INTRODUCTION
1.1 General Background 1
1.2 Problem Statement 2
1.3 Objectives 2
1.4 Methodology 2
1.5 Project Layout 3
CHAPTER TWO
LITERATURE REVIEW

2.1 History of weather monitoring and early 4


instruments
2.2 Type of Weather monitoring stations 10
2.2.1 home weather station 11
2.2.1.1 Analog Home weather stations 11
2.2.1.2 Digital Home Weather Station 11
2.2.1.3 Wireless Indoor-Outdoor Weather Station 11
2.2.1.4 Smart Weather Station 12
2.2.2 professional Weather Stations 13
2.2.3 Specialty Weather Stations 14
2.2.3.1 portable or Handheld Weather Stations 14
2.2.3.2 Agriculture Weather Monitors 14
2.2.3.3 Remote Weather Stations 15
2.2.3.4 Marine Weather Stations 15

IV
2.2.3.5 Extreme Weather Station 16
2.2.4 Educational Weather Station 17
2.2.5 Professional Meteorologist Weather Equipment 18
2.3 Internet of things (IoT) 19
2.3.1 Definition 19
2.3.2 Importance of IoT 19
2.3.3 Technologies That Made (IoT) a possibility 19
2.3.4 IoT and The Accuracy of weather Forecasting 20
2.4 Related scientific papers 21
CHAPTER THREE
HARDWARE DESCRIPTION
3.1 introduction 22
3.2 Input Units 23
3.2.1 DHT11 23
3.2.2 Light Dependent Resistor 24
3.2.3 Raindrop Sensor 25
3.2.4 BMP180 Sensor 26
3.3 System Processor 26
3.3.1 ESP32 26
3.5 Output Units 27
CHAPTER FOUR
CIRCUIT DESIGN AND SOFTWARE
DESCRIPTION
4.1 Description 29
4.2 Circuit Design 29
4.3 Operation 30
4.4 Software Description 31
4.5 Flow Chart 33
4.6 Results 34
CHAPTER FIVE
CONCLUSION AND RECOMMENDATIONS
5.1 Conclusion 35
5.2 Recommendations 35
References 39

V
List of Figures
FIGURE TITELE PAGE
NO NO

Figure 2.1 Robinson’s Anemometer 4


Figure 2.2 Hygrometer 5
Figure 2.3 Thermoscope 5
Figure 2.4 The Mercury Barometer 6
Figure 2.5 Fahrenheit's Thermometer 7
Figure 2.6 Graham bell's telephone & Samuel Morse's 7
telegraph
Figure 2.7 Kite operation at an areological station 8
Figure 2.8 Weather balloon 8
Figure 2.9 Preparation of army air force 9
meteorologists to launch hydrogen filled
balloon transported radiosonde
Figure 2.10 WSR-57 radar console & tiros-1 weather 9
satellite
Figure 2.11 Digital indoor simple weather station 10
Figure 2.12 Wooden analog home weather station 11
Figure 2.13 Wireless indoor-outdoor weather station 12
Figure 2.14 Netatmo weather station indoor-outdoor 12
with wireless outdoor sensor – compatible
with Amazon Alexa & Apple homeKit
Figure 2.15 Davis vantage pro2 13
Figure 2.16 Hand held weather station 14
Figure 2.17 Agricultural weather monitor 15
Figure 2.18 Marine weather station 16
Figure 2.19 A storm chaser's truck with on-board 17
weather monitoring equipment
Figure 2.20 Educational weather station for kids 17

Figure 2.21 From left to right Dendrometers , 18


Radiosonde, Hazemeter
Figure 3.1 Block diagram of weather monitoring 22
Figure 3.2 DHT11 sensor with pinout 23

VI
Figure 3.3 Light Dependent Resistor 24
Figure 3.4 Raindrop sensor with pinout 25
Figure 3.5 BMP180 Sensor with pinout 26
Figure 3.6 NodeMCU Esp32s with pinout 27
Figure 3.7 16*2 I2C LCD 28
Figure 4.1 Circuit Design 30
Figure 4.2 Circuit Model 32
Figure 4.3 Circuit schematic 32
Figure 4.4 Flow chart 34

VII
List of Tables
Table No. TITLE PAGE

Table B.1 ESP32 Specifications 44

VIII
List of Abbreviations
A.I Artificial intelligence
ADC Analog to digital converter
BC Before Christianity
CO2 Carbon dioxide
DAC Digital to analog converter
GDP Gross domestic product
GND Ground
GPIO General purpose input/output
IoT Internet of things
I2C Inter integrated circuit
IDE Integrated development
environment
LCD Liquid crystal display
LDR Light dependent resistor
NLP Natural language processing
PWM Pulse width modulation
RF Radio frequency
SCL Serial clock
SDA Serial data
VIN Input voltage
VCC Voltage common collector
Wi-Fi Wireless fidelity

IX
List of Symbols
MPH Miles per hour
°F Fahrenheit
°C Centigrade
Pm Picometer
MHz Mega hertz
GHz Giga hertz
DMIPS Dhrystone Million Instructions per Second
V Volt
Nm Nanometer
mA Milli ampere
Us Micro second

X
Abstract
Weather forecasting stations used to forecast weather conditions are usually
expensive, large and require professional personnel to operate properly. The main
objective of the project is to design and implement an affordable, portable and
easy-to-use weather monitor that can be used in a variety of applications ranging
from agricultural to industrial, to track weather elements such as temperature,
humidity...etc., using several sensors that are connected to a controller Minutes
from the microcontroller. And to display the data on the embedded display and
upload said data to the IOT platform so that it can be viewed on a range of
internet-connected devices, thus eliminating the need to be physically near the
weather monitor hardware.

XI
‫المستخلص‬
‫عادة ما تكون محطات التنبؤ بالطقس المستخدمة للتنبؤ بالظروف الجوية باهظة‬
‫الثمن وكبيرة الحجم وتتطلب موظفين محترفين لتشغيلها‪.‬‬
‫الهدف الرئيسي من المشروع هو تصميم وتنفيذ جهاز مراقبة الطقس ميسور التكلفة‬
‫ومحمول وسهل االستخدام ويمكن استخدامه في مجموعة متنوعة من التطبيقات‬
‫من الزراعية إلى الصناعية لتتبع عناصر الطقس مثل درجة الح اررة والرطوبة ‪...‬‬
‫إلخ ‪ ،‬باستخدام العديد من المستشعرات التي يتم توصيلها بوحدة التحكم ‪.‬‬
‫ولعرض البيانات على شاشة العرض المضمنة وتحميل البيانات المذكورة إلى منصة‬
‫االنترنت بحيث يمكن عرضها على مجموعة من األجهزة المتصلة باإلنترنت ‪،‬‬

‫وبالتالي يلغي الحاجة إلى أن تكون ً‬


‫فعليا بالقرب من أجهزة مراقبة الطقس‪.‬‬

‫‪XII‬‬
Chapter one
Introduction

0
1.1 General Background
Weather and climate are among the foremost factors which determine how a
society develops in a geographical region. Weather describes a event for a short
period of time such as an hour or a day, and it includes current atmospheric
conditions such as the temperature, precipitation, humidity and the speed and
direction of the wind. On the other hand, climate refers to the behavior of the
atmosphere on a place over the span of many years. We are always with or around
a weather forecast, on average we might encounter four or five weather forecasts
per day in the shape of: news bulletin, newspapers, social media sites, and on tv
[1,2].
Weather influences people’s lives, property, and activities, it also plays a massive
role in the world economy, especially in Africa. The reason for the circumstance
is that most African countries rely on agriculture as their main source of income.
As an example, agriculture represents between 30% to 40% of Sudan’s GDP and
employs about 80% of the work force [3]. Diverse extreme weather (including
droughts and heatwaves) can affect farms in different ways, too much water can
cause damage to a farm. Floods can postpone the planting of crops along with
oxygen depletion after they are planted. Flooding enhances the possibility of
disease and triggers nitrogen loss in crops; Also, in the construction field the
warping in lumber products and the speed at which some components dry depend
on the humidity levels in the air, transportation on land, sea and air rely on the
weather conditions to determine if traveling is safe or not. This actively
demonstrates that monitoring and forecasting weather is crucial. Weather data is
important and has a direct impact on our daily lives [4, 5].
The data collected such as rainfall and temperature can be used to serve as a
precautionary measure against natural disasters. A weather monitoring system is
used to collect data such as temperature, humidity, precipitation, and wind speed.
It also can update data more frequently, as it can be programmed to update its
data readings on a minute or hourly bases. We interfaced a variety of sensors
ranging from a temperature sensor to a light sensitive sensor with a
microcontroller to view the real time weather conditions on a display screen and,
be able to connect to the internet and send the current weather conditions
wirelessly to an IOT platform and be able to view them without the need to be
physically present in the same place as the weather monitor hardware.

1
1.2 Problem Statement
Professional weather stations are extremely expensive, lack portability and ease
of use for the everyday consumer. Also, most weather data found on the
internet are an approximation, and some applications might require accurate
readings which, in turn render the data found on the internet useless for that
specific application.
1.3 Objectives
The objective of the project is to design and implement an Arduino
based weather monitoring system that can:
• Collect data from the multiple sensors that are interfaced with the
Arduino microcontroller.
• View the data processed by the microcontroller on the liquid crystal
display.
• Have the data collected be shared to an IOT platform so that it can be
viewed from a phone or a pc that is able to connect to the internet.

1.4 Methodology
Determine the project objectives and figure out a mechanism to achieve them,
study previous researches related to weather monitoring to help with the
writing of the literature review, build a software simulation of the project to
check that it is functional and then build a hardware prototype using a variety
of sensors and an ESP32 based microcontroller that can connect to the internet
to upload its collected data to be able to view this data on a device that can
connect to the internet such as a mobile phone or a personal computer.

2
1.5 Project Layout
The project is divided into five chapters
• Chapter One includes general background, problem statement, objectives,
and methodology.
• Chapter Two includes the literature review.
• Chapter Three includes the hardware description.
• Chapter Four includes circuit design and software description.
• Chapter Five includes conclusion and recommendations.

3
Chapter Two
Literature Review
2.1 History of weather monitoring and early instruments
Weather monitoring and forecasting date all the way back to 3000 BC when our
ancestors used what they learned from the observation of weather patterns in the
areas that surrounded them to survive. This shows how integral weather
monitoring was and still is to humanity throughout the ages [8].
Around 340 BC a Greek philosopher named Aristotle wrote “Metrologica”, a text
that was focused on describing the interactions between the four elements as he
named them "...Four bodies are fire, air, water, earth." (339a15-16), it also
included theories on the formation of clouds, rain, thunder, and hurricanes
although they contained a lot of errors such as thinking wind wasn’t air in motion
[6].
As time went on the need for tools that measure weather elements became more
and more apparent, an Italian architect named Leon Battista Alberti invented the
first anemometer in 1450, a device capable of measuring wind speed [6]. The
hemispherical cup anemometer was invented in the year 1846 by Dr. John
Thomas Romney Robinson and is one of the few weather instruments that got
little change since its inception [13].

Figure (2.1): Robinsons Anemometer.

4
The famed Italian inventor Leonardo da Vinci invented the hygrometer in 1480,
a device capable of measuring water vapor (humidity) in the air, the imbalance
induced by moisture absorption by cotton, which, when dry, is equal to the weight
on the other side of the scale, can be used to estimate the humidity of the
atmosphere [6].

Figure (2.2): Hygrometer


In 1596 Galileo who was also an Italian physicist, invented the thermoscope
which was a tube filled with liquid that rises and falls depending on its
surrounding temperature [6].

Figure (2.3): Thermoscope

5
The barometer, a device capable of measuring air pressure was invented in 1642
by another Italian named Evangelista Torricelli who was a physicist , he
achieved this by filling a glass tube with mercury, inverting it, and drowning
the open end in a mercury container. This was the first barometer (with a height
of 760mm of Mercury, 760 mmHg) and is still in use for absolute pressure
readings today [6].

Figure (2.4): The Mercury Barometer


In 1714, a Dutch inventor named Daniel G. Fahrenheit invented the first
reliable thermometer that used mercury instead of other not-so reliable liquids
used by prior inventors. This type of thermometer measured changes in the
volume of mercury in a glass tube due to temperature changes [6].

Figure (2.5): Fahrenheit’s Thermometer

6
A multitude of scientific achievements and breakthroughs by scientists in both
chemistry and physics during the 17th and 18th centuries had a major positive
impact on meteorological research and made it possible to better understand the
unknow aspects of the atmosphere including formulation of gas pressure,
temperature and density laws by Robert Boyle and Jacques-Alexandre-César
Charles, development of calculus by Isaac newton and Gottfried Wilhelm
Leibniz [7]. Those are just a few of the breakthroughs that helped push
metrological research forward at the time [7].
Weather observations from distant places could not be gathered in one place
soon after they were made, this caused weather observations to be mostly
restricted to the area where the weather station is in, that is until the invention
of the Telegraph and Telephone in the early 1800s that eased some of the hassle
of getting the data fast in one place which in turn improved the forecast
accuracy [7].

Figure (2.6): Graham Bell’s telephone & Samuel Morse's


telegraph
The first independent weather station was a kite that was used in 1847 and had
self-recording instruments on it to observe the weather from a somewhat high
altitude in England [8].

7
Figure (2.7): Kite operations at an areological station
The use of weather balloons emerged in 1896 when Leon tesseract released
thousands of weather balloons to the sky of France, his work helped build the
foundation of our understanding of the atmosphere today by determining the
existence of the tropopause and the stratosphere [8].

Figure (2.8): Weather balloon.


Ship to shore weather reporting appeared in 1905 when ships gained access to
weather reports from land-based weather stations through radio communication
and were also able to send data recorded on the sea [8].
In the 1920s the radiosonde invention yielded in the advancement of weather
monitoring in high altitudes, it is a small lightweight box that contains a radio
transmitter along with a multitude of instruments, they are carried to an altitude
of 30 kilometers using helium or hydrogen filled balloons. The on-board radio
transmitter transmits the instruments readings such as temperature, pressure,
and moisture (called soundings) back to the ground station's receiver [6].

8
Figure (2.9): Preparation of army air force meteorologists to
launch hydrogen filled balloon transported radiosonde
The period between 1940 and 1960 witnessed the use of the radar to generate
storm predictions, and the launch of the first weather satellite named TIROS-1
that recorded thousands of weather images and sent them back to NASA [8].

Figure (2.10): WSR-57 radar console & Tiros-1 weather satellite.


The use of computers started in the 1980s to help with weather observations,
their role only grew larger as time went on [8]. The miniaturization of electronic
components and more software and hardware solutions becoming available led
to the increased accuracy and sophistication of weather monitoring systems and
technologies [8].
Since the year 2000 and onward automated weather station systems are being
developed, enabling for the automated reporting of weather observations every
minute [8].

9
2.2 Types of weather monitoring stations
A weather station is a set of devices that observe atmospheric conditions to aid
in the study of a given location's weather and climate [14].
There are many different types of weather stations but generally they can be
categorized into five categories:
1. Home weather stations. (Personal weather stations).
2. Professional weather stations.
3. Specialty weather stations.
4. Educational weather stations.
5. Professional meteorologist weather equipment.
2.2.1 Home weather stations
When most people hear the word "weather station," they immediately think
of this category. It's also the most diverse sector, with a million firms selling
everything from a basic temperature/humidity sensor to multi-thousand-
dollar weather stations [15].
The basic stand-alone temperature and humidity sensor is at the low end of the
pricing spectrum. The analog form, which resembles a circular clock face with
hands pointing to temperature and humidity readings. These have been
designed to be simple to read. The most common form is a digital indoor
weather station, which may be placed on a counter or mounted on the wall in
any room [15].

Figure (2.11): Digital indoor simple weather station.

10
2.2.1.1 Analog Home Weather Stations
A wooden weather station with dials installed on a wall is a common example
of this type. Some of them are small enough to be stored on a desk. Many
models are designed to resemble old weather stations while yet including
modern technologies. Analog weather stations are not only useful, but they can
also be attractive. Almost all of them are made with the intention of being
decorative [15].

Figure (2.12): Wooden analog home weather station

2.2.1.2 Digital Home Weather Stations


These thermo-hygrometers have electronics that can display not just temperature
and humidity, but also the time and date. A barometer is incorporated into a few
of them, allowing them to perform rudimentary forecasting [15].
2.2.1.3 Wireless Indoor-Outdoor Weather Station
You can acquire the outdoor temperature and humidity shown with your indoor
readings by placing the additional thermo hygrometer outside in the shade. These
indoor-outdoor weather stations are also available in cabled or wired variants,
although their installation process is more complex than the wireless ones. This
type uses a variety of sensors, for this reason it can give the user a full weather
report [15].

11
Figure (2.13): Wireless indoor-outdoor weather station.

2.2.1.4 Smart Weather Stations


Some smart weather stations can interpret your voice instructions and respond
with the information you've requested. For example, Alexa is being used by a
couple of new home weather stations. These new home weather stations are
also measuring other components of the indoor environment, which is an
interesting direction to go. You can, for example, measure noise levels, CO2,
airborne dust, and so on [15].

Figure (2.14): Netatmo Weather Station Indoor Outdoor with Wireless


Outdoor Sensor - Compatible with Amazon Alexa & Apple HomeKit.

12
2.2.2 Professional Weather Stations
This popular weather station is designed for dependability, longevity, and
accuracy. Professional weather stations must fulfill international
meteorological standards as well as the National Institute of Standards and
Technology's accuracy criteria [15].
Professional weather stations range from the best home weather stations to
multi-station networks of specialized weather equipment and, in certain cases,
the use of repeaters to broadcast weather information over large distances [15].
This sort of weather station collects the same data as the top home weather
stations, but it will also contain any special requirements specified by the end
user. Temperature, humidity, light, dust, and moisture, for example, are all
factors to consider. Farmers will want to know how well their irrigation system
is working and how quickly the water evaporates. For safety reasons, airport
management and pilots need to be aware of the conditions [15].
This type is usually used by weather enthusiasts, Airports, Farmers, Fire
departments, or anyone that needs real-time accurate weather data.

Figure (2.15): Davis vantage pro2.

13
2.2.3 Specialty weather stations
These are weather stations that are specifically designed for a certain use case.
2.2.3.1 Portable or Handheld Weather Stations
Portable weather stations range from handheld ones that just report wind speed
and temperature to suitcase models that include everything you'd find in a
professional weather station as well as any specific sensors you might require,
such as nuclear radiation detectors [15].
Usually used by hunters, hikers, campers, and sailors.

Figure (2.16): Handheld weather station.

2.2.3.2 Agricultural Weather Monitors


Professional weather stations with extra sensors and networking are known as
agricultural weather stations.
Farmers care about soil temperature, moisture, and exposure to the sun, as well
as assessments of leaf wetness and water temperature. Farmers also want a
weather station that can send out alerts in the event of frost or flooding [15].
Remote sensors can provide data to the main weather station, which can then
transfer the weather information to an office display and computer [15].

14
Figure (2.17): Agricultural weather monitor.

2.2.3.3 Remote Weather Stations


Remote weather stations are those that are put in locations that are too far away
or too difficult to access in a short period of time. This category includes a lot
of farms and ranches [15].
Solar power and cell service are typically used to power these faraway stations.
Official weather agencies and transportation departments frequently monitor
mountaintops and mountain routes in this manner [15].
2.2.3.4 Marine Weather Stations
Corrosion is a concern for everything near salt water. Corrosion-resistant and
well-sealed marine weather stations are needed. This is true for both on-the-
water and shore-based stations. Stay at least 1/4 mile away from the shore,
according to several weather station makers [15].
The cost of marine-grade weather stations is usually rather high.

15
Figure (2.18): Marine weather stations.

2.2.3.5 Extreme Weather Stations


The top-of-the-line professional weather stations would most likely suffice in
extreme weather circumstances such as hurricanes or storm chaser situations.
Of course, this is only true if the weather equipment is properly placed. Extreme
rains, extremely cold temperatures, and extremely strong 200mph+ winds all
pose problems when measuring them [15].
In strong winds, a pitot tube is utilized, which is like what is used on airplanes
to measure wind speed.
An alcohol thermometer is used to measure very cold temperatures, such as
those found in Antarctica. Mercury thermometers aren't accurate below -35°F,
while an alcohol thermometer can read -94°F.
When it comes to rain, a big collecting gauge can be used to measure
accumulation, but a weighing bucket or, better yet, a natural siphon or float
kind of rain gauge can be utilized to measure high rates of fall [15].

16
Figure (2.19): A storm chaser’s truck with on-board weather
monitoring equipment.

2.2.4 Educational Weather stations


Weather stations for kids range from simple functioning stations suitable for
preschoolers to complex weather stations that are informative for older
children. These weather stations for kids come with paperwork and worksheets
that are appropriate for various ages [15].

Figure (2.20): Educational weather station for kids.

17
2.2.5 Professional Meteorologist Weather Equipment
Meteorologists employ specialized equipment in addition to top-of-the-line
professional weather stations, such as:
Weather balloons or airplanes drop radiosondes, which are self-contained small
weather stations. The data from radiosondes is sent to ground-based receivers.
Clearness or visual range through the air is measured using transmissometers
or haze meters.
Dendrometers are instruments that can measure the size, speed, and dispersion
of falling precipitation particles, such as raindrops, snowflakes, hail, and
graupel.
At a distance, radar and Lidar are employed to monitor atmospheric conditions.
Data from official weather stations, home weather stations, satellites, ocean
buoys and ships, and airplanes are also available to meteorologists. Real-time
maps and pictures are now attainable because to the computerization of this
data [15].

Figure (2.21): From left to right (Dendrometers, Radiosonde,


Haze meter)

18
2.3 Internet of Things (IoT)
2.3.1 Definition
The Internet of Things (IOT) is a network of physical items (or "things") that
are integrated with sensors, software, and other technologies to connect and
exchange data with other devices and systems through the internet. These
devices range in complexity from common household items to sophisticated
industrial equipment [16].
2.3.2 Importance of IoT
IoT has emerged as one of the most important technologies of the twenty-first
century in recent years. Now that we can link common objects to the internet
via embedded devices, such as kitchen appliances, automobiles, thermostats,
and baby monitors, seamless communication between people, processes, and
things is achievable [16].
Physical things can exchange and gather data with minimum human interaction
thanks to low-cost computers, the cloud, big data, analytics, and mobile
technologies. Digital systems can record, monitor, and adapt each interaction
between linked items in today's highly connected environment. The physical
and digital worlds collide, yet they work together [16].
2.3.3 Technologies that made (IoT) a possibility
1. access to cheap, power efficient sensor technology [16].
2.Connectivity: the internet has an array of protocols that made connecting
sensors to cloud services easy [16].
3.Cloud computing platforms: Cloud platforms are becoming more widely
available, allowing organizations and individuals to have access to the
infrastructure they need to grow without having to handle it all themselves [16].
4.Machine learning and analytics: Businesses can obtain insights faster and
more efficiently thanks to improvements in machine learning and analytics, as
well as access to diverse and huge volumes of data stored on the cloud. The
growth of these associated technologies continues to push the frontiers of IoT,
and IoT data feeds these technologies as well [16].
5.Conversational artificial intelligence (AI): Natural-language processing
(NLP) has been brought to IoT devices (such as digital personal assistants
Alexa, Cortana, and Siri) thanks to advances in neural networks, making them
more attractive, cheap, and practical for home usage [16].

19
2.3.4 IoT and The Accuracy of Weather Forecasting
Since the first person pondered if it will rain the next day, weather predicting
has been a practice. The approaches have become increasingly advanced over
time. The positioning of weather satellites aided in providing a sharper view of
developing weather patterns. Companies, on the other hand, now have access
to much more data [17].
Businesses can no longer plan for only snow; they can predict how much will
fall, which towns will be hardest hit, and where the most ice will accumulate
on the road. Weather forecasting has never been more precise thanks to the
Internet of Things [17].
According to Computerworld, the early weather sensors used by meteorologists
were largely located on airports or ships. These facilities had the greatest need
for fast, reliable meteorological data, and they were also large enough to keep
the equipment without interfering with regular operations [17].
These sensors, which monitor variables like light, motion, temperature,
pressure, and moisture, are now more widely available thanks to IoT-enabled
technologies. To give precise road conditions, weather forecasters may now
strap this equipment into automobiles. At least a couple of these sensors can be
found in most cellphones. IoT technology allows forecasters to view a more
comprehensive picture with much more data points than simply airports and
cargo boats, thanks to smartphone sensors. More data experimentation is also
possible due to the abundance of sensors. Meteorologists may identify where
the equipment delivers the most accurate data on the vehicle and adjust their
input to prioritize that information [17].

20
2.4 Related scientific papers
This project is focused on building a portable wireless weather monitor based
on different literature that tackles the design and implementation of a weather
monitor.
The journal “A Low-Cost Microcontroller-based Weather Monitoring
System” discusses the design and implementation of a weather monitoring
device that monitors and displays values of temperature, pressure and relative
humidity using analogue and digital components, the analogue outputs of the
sensors are connected to the analogue-to-digital converter of the
microcontroller for signal conversion and the readings are displayed on a lcd
screen [9].
The paper “Wireless Portable Microcontroller based Weather Monitoring
Station” discussed the design and implementation of an inexpensive wireless
weather monitoring station using PIC16F887 microcontroller and sensors that
measure relative humidity, atmospheric pressure, rainfall, solar radiation, wind
speed, and ambient temperature it also includes the MODBUS communication
protocol that provides seamless real time measurements to its base station i.e.
(pc or laptop) over wired and wireless interfaces [10].
The literature of “Wireless Weather Monitoring System using Arduino
DUE and GSM Technology” discusses the use of an Arduino due
microcontroller that is connected to a variety of sensors that measure
temperature, humidity, wind, and light intensity via the analog-to-digital
converter [11]. it allows remote control of the system through the GSM module
in the system [11]. The user calls the weather station, this call is signaling the
weather monitor to send an SMS message to the caller's number containing the
sensor readings [11].
In the paper “IoT Based Weather Monitoring System for Effective
Analytics” the author discusses the development of a weather monitoring
system that is based on a Raspberry-Pi microcontroller that is interfaced with a
variety of sensors that measure: temperature, humidity, pm 2.5 and pm 10
concentrations, and the air quality index. The Raspberry-Pi microcontroller
works as a server to request weather data from and have access to this data over
the internet [12].

21
Chapter Three
Hardware Description
3.1 Introduction:
The system is built around espressif system’s esp32s microcontroller that has
built-in support for both Wi-Fi and Bluetooth technologies among other features,
interfaced with an LCD screen, DHT11 humidity and temperature sensor, a Light
Dependent Resistor and the BMP180 pressure sensor. The ESP32s stores and
executes the code necessary to control the entirety of the system. The DHT11,
LDR, and BMP180 sensors send the collected data to the microcontroller which
then sends the readings to the LCD screen and to blynk IoT platform
simultaneously for viewing.

DHT11
sensor LCD
screen
LDR
Sensor ESP32s
microcontroller

BMP180
sensor Blynk IoT
platform

Raindrop
sensor

Figure (3.1): Block diagram of weather monitoring

22
3.2 Input units
3.2.1 DHT11
The DHT11 humidity and temperature sensor is used in this project to monitor
both parameters. It is a reliable, inexpensive, and low power consuming device.
It acquires digital signal values making it highly reliable and giving it long term
stability. The sensor has 3 pins and makes use of resistive type humidity
component with an 8-bit microcontroller that outputs humidity and temperature
data serially.
It can measure humidity in the range of 20-80% with ±5% accuracy and
temperature values ranging from 0°C to 50°C with ±2°C degrees accuracy.

Figure (3.2): DHT11 sensor with pinout

23
3.2.2 Light Dependent Resistor:
The light dependent resistor has a variable resistance that changes with the level
of light it receives. The resistance value decreases when light falls on the LDR's
surface and increases when it's dark. They operate based on the principle of photo
conductivity where the conductivity increases with the fall of light on the material
and decreases in the absence of light.

Figure (3.3): LDR

24
3.2.3 Raindrop Sensor
Raindrop Sensor is used for detecting 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.

Figure (3.4): Raindrop sensor with pinout

25
3.2.4 BMP180 sensor
BMP180 is one of the BMP XXX series of sensors. They are all designed to
measure Barometric Pressure or Atmospheric pressure. BMP180 is a high
precision sensor that in addition to barometric pressure can also sense altitude and
temperature and is designed for consumer applications.

Figure (3.5):BMP180 sensor with pinout

3.3 System processor


System processor is an implant element in the system because it is analysis
processes and the events that come from the input devices and control the
output devices.
The microcontroller used in this project is the NodeMCU-Esp32s with Xtensa
dual-core 32-bit LX6 microprocessor, operating at 160 or 240 MHz and
performing at up to 600 DMIPS.
3.3.1 ESP32

The ESP32 is a series of microcontroller chips produced by Espressif Systems in


Shanghai. It is available in a few low-cost modules.

ESP32 is a single 2.4 GHz Wi-Fi-and-Bluetooth combo chip designed with the
TSMC ultra-low-power 40 nm technology. It is designed to achieve the best
power and RF performance, showing robustness, versatility and reliability in a
wide variety of applications and power scenarios.

The ESP32 is an updated version of the ESP8266, which was a chip that took
experimenters in the western world by “surprise” in 2014. The original ESP8266

26
was introduced on a module called the ESP-01, which had very little English
documentation, so its capabilities were largely unknown at the time. Once the
documentation was translated into English many experimenters soon became
aware of the power of the ESP8266, and it quickly became very popular.
The ESP32 improved upon the ESP8266 design in several ways. It offers both
Bluetooth and BLE (Bluetooth Low Energy), whereas the ESP8266 only has Wi-
Fi (which, of course, the ESP32 also has). It is faster and is available in a dual-
core design. It is also capable of operating in an ultra-low-power mode, ideal for
battery-powered applications.

Figure (3.6): NodeMCU Esp32s with pinout

27
3.5 Output unit

3.5.1 16x2 I2C Liquid Crystal Display


An LCD screen is a flat panel electronic screen display device that works based
on the principle of light modulation properties. It operates by applying varying
electrical voltage to a layer of liquid crystals causing changes in its light
properties. It contains a matrix of pixels that display the graphical characters and
numbers on the screen.

An I2C communication interface is used by the 16x2 Arduino LCD Screen. It


can show 16x2 characters on two lines, with white characters on a blue
background. This display eliminates the disadvantage of the LCD 1602 Parallel
LCD Display in that it requires roughly 8 pins on your microcontroller to get it
to function.

Figure (3.7): LCD

28
Chapter Four
Circuit Design and Software Description
4.1 Description
The design is divided into two parts, hardware and software. The hardware
part is involved with the construction of the circuit, prototypes and the final
design. Meanwhile, the software part is involved with the code to interface the
various hardware components in addition to the IoT part and circuit simulation.
The weather monitoring system is controlled by Esp32s microcontroller that
regularly examines the four sensors DHT11, LDR, BMP180 and raindrop in
addition to the LCD screen. The system will be able to detect current weather
condition and display them remotely on the blynk mobile app and locally on the
LCD screen, this is done through using the data collected by the sensors and
processed by the microcontroller.
4.2 Circuit Design
Figure 4.1 shows the electronic circuit of the weather monitoring system the
microcontroller unit has operating voltage of 3.0v-3.6v, typically 3.3v and draws
an average current of 500mA. All pins support PWM (pulse width modulation)
and i2c protocol (inter integrated circuit)
with pin current of 6mA and up to 12mA. DHt11 sensor connected to 3.3v on
esp32, the ground pin of dht11 is connected to ground of esp32 and the data pin
of dht11 is connected to (GPIO32) pin of esp32.
The rain drop sensor is powered by the Vin (5v) with its ground connected to the
esp32's ground and the data pin of the rain drop sensor is connected to (GPIO33)
pin of esp32.
One leg of the 1k ohm resistor is connected to the ground of esp32 and the other
leg is connected to (GPIO34) and one leg of LDR in single point, the other leg of
LDR is connected to Vin(5v) pin of esp32.
The BMP180 is connected to ground and 3.3v pins of esp32, the i2c SCL and
SDA pins of BMP180 are connected to (GPIO22) and (GPIO21) respectively.
The LCD screen’s ground and power pins are connected to ground and Vin(5v)
of esp32 respectively, SCL and SDA pins of LCD are connected to the same SCL
and SDA pins of esp32 in the same point with BMP180 sensor since they both
use i2c protocol to communicate with esp32.

29
Figure (4.1): Circuit design

4.3 Operation
For communication, the DHT11 needs only one wire. The logic one or logic zero
on this pin is defined by voltage levels with a specific time value. The esp32 first
sends a read request to dh11 which is done by sending a pulldown 18ms start
pulse then the dh11 responds by sending a 54us low and 80us high pulse to
communicate to esp32 that it received the start pulse and then starts sending
temperature and humidity data along with a checksum to esp32 in a data frame
that is 40bits long divided into 5 segments with 8bits each, both temperature and
humidity data use 4 segments (2 segments each) and the final fifth segment is
used for the checksum of the prior four segments which is just the sum of both
temperature and humidity segments, if their addition is not equal to the checksum
that means that there is an error in the data received. After receiving data dht11
goes into low power mode to conserve power until it receives another start pulse
[18].
The Ldr circuit as mentioned in the circuit design above is basically a voltage
divider circuit, voltage divider circuits have 2 resistors (in our case it’s the Ldr
and a fixed value resistor) with this in mind we can measure the analogue voltage

30
across the Ldr through the use of the 12-bit Analog-to-Digital converter (ADC)
built in (GPIO34) of esp32 and convert it into a digital value ranging from 0 to
4095 which can then be used to program different situations with different light
intensities [19].
The rain drop sensor working is simple, the sensing pad has a series of exposed
copper lines or traces that act together as a varying resistor whose resistance
changes in relation to the amount of water on the surface of the sensing pad. The
resistance is inversely proportional to the amount of water, more water on the
sensing pad equals to a lower resistance and vice versa. The sensor produces a
voltage according to the resistance which is measured by the 12-bit (ADC) found
on (GPIO33) and maps it into a value between 0 and 4095 which can then be used
to program different weather conditions such as the presence of rain and the
intensity of the rain itself [20].
A piezo-resistive sensor, an Analog to digital converter, plus a control unit with
E2PROM and a serial I2C interface make up the BMP180. The uncompensated
pressure and temperature values are delivered by the BMP180. To begin a
pressure or temperature measurement, the microcontroller transmits a start
sequence. The result value (pressure or temperature, respectively) can be
accessed via the I2C interface after converting time [21].
After that the esp32s sends the data to the lcd screen via i2c serial communication
bus to view them locally as well as send the data to the blynk mobile app via Wi-
Fi for remote viewing.

Figure (4.2) : Circuit model

31
Figure (4.3): Circuit schematic
4.4 Software Description
The software used to write the code is Arduino integrated development
environment (IDE). The Arduino Integrated Development Environment is a
cross-platform application (for Windows, macOS, Linux) that is written in
functions from C and C++. It is used to write and upload programs to Arduino
compatible boards, but also, with the help of third-party cores, other vendor
development boards.

It contains a text editor for writing code, a text console, a message area, a toolbar
with buttons for common function, and a series of menus. It connects to the
ARDUINO hardware to upload programs and communicate with them.

Sketches are programs created with the Arduino Software (IDE). These sketches
were created with a text editor and saved with the .ino file extension.

32
Cutting/pasting, as well as searching/replacing text, are all available in the editor.
The message section indicates faults and provides feedback while storing and
exporting. The Arduino Software (IDE) outputs text to the console, which
includes detailed error messages and other information. The configured board and
serial port are displayed in the window's bottom righthand corner. You may
validate and upload programs, generate, open, and save sketches, and open the
serial monitor using the toolbar buttons.

It also supports libraries and cores for other non-Arduino boards such as esp32
and many others.

What makes it great is that it is open source which means its community driven
and that simplifies the user experience even more [22].

33
4.5 Flow Chart

Start

Data Acquisition

Sensors

Rain drop sensor

DHT11 sensor

Bmp180 sensor
Sensor Data

LDR sensor

Esp32s

Sending sensor
data To Blynk

Sending sensor
data to LCD

Figure (4.4): Flow chart

34
4.6 Results
After multiple tests the total response time of the system from the moment
weather parameters changed until those changes appeared on the blynk app was
found to be around 16.6s with an average of 16.5s.
Accuracy of the system was estimated to be 96% with Error percentage of 8%.

Note
(tests were conducted with an internet speed of 320Kbps & room temperature of
25°C).

35
Chapter Five
Conclusion and Recommendations
5.1 Conclusion
In this project we presented the design and implementation of a system that
measures and monitors current weather changes through sensors that are
interfaced with a microcontroller and displays them locally on an LCD screen and
remotely on the blynk mobile app.
5.2 Recommendations
After a deep intensive research, we recommend the following to be implemented
in future iterations:
• Swap the mobile application with a webserver or a more robust solution
that can be applicable to a wide array of devices.
• Addition of a wind anemometer to measure wind speed and direction.
• Datalogging/Database to collect measured data and then use the collected
data to forecast weather through A.I.
• Solar power.
• Gas sensor to measure CO2 levels in the air and detect wildfires.
REFRENCES
[1] https://www.nasa.gov/mission_pages/noaa-n/climate/climate_weather.html
“what’s the difference between weather and climate?”
[Accessed 29/5/2021]

[2] P.Susmitha, G.Sowmyabala, “Design and Implementation of Weather


Monitoring and Controlling System”, KLU, July 2014.

[3] https://www.ifad.org/en/web/operations/w/country/sudan
“Sudan - International Fund for Agricultural Development”
[Accessed 30/5/2021]

[4] IPCC 2007, Summary for Policymakers, in Climate Change 2007: Impacts,
Adaptation and Vulnerability. Contribution of Working Group II to the Fourth
Assessment Report of the Intergovernmental Panel on Climate Change,
Cambridge University Press, Cambridge, UK, p. 17.

[5] https://www.polygongroup.com/en-US/blog/how-ambient-humidity-affects-
your-construction-site/
“How Ambient Humidity Affects Your Construction Site”
[Accessed on 30/5/2021]

[6] https://earthobservatory.nasa.gov/features/WxForecasting/wx2.php “Weather


forecasting through the ages”
[Accessed 18/6/2021].

[7] https://www.britannica.com/science/weather-forecasting/History-of-weather-
forecasting “History of weather forecasting”
[Accessed 12/9/2021].

[8] https://www.sciencelearn.org.nz/interactive_timeline/9-measuring-the-
weather-a-timeline “Measuring the weather a timeline”
[Accessed 14/9/2021].

[9] K. Noordin, C. onn, M. Ismail, “A Low-Cost Microcontroller-based Weather


Monitoring System”, UOM, 2006.

37
[10] J.T. Devaraju, K.R. Suhas, H.K. Mohana, Vijaykumar A. Patil,
“Wireless Portable Microcontroller based Weather Monitoring Station”, BUOFC,
August 2015.

[11] H. Mohammed, S. Dave, “Wireless Weather Monitoring System using


Arduino DUE and GSM Technology”, The IRJET, vol. 5, pp 746-748, April
2018.

[12] F.Joseph, “IoT Based Weather Monitoring System for


Effective Analytics”, IJEAT, ISSN: 2249 – 8958, Volume-8 Issue-4, April 2019.

[13] https://www.armagh.space/notable_figure/thomas-romney-robinson
“Thomas Romney Robinson”
[Accessed 20/9/2021].

[14] https://www.weatherstationadvisor.com/what-is-a-weather-station/
“What Is a Weather Station?”
[Accessed 21/9/2021].

[15] https://www.weatherstationdepot.com/different-types-weather-
stations/#advgb-toc-94c667b3-c7fe-4ba8-bb69-7d6d2b1ba917
“The Different Types of Weather Stations”
[Accessed 21/9/2021].

[16] https://www.oracle.com/in/internet-of-things/what-is-iot/
“What is IoT”
[Accessed 21/9/2021].

[17] https://www.perle.com/articles/how-iot-infrastructure-allows-for-more-
accurate-weather-forecasting-40169629.shtml

38
“How IoT infrastructure allows for more accurate weather forecasting”
[Accessed 21/9/2021].

[18] https://www.electronicwings.com/sensors-
modules/dht11#:~:text=Communication%20with%20Microcontroller,only%20o
ne%20wire%20for%20communication.&text=The%20communication%20proc
ess%20is%20divided,40%20bits%20to%20the%20microcontroller.
“DHT11”
[Accessed 8/12/2021].

[19] https://microcontrollerslab.com/light-dependent-resistor-pic/
“Light dependent resistor interfacing with pic microcontroller”
[Accessed 8/12/2021].

[20] https://lastminuteengineers.com/rain-sensor-arduino-tutorial/
“How rain sensor works”
[Accessed 8/12/2021].

[21] https://how2electronics.com/bmp180-altitude-pressure-temperature-
measurement/#Working_of_BMP180
“Working of BMP180”
[Accessed 8/12/2021].

[22] https://www.arduino.cc/en/guide/environment
“Arduino IDE”
[Accessed 8/12/2021].

39
Appendix A
Program Code
#define BLYNK_DEVICE_NAME "dht11"
#definBLYNK_AUTH_TOKEN
"_6WWp_EBeF6FbZtvu9_YGnaaaTW51IKn"
#define BLYNK_PRINT Serial
#include <LiquidKrystal_I2C.h> //new line
#include <WiFi.h>
#include <WiFiklient.h>
#include <BlynkSimpleEsp32.h>
#include <DHT.h>
LiquidCrystal_I2C lcd(0x27,16,2); //new line
char auth[] = BLYNK_AUTH_TOKEN;
char ssid[] = "user_name";
char pass[] = "*********";
#define DHTPIN 32
#define DHTTYPE DHT11
#define DHTTYPE DHT22
#define DHTTYPE DHT21
DHT dht(DHTPIN, DHTTYPE);
BlynkTimer timer;
void sendSensor()
{float h = dht.readHumidity();
float t = dht.readTemperature();
int rain = analogRead(33);
int light = analogRead(34);
if (isnan(h) || isnan(t))

A-1
Serial.println("Failed to read from DHT sensor!");
return;
Blynk.virtualWrite(V5, h);
Blynk.virtualWrite(V6, t);
Blynk.virtualWrite(V8, light);
//rain sensor (new lines)
if (rain >=3880 && rain<=4096){
Blynk.virtualWrite(V7, "clear sky");}
if (rain >=3200 && rain<=3520){
Blynk.virtualWrite(V7, "light rain");}
if (rain >=0 && rain<=1800){
Blynk.virtualWrite(V7, "heavy rain");}
//LDR (new lines)
light = analogRead(34);
//lcd.setCursor(0,1);
//lcd.print("LDR:");
//lcd.setCursor(4,1);
if (light >= 0 && light <=243) {
//lcd.print("(Night)");
Blynk.virtualWrite(V8, "Night");}
if (light >= 244 && light <=1203
//lcd.print("(Cloudy)");
Blynk.virtualWrite(V8, "Cloudy");}
if (light >= 1204 && light <=4095){
// lcd.print("(Sunny)");
Blynk.virtualWrite(V8, "Sunny");}
void setup({

A-2
lcd.init();
lcd.init();
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0,1);
lcd.print("");
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
dht.begin();
timer.setInterval(1000L, sendSensor);}
void loop(){
Blynk.run();
timer.run();
delay(500);
float h=dht.readHumidity();
float t= dht.readTemperature();
if (isnan(h)||isnan(t)){
return;}
dht.read(h);
dht.read(t);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("H:");
Blynk.virtualWrite(V5, h);
lcd.print(h);
lcd.setCursor(4,0);
lcd.print("%");

A-3
Blynk.virtualWrite(V6, t);
lcd.setCursor(5,0);
lcd.print("T:");
lcd.print(t);
lcd.setCursor(9,0);
lcd.print("C");
//LDR
int light = analogRead(34);
light = analogRead(34);
lcd.setCursor(0,1);
//lcd.print("LDR:");
//lcd.setCursor(4,1);
if (light >= 0 && light <=243) {
lcd.print("Night");
Blynk.virtualWrite(V8, "Night");}
if (light >= 244 && light <=1203) {
lcd.print("Cloudy");
Blynk.virtualWrite(V8, "Cloudy");}
if (light >= 1204 && light <=4095){
lcd.print("Sunny");
Blynk.virtualWrite(V8, "Sunny");}
//rain sensor (new lines)
int rain = analogRead(33);
lcd.setCursor(7,1);
if (rain >=3880 && rain<=4096){
lcd.print ("ClearSky");
Blynk.virtualWrite(V7, "Clear Sky");}

A-4
if (rain >=3200 && rain<=3520){
lcd.print ("LightRain");
Blynk.virtualWrite(V7, "Light Rain");}
if (rain >=0 && rain<=1800){
lcd.print ("HeavyRain");
Blynk.virtualWrite(V7, "Heavy Rain");}
//Blynk.run();
//timer.run();}

A-5
Appendix B
Specifications of Esp32s microcontroller
Operating voltage 2.2v to 3.6v
GPIO 36 ports
ADC 14 ports
DAC 2 ports
Flash memory 16 Mbyte
SRAM 250 Kbyte
Clock speed Up to 240 MHZ
Wi-Fi 2.4 GHz
Sleep current 2.5 uA
Table (B.1) ESp32 specification

RTC and Low-Power Management


With the use of advanced power-management technologies, ESP32 can switch
between different power modes:
• Power modes
– Active mode: The chip radio is powered on. The chip can receive, transmit, or
listen.
– Modem-sleep mode: The CPU is operational, and the clock is configurable. The
Wi-Fi/Bluetooth baseband and radio are disabled.
– Light-sleep mode: The CPU is paused. The RTC memory and RTC peripherals,
as well as the ULP coprocessor are running. Any wake-up events (MAC, host,
RTC timer, or external interrupts) will wake up the chip.
– Deep-sleep mode: Only the RTC memory and RTC peripherals are powered on.
Wi-Fi and Bluetooth connection data are stored in the RTC memory. The ULP
coprocessor is functional.
– Hibernation mode: The internal 8 MHz oscillator and ULP coprocessor are
disabled. The RTC recovery memory is powered down. Only one RTC timer on
the slow clock and certain RTC GPIOs are active.

B-1
I2C Interface
ESP32 has two I2C bus interfaces which can serve as I2C master or slave,
depending on the user’s configuration. The I2C interfaces support: • Standard
mode (100 Kbit/s)
• Fast mode (400 Kbit/s)
• Up to 5 MHz, yet constrained by SDA pull-up strength
• 7-bit/10-bit addressing mode
• Dual addressing mode
Users can program command registers to control I2C interfaces, so that they
have more flexibility

B-2

You might also like