Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

Independent University, Bangladesh

Title: Internet of Things (IoT) Based Weather Monitoring System

Course: Instrumentation and Measurements


Spring 2020

Section: 01

Submitted to:

Dr. Farruk Ahmed

Professor, Department of Computer Science and Engineering

Submitted by:

 Sumedha Rahman Prova


1720558
 Ferdous Shahriar Kabir
1721010
 Nure Saba
1722250
Department: Computer Science and Engineering (CSE)
Submission date: 15/ 04/ 2020
Abstract

The system proposed in this paper is an advanced solution for monitoring the weather conditions
at a particular place and making the information visible anywhere in the world. The technology
behind this is the Internet of Things (IoT), which is an advanced and efficient solution for
connecting the things to the internet and to connect the entire world of things in a network. The
system here deals with monitoring and controlling the environmental conditions like
temperature, relative humidity and rainfall measure with sensors and sends the information to the
web page and then plots the sensor data as graphical statistics. The data updated from the
implemented system can be accessible on the internet from anywhere in the world.

Introduction

Present innovations in technology mainly focus on controlling and monitoring of different


activities. These are increasingly emerging to reach the human needs. Most of this technology is
focused on efficient monitoring and controlling different activities. An efficient environmental
monitoring system is required to monitor and assess the conditions in case of exceeding the
prescribed level of parameters. When the objects like an environment equipped with sensor
devices, microcontroller and various software applications becomes a self-protecting and self-
monitoring environment and it is also called a smart environment. The effects due to the
environmental changes on animals, plants and human beings can be monitored and controlled by
a smart environmental monitoring system. By using embedded intelligence into the environment
makes the environment interactive with other objectives, this is one of the applications that smart
environment targets. The main aim of this paper is to design and implement an efficient
monitoring system through which the required parameters are monitored remotely using the
internet and the data gathered from the sensors are stored in the cloud and to project the
estimated trend on the web browser. The embedded system is an integration of sensor devices,
wireless communication which enables the user to remotely access the various parameters and
store the data in cloud.
Description in Detail

Imagine a situation where scientists/nature analysts want to monitor changes in a particular


environment, say volcano or a rain-forest. And these people are from different places in the
world. In this case, SMS based weather monitoring has its own limitations. Since it sends SMS
to a few numbers. And time for sending SMS increases as the number of mobile numbers
increases. In order to send this data to everyone, a person who receives this SMS can upload/add
data to some place where everyone can see it. And what else apart from the Internet connects
everyone in this world? However, a person doing it manually is time consuming and a tedious
job. And then there arises a need for an automated solution for this. So in such scenarios, IOT –
Internet of Things proves really effective. Using the Internet of Things, we can upload these
weather parameters data to the cloud using internet connectivity over a Wi-Fi module through
wireless communication. Thus this project is also categorized under Wireless communication
projects.
Two things are necessary to view this weather reporting over the Internet. One is the Internet and
another is a device to access a URL/ website. This device can be accessed from a laptop or
desktop or a tablet or even a smartphone. Internet connectivity is required at both places. One
where the project is placed and another from where the user monitors this data.

Proposed Model

Hardware Specifications:

● Atmega Microcontroller
● DHT11 Digital Temperature Humidity Sensor
● Rain Drop Sensor
● ESP8266 Wi-Fi Module
● LCD Display
● Crystal Oscillator
● Resistors
● Capacitors
● Voltage Regulator
● Potentiometer
● Cables and Connectors
● Diodes
● Breadboard
● LED
● Transformer/Adapter
● Push Buttons
● Switch
● IC

Software Specifications

● Arduino Compiler
● MC Programming Language: C
● Programming Code
● IoT Web Page
System Architecture

Fig: Block Diagram of IOT weather reporting system


Working Principle of IoT based Weather Reporting System:

This IoT weather reporting system works on the principle of sensors working. When it is
connected with 220V AC supply then it steps down 220V AC into 9V AC with the help of a step
down AC transformer. Because this system mostly consists of electronic components, these AC
voltages are converted into D.C with the help of bridge rectifier. The rectifier is made with four
4007 diodes. The current cannot be converted to pure DC and some fluctuations are observed. So
the solution to that is adding an electrolytic capacitor of 1000 µF (microfarad). Now the
capacitor has pure DC of 9V. But we need 5V DC supply. The step is regulating to 5V DC with
the help voltage regulator that is connected with an LED. LCD display, WIFI module and
microcontroller are powered up with this voltage regulator. Here we have used the LM 7805
voltage regulator for this purpose. Also a 10 kilo ohm (kΩ) resistor is connected just beside a
power switch. The power switch is used to reset the whole circuit.
The next part is the Arduino Microcontroller and its IC number is Atmega328. Arduino is
programmed and fitted inside the IC. There are 28 ports and a crystal oscillator of 16 MHz
(MegaHertz) is connected to the 11th port and it is used to generate frequency. Two 22 pF
(picoFarad) capacitors are placed on two sides of the crystal. Lastly, a potentiometer of 10 kilo
ohm (kΩ) is placed near the LCD display. If the potentiometer is rotated, the words on the LCD
display can be seen clearer.

This system automatically displays the temperature, humidity and weather condition on a
dedicated server, ThingSpeak as well as it also displays this data on the LCD display. Because
this whole work is done automatically therefore the 18F452 microcontroller is the main
intelligent controller of this system. It is programmed in C language with the help of Arduino
IDE software and is interfaced with LCD display, WIFI module, LM 358 rain drop sensor,
humidity and temperature sensor. Using the WIFI module, the data are recorded and sent to the
webpage after 10 - 20 seconds, where graphs can be generated using ThingSpeak.

Temperature and humidity sensor works on the principle voltage and current, means when
temperature is increased then its producing voltage is increased similarly when humidity is
increased then its producing current is increased. These increasing current and voltage values are
measured by the microcontroller and then gives the logic high signal to WIFI module and
internal LCD display against these measured values. Then its internal LCD display displays these
values of its LCD screen and WIFI modem which is linked with the internet, displays these
values of ThingSpeak. Where the user can easily check the current status of the weather without
connecting a forecasting agency. Similarly, this system also tells the rain status when a raindrop
falls on the raining board. Raining board is basically the printed circuit board when a raindrop
falls on this board, it is short circuited and its short circuited current value is sensed by the
microcontroller through a raindrop sensor. Then it displays these values on an online webpage
and LCD display. This is simply the working of an IOT based weather reporting system.
Hardware Specifications in Detail:

Atmega Microcontroller:

An Atmega Microcontroller is an 8-bit microcontroller with Reduced Instruction Set (RISC)


based Harvard Architecture. It has standard features like on-chip ROM (Read Only Memory),
Data RAM (Random Access Memory), data EEPROM (Electrical Erasable Programmable Read
Only Memory), Timers and Input/output Ports, along with extra peripherals like Analog to
Digital Converters (ADC), Serial Interface Ports etc. They have 120 and more instruction sets
and program memory ranges from 4K to 256K Bytes. The data memory is divided into three
parts – 32 General Purpose Registers, Input/output memory and Internal Static Random Access
Memory (SRAM). While the size of General Purpose Registers is fixed, the I/O Memory and
internal SRAM size varies from chip to chip.

DHT11 Digital Temperature Humidity Sensor


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 of the data pin (no analog input pins needed). It's fairly simple to use, but requires careful
timing to grab data. The only real downside of this sensor is you can only get new data from it
once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old.

Rain Drop Sensor

/Raindrop Sensor is a tool used for sensing rain. It consists of two modules, a rain board that
detects the rain and a control module, which compares the analog value, and converts it to a
digital value. The raindrop sensors can be used in the automobile sector to control the windshield
wipers automatically, in the agriculture sector to sense rain and it is also used in home
automation systems. The control module of the raindrop sensor has 4 outputs. VCC is connected
to a 5V supply. The GND pin of the module is connected to the ground. The D0 pin is connected
to the digital pin of the microcontroller for digital output or the analog pin can be used. To use
the analog output, the A0 pin can be connected to the ADC pin of a microcontroller.

ESP8266 Wi-Fi Module

Here we used ESP8266 Wi-Fi module which is having TCP/IP protocol stack integrated on chip.
So that it can provide any microcontroller to get connected with Wi-Fi network. ESP8266 is a
preprogrammed SOC and any microcontroller has to communicate with it through the UART
interface. It works with a supply voltage of 3.3v. The module is configured with AT commands
and the microcontroller should be programmed to send the AT commands in a required sequence
to configure the module in client mode. The module can be used in both client and server modes.

LCD Display
LCD (Liquid Crystal Display) is a type of flat panel display which uses liquid crystals in its
primary form of operation. LEDs have a large and varying set of use cases for consumers and
businesses, as they can be commonly found in smartphones, televisions, computer monitors and
instrument panels. LCDs are lit by a backlight, and pixels are switched on and off electronically
while using liquid crystals to rotate polarized light. A polarizing glass filter is placed in front and
behind all the pixels, the front filter is placed at 90 degrees. In between both filters are the liquid
crystals, which can be electronically switched on and off.

Crystal Oscillator

A mechanical resonance of a vibrating crystal of piezoelectric material. It will create an electrical


signal with a given frequency. This frequency is commonly used to keep track of time for
example wristwatches are used in digital integrated circuits to provide a stable clock signal and
also used to stabilize frequencies for radio transmitters and receivers. Crystal oscillators must be
designed to provide a load capacitance. Generally in microcontrollers, we are using an 8MHz
crystal oscillator. This oscillator can be used as the different types of sensors such as temperature
sensors.

Resistors
The resistor is a passive electrical component to create resistance in the flow of electric current.
In almost all electrical networks and electronic circuits they can be found. The resistance is
measured in ohms. An ohm is the resistance that occurs when a current of one ampere passes
through a resistor with a one volt drop across its terminals. The current is proportional to the
voltage across the terminal ends. This ratio is represented by Ohm’s law:

Resistors are used for many purposes. A few examples include delimiting electric current,
voltage division, and heat generation, matching and loading circuits, control gain, and fix time
constants. They are commercially available with resistance values over a range of more than nine
orders of magnitude.

Capacitors
Capacitor is an electronic component that stores electric charge. The capacitor is made of 2 close
conductors (usually plates) that are separated by a dielectric material. The plates accumulate
electric charge when connected to the power source. One plate accumulates positive charge and
the other plate accumulates negative charge. The capacitance is the amount of electric charge
that is stored in the capacitor at voltage of 1 Volt. The capacitance is measured in units of
Faraday (F). The capacitor disconnects current in direct current (DC) circuits and short circuit in
alternating current (AC) circuits. For this project we have used a 1000µF capacitor.

Voltage Regulator

A voltage regulator is a system designed to automatically maintain a constant voltage level. A


voltage regulator may use a simple feed-forward design or may include negative feedback. It
may use an electromechanical mechanism, or electronic components. Depending on the design, it
may be used to regulate one or more AC or DC voltages. Electronic voltage regulators are found
in devices such as computer power supplies where they stabilize the DC voltages used by the
processor and other elements. We have used a LM 7805 Voltage Regulator in our project. 7805
is a three terminal linear voltage regulator IC with a fixed output voltage of 5V which is useful in
a wide range of applications.
Potentiometer

A potentiometer (also known as a pot or pot meter) is defined as a 3 terminal variable resistor in
which the resistance is manually varied to control the flow of electric current. A potentiometer
acts as an adjustable voltage divider. It is a passive electronic component. Potentiometers work
by varying the position of a sliding contact across a uniform resistance. In a potentiometer, the
entire input voltage is applied across the whole length of the resistor, and the output voltage is
the voltage drop between the fixed and sliding contact. A potentiometer has the two terminals of
the input source fixed to the end of the resistor. To adjust the output voltage the sliding contact
gets moved along the resistor on the output side.

Cables and Connectors


Cables and connectors also known as jump wire is an electrical wire, or group of them in a cable,
with a connector or pin at each end or sometimes without them, which is normally used to
interconnect the components of a breadboard or other prototype or test circuit, internally or with
other equipment or components, without soldering. Individual jump wires are fitted by inserting
their end connectors into the slots provided in a breadboard, the header connector of a circuit
board, or a piece of test equipment.

Diodes

A diode is a device which allows current flow through only one direction. That is the current
should always flow from the Anode to Cathode. The cathode terminal can be identified by using
a grey bar as shown in the picture above. We have used four 1N4007 diodes in this project. For
1N4007 diodes, the maximum current carrying capacity is 1A it can withstand peaks up to 30A.
Hence we can use this in circuits that are designed for less than 1A. The reverse current is 5uA
which is negligible. The power dissipation of this diode is 3W.
Breadboard

A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you
easily insert electronic components to prototype (meaning to build and test an early version of)
an electronic circuit, like this one with a battery, switch, resistor, and an LED (light-emitting
diode).

LED
LEDs (Light Emitting Diodes) are semiconductor light sources that combine a P-type
semiconductor (larger whole concentration) with an N-type semiconductor (larger electron
concentration). Applying a sufficient forward voltage will cause the electrons and holes to
recombine at the P-N junction, releasing energy in the form of light. Compared with
conventional light sources that first convert electrical energy into heat, and then into light, LEDs
(Light Emitting Diodes) convert electrical energy directly into light, delivering efficient light
generation with little-wasted electricity.

Transformer/Adapter

A Step down Transformer is a device which converts high primary voltage to a low secondary
voltage. In a Step down Transformer, the primary winding of a coil has more turns than the
secondary winding. In this project we have used a 9-0-9; 750 mA transformer.

Push Button/Switch
These 6mm push button momentary on switches are an essential part of any breadboard-based or
through-hole project. Useful for single-press activities, such as reset functions, the switches are
part of most Arduino-based kits. The key to using these switches is figuring out which leads are
actually switched. The switching action happens between the closer leads. The other two leads
are connected internally (shorted) to the leads that switch.

IC

An integrated circuit, or IC, is a small chip that can function as an amplifier, oscillator, timer,
microprocessor, or even computer memory. An IC is a small wafer, usually made of silicon, that
can hold anywhere from hundreds to millions of transistors, resistors, and capacitors. These
extremely small electronics can perform calculations and store data using either digital or analog
technology. For our project we have used the ATmega328 which is a single-chip microcontroller
created by Atmel in the megaAVR family. It has a modified Harvard architecture 8-bit RISC
processor core.

Software Specifications in Detail:

Arduino Compiler
A program for Arduino hardware may be written in any programming language with compilers
that produce binary machine code for the target processor. For this project we have used the
software Arduino IDE. The Arduino Integrated Development Environment (IDE) 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
3rd party cores, other vendor development boards.

MC Programming Language: C

Microcontrollers were originally programmed only in assembly language, but various high-level
programming languages, such as C, Python and JavaScript, are now also in common use to target
microcontrollers and embedded systems. This project has been programmed using C language. C
is a general-purpose, procedural computer programming language supporting structured
programming, lexical variable scope, and recursion, while a static type system prevents
unintended operations.

Programming Code
Programming part of this project plays a very important role to perform all the operations. First
of all we include required libraries and initialize variables.

Then we enter the Write API key and take some strings.

In void loop () function we read temperature and humidity and then show those readings on the
LCD.

Void send2server () function is used to send the data to the server. Send2server function is a
timer interrupt service routine, calling in every 20 seconds. When we call update function, the
timer interrupt service routine is called.

Code is given below:


IoT Web Page

In this IoT project we are going to monitor Humidity, Temperature and Rain Drop over the
internet using ThingSpeak where we will show the current Humidity, Temperature and Rain
Drop data over the Internet using the ThingSpeak server. It is accomplished by the data
communications between Arduino in the microcontroller, DHT11 Sensor Module, ESP8266
WIFI module and LCD. Celsius scale thermometer and percentage scale humidity meter displays
the ambient temperature and humidity through a LCD display and also sends it to ThingSpeak
server for live monitoring from anywhere in the world.

Here we are explaining about How to send Data to ThingSpeak server by using ESP8266 WIFI
Module:

1. First of all, the user needs to create an Account on ThingSpeak.com, then Sign In and click on
Get Started.

2. Then go to the ‘Channels’ menu and click on New Channel option on the same page for
further process.

3. Now the user will see a form for creating the channel, the user needs to fill in the Name and
Description as per their choice. Then fill ‘Humidity’, ‘Temperature’ and ‘Rain Sensor’ in Field
1, Field 2 and Field 3 labels, tick the checkboxes for both Fields. Also tick the check box for
‘Make Public’ option below in the form and finally Save the Channel. Now a new channel has
been created.

4. Now click on ‘API keys’ tab and save the Write and Read API keys, here we are only using
Write key. You need to Copy this key in char *api_key in the Code.

5. After it, click on ‘Data Import/Export’ and copy the Update Channel Feed GET Request URL,
which is:

https://api.thingspeak.com/update?api_key=SIWOYBX26OXQ1WMS&field1=0

6. Now user need to open “api.thingspeak.com” using the httpGet function with the postUrl as
“update? api_key=SIWOYBX26OXQ1WMS&field1=0” and then send data using data feed or
update request address.
Graphical Representation of Data

Graphical representation is another way of analyzing environmental changes. Specifically for


this report, we used ThingSpeak to generate the graphs. The readings are directly sent to the
webpage and it auto-generates a graph. A graph shows statistical data that are represented in the
form of lines or curves drawn across the coordinated points plotted on its surface. Graphs enable
us in studying the cause and effect relationship between two variables. This project allows us to
view graphical statistics of the environment around where the device is placed. It can be accessed
from anywhere through the internet to exhibit any data in a systematic manner to represent them
with suitable and appropriate diagrams. Examples of few data collected are shown below:
Computational Analysis

AC voltmeter using rectifiers: Electronic ac voltmeter is basically identical to dc voltmeter


except that the ac input voltage must be rectified before it can be applied to the dc meter circuit.
In some instances, rectification takes place before amplification. In which case a simple diode
rectifier circuit precedes the amplifier and meter.

This approach ideally requires a dc amplifier with zero drift characteristics and unity voltage
gain, and a dc meter movement with adequate sensitivity.

In another approach the ac signal is rectified after amplification. Where full-wave rectification
takes place in the meter circuit connected to the output terminal of the ac amplifier. This
approach generally requires an AC amplifier with high open-loop gain and large amounts of
negative feedback to overcome the nonlinearity of the rectifier diodes.

Ac voltmeters are usually of the average-responding type, with the meter scale calibrated in
terms of the rms value of the sine wave. Since so many waveforms in electronics are sinusoidal,
this is an entirely satisfactory solution and certainly much less expensive than a true rms-
responding voltmeter. Non sinusoidal waveforms, however, will cause this type of meter to read
high or low, depending on the form factor of the waveform.
The rms value of a voltage wave that has equal positive and negative excursion is related to the
average value by the form factor, as the ratio of the rms value of the average value of this
waveform, for a sinusoid can be expressed as

Therefore, when an average responding voltmeter has scale marking corresponding to the rms
value of the applied sinusoidal input waveform, those markings are actually collected by a factor
of the true value of applied voltage.

Non sinusoidal waveforms, when applied to this voltmeter, will cause the meter to read high or
low, depending on the form factor of the waveform.

Inductor-Capacitor Oscillators: there is a board class of oscillator that uses the resonant
characteristics of an inductor-capacitor, LC circuit to generate a stable frequency. The oscillator
consists of an amplifier and a feedback network such that the total gain of the loop, that is gain of
the amplifier divided by the loss of the feedback network, is exactly equal to one, and the total
phase shift around the loop is zero. Oscillators are designed such that these characteristics are
met at only one frequency. This can be achieved by using various combinations of inductors,
capacitors and resistors.

The resonant Frequency of a circuit given by


When a resonant circuit is used in the feedback of an oscillator, the oscillation frequency is the
resonant frequency of the circuit.

Variable differential transformer transducer: the differential transformer transducer


measures force in terms of the displacement of the ferromagnetic core of a transformer. The
basic construction of the linear variable differential transformer (LVDT). The transformer
consists of a single primary winding and two secondary windings which are placed on either side
of the primary. The secondary have an equal number of turns but they are connected in series
opposition so that the emfs included in the coils oppose each other. The position of the movable
core determines the flux linkage between the ac-excited primary winding and each of the two
secondary windings.

ADVANTAGES

● The IoT Weather Monitoring System project using Atmega microcontroller is fully
automated.
● It does not require any human attention.
● We can get prior alert of weather conditions.
● It is low cost and efforts are less.
● In this system accuracy is high.
● It is a smart way to monitor.
● Environment Efficient.
APPLICATIONS

● Weather forecasting plays a very important role in the field of agriculture.


● It is also helpful at places like volcanoes and rainforests.
● It is quite difficult for a human being to stay for a longer time at such places therefore use
of this project is efficient.

FUTURE SCOPE

● One can implement a few more sensors and connect it to the satellite as a global feature
of this system.
● Adding more sensors to monitor other environmental parameters such as CO2, pressure
and oxygen Sensor.
● 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.
CONCLUSION

By keeping the weather station in the environment for monitoring enables self-protection (i.e.,
smart environment) to the environment. To implement this need to use the sensor devices in the
environment for collecting the data and analysis. By using sensor devices in the environment, we
can bring the environment into real life. Then the collected data and analysis results will be
available to the user through the Wi-Fi. The smart way to monitor the environment, an efficient,
low cost embedded system is presented in this paper. It also sent the sensor parameters to the
cloud. This data will be helpful for future analysis and it can be easily shared to other users also.
This model can be expanded to monitor the developing cities and industrial zones for pollution
monitoring. To protect the public health from pollution, this model provides an efficient and low
cost solution for continuous monitoring of the environment.

THANK YOU.

You might also like