You are on page 1of 39

A

PROJECT REPORT

ON

WEATHER STATION USING RASPBERRY PI


Submitted in partial fulfillment for the award of the degree of

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS AND COMMUNICATION ENGINEERING

UNIVERSITY DEPARTMENTS,

RAJASTHAN TECHNICAL UNIVERSITY, KOTA

SUBMITTED TO: SUBMITTED BY:

ECE DEPTT. ASHWINI SONI (15/633)

RTU, KOTA ATIN VERMA (15/058)

AYUSH SINGHAL (15/066)

PROJECT SUPERVISOR: BHUMIKA RANAWAT (15/079)

Dr. DEEPAK BHATIA FARHEEN NAAZ (15/514)

Page | 1
PREFACE
As we know that an engineer has to serve an industry and he/she must have knowledge of
interrelation between the theory and the practical. For this, one must be familiar with the
practical knowledge with theory aspects.

To gain the practical knowledge, engineering courses provide project work for final year students
where they get the opportunity to show their skills by applying theoretical knowledge to build a
working model on a practical platform.

This document gives the insight about the working model which our team has prepared with
complete dedication and sincerity. Interactive visuals give readers an ease to understand different
purposes to be solved with assistance of this model and don’t let reader to get bored.

Page | 2
ACKNOWLEDGEMENT
We take this opportunity to express our profound gratitude and deep regards to Dr. DEEPAK
BHATIA for his exemplary guidance, mentoring, monitoring and constant encouragement
throughout the whole duration of minor project. The blessings, help and guidance given by him
time to time shall carry us a long way in the journey of life on which we are about to embark.

We would like to deeply show our sincere gratitude to Dr. R.S. MEENA for allowing us to
make a working model in his esteemed organization.

We are obliged to the faculty members of UTD, RTU, Kota for the valuable information
provided by them in making this project successful. We are grateful for their cooperation during
the period of whole project work. Lastly we would like to thank our parents, almighty and
friends for their constant encouragement without which this would not have been possible.

ASHWINI SONI (15/633)

ATIN VERMA (15/058)

AYUSH SINGHAL (15/066)

BHUMIKA RANAWAT (15/079)

FARHEEN NAAZ (15/514)

Page | 3
CANDIDATE’S DECLARARTION
Hereby declared that the work, which is being presented in the Project, entitled “Weather
Station using Raspberry Pi” in partial fulfilment for the award of Degree of “Bachelor of
Technology” in Department of Electronics Engineering with Specialization in Electronics and
Communication Engineering, and submitted to the Department of Electronics Engineering,
Rajasthan Technical University is a record of the investigations carried under the Guidance of
Dr. Deepak Bhatia, Department of Electronics Engineering.

The matter presented in this report has not been submitted anywhere for the award of any other
Degree.

ASHWINI SONI (15/633)

ATIN VERMA (15/058)

AYUSH SINGHAL (15/066)

BHUMIKA RANAWAT (15/079)

FARHEEN NAAZ (15/514)

Page | 4
CONTENTS

Preface……………………………………………………………………………............2
Acknowledgement………………………………………………………………………...3
Candidate’s Declaration………………………………………………………………….4
Contents………………………………………………………………………..………....5
List of Figures…………….……………………………………………………..………..6
1. Chapter 1
1.1 Introduction……………..……………………………………………………….7
1.2 Objective……………………….………………………………………………..8
2. Chapter 2
Literature Review……………………….…………………………………………...9
3. Chapter 3
3.1 Block Diagram……………………………………………………...………….11
3.2 Circuit Diagram………………………………………………………...….......11
4. Chapter 4
Hardware Requirements
4.1 Raspberry Pi 3 Model B+……………………………………..…………….…14
4.2 DHT 11 Temperature and Humidity Sensor………………...…………………17
4.3 BMP 180 Pressure Sensor……………………………………..…………….…19
4.4 16 x 2 Liquid Crystal Display (LCD)………………………….…………........22
4.5 10K Pre-set Potentiometer……………………………….…….………………24
4.6 Ethernet Cable……………………………………………….….……………...25
5. Chapter 5
Software Requirements
5.1 VNC Viewer…………………………………………………….….………….26
5.2 Noobs…………………………………………………………….….…………27
5.3 Python…………………………………………………………….…….……...27
5.4 Programming Code………………………………………………..…………...28
6. Chapter 6
Results………………………………………………………………………….…..31
7. Chapter 7
Proposed Work for the Major Project: Smart Mirror………………………….…...34
8. Conclusion……………………………………………………………………….…….36
9. References…………………………………………………………………………..….37

Page | 5
LIST OF FIGURES

Fig.No. Figure Name Page No.

1. Block Diagram of Weather Station using Raspberry Pi 11

2. Circuit Diagram of Weather Station using Raspberry Pi 11

3. Raspberry Pi 3 Model B+ 14

14
4. Block Diagram of Raspberry Pi 3 Model B+ Hardware

Raspberry Pi 3 GPIO Header Pin Configurations 15


5.

6. Three pin type DHT11 Sensor 17

7. Reading Digital Output from DHT11 18

19
8. BMP180 Sensor Module
19
9. BMP180 Sensor Pinout
22
10. Liquid crystal display (LCD)

11. 10K Pre-set Potentiometer 24

12. Ethernet Cable 25

31
13. Weather Station Displaying Temperature, Humidity and Pressure
31
14. Temperature, Humidity and Pressure readings of Day-1

15. Temperature, Humidity and Pressure readings of Day-2 32

16. Temperature, Humidity and Pressure readings of Day-3 32

17. Temperature, Humidity and Pressure readings of Day-4 33

The SMART MIRROR 35


18.

Page | 6
CHAPTER -1
1.1 INTRODUCTION
A Weather Station is a facility, either on land or sea, with instruments and equipment for
measuring atmospheric conditions to provide information for weather forecasts and to
study the weather and climate. The measurements taken include temperature, atmospheric
pressure, humidity, wind, speed, wind direction, and precipitation amounts.

Wind measurements are taken with as few other obstructions as possible, while
temperature and humidity measurements are kept free from direct solar radiation,
or insolation. Manual observations are taken at least once daily, while automated
measurements are taken at least once an hour. Weather conditions out at sea are taken by
ships and buoys, which measure slightly different meteorological quantities such as sea
surface temperature (SST), wave height, and wave period. Drifting weather
buoys outnumber their moored versions by a significant amount.

There are mainly three types of weather stations:-

A Personal Weather Station is a set of weather measuring instruments operated by a


private individual, club, association, or business (where obtaining and distributing
weather data is not a part of the entity's business operation). Personal weather stations
have become more advanced and can include many different sensors to measure weather
conditions. These sensors can vary between models but most measure wind speed, wind
direction, temperature, humidity, barometric pressure, rainfall, and UV or solar radiation.
Personal weather stations typically involve a digital console that provides readouts of the
data being collected. These consoles may interface to a personal computer where data can
be displayed, stored, and uploaded to websites or data ingestion/distribution systems.

Class of Home Weather Stations includes hygrometers, thermometers, barographs, and


barometers. They are commonly wall mounted based weather stations.

Synoptic Weather Stations are instruments which collect meteorological information at


synoptic time.

Here in our project we are designing a Weather Station using Raspberry Pi which is
capable of detecting and displaying the current temperature, humidity and pressure status
in order to get the idea of the present weather conditions.

Page | 7
1.2 OBJECTIVE

This project has been designed to develop a WEATHER STATION using RASPBERRY
PI. This project will help in saving time of the user in the daily curriculum. It is an
intelligent Weather Station based on Raspberry Pi, designed for the home of Internet of
things. The designed intelligent weather station has the advantages of small size, simple
operation, low cost, and is suitable for families, and has broad application prospects.

The objective is to design a Weather Station using Raspberry Pi which is equipped with
an intelligent temperature and humidity sensor (i.e. DHT11 Sensor), and a pressure
sensor (i.e.BMP180). The DHT11 Sensor is capable of detecting the present temperature
and humidity, and the BMP180 detects the barometric pressure and all these parameters
are displayed on the 16x2 LCD Screen.

This Raspberry Pi based Weather Station is an intelligent weather station capable of


detecting and displaying the present temperature, humidity and pressure which enables us
to predict the weather condition in order to schedule our curriculum. This is how it plays
an important and beneficial role in our daily life.

Page | 8
CHAPTER -2
2. LITERATURE REVIEW

Adnan Shaoutet al. [1] present an embedded design of a low cost weather station. Three
weather parameters; wind speed, wind directions and temperature are measured. The
measured parameters are used to measure the wind chill temperature and dressing index
through calculation and a build-in intelligent system. Only basic type sensors were used
so that the cost of this design is reduced. A small scale neural network was planted into
the microcontroller for the post-processing. Taking the three measured data as inputs, the
system gave out the dressing index as an output. All of the data were displayed on the
LCD and also sent to computer from the serial port.

R. Lajaraet al.[2]in the paper “Ultra Low Power Wireless Weather Station” proposed a
design of a tiny and low cost Wireless Weather Station to measure accurate temperature,
relative humidity, light intensity and atmospheric pressure. These direct climatic
variables and others indirectly attainable, like the dew-point, wind chill are readable
through a web page. The chosen sensors are factory calibrated and have a digital
interface. The Weather Sensor Nodes are able to achieve ultra-low power consumption,
allowing a single super capacitor to power them for 52 days. A really small and
autonomous wireless node transmits accurate information about several parameters of
weather. These are temperature, relative humidity, atmospheric pressure and light
intensity. A constantly powered base station collects the data and retransmits them
through cable to a host computer. The host stores the data and creates several files which
can be acceded through a web server.

MirceaPopa et al. [3] developed “Embedded Weather Station with Remote Wireless
Control”. Weather monitoring is of great importance in many domains such as:
agriculture, military, entertainment etc. There are several solutions for monitoring the
weather. The classical solution present in static weather stations. Another solution is
based on wireless sensor networks (WSNs). The third solution uses low dimensions
weather stations. This paper presents a weather station made of temperature, humidity,
pressure and luminosity sensors, embedded in a microcontroller based board. The station
is remotely controlled by the user through SMS commands. The remote control can be
implemented through wires, on Internet, or wirelessly by using different communication
technologies. The system uses the SEN-08311 USB Weather Board, which includes the
temperature and humidity sensor, pressure sensor and the TEMT6000 luminosity
sensor.The software is written in the Python language. It is divided in three parts: I) the
main program for initializations, establishing the connection to the GSM network,
receiving the data from the WSB Weather Board and processing the sensed values so that

Page | 9
the user commands can be achieved, II) the SIM library: the functions set the PIN value,
prepares the SIM card, verifies the strength of the signal for using the GSM network, III)
the SMS library: the functions are responsible with sending, receiving and erasing, after
being processed, the messages.

Ondrej Krejcar[4] developed “Low Cost Weather Station with Remote Control”.
Proposed work describes use a PC to control home weather station and visualization
measuring data via applications written in programming language C# with
communications via USB or RS232. Weather station is capable of measure temperature
up to five temperature sensors DS18B20, wind speed via measuring turbine with optical
encoder, the intensity of illumination via light sensitive element and finally is able to
detect an approaching thunderstorm by measuring atmospheric charge. The station also
disposing eight galvanic separation switch outputs, whose function in the supplied
software set to customer requirements.

ArpitaGhoshet al. [5] proposed a model which acts as a weather station and a rain
detector and is solely solar powered. The model is designed in such a way that it can be
used remotely and the readings are displayed on a user friendly LCD display and are
displayed as digital numeric values. The weather station includes a remote station for
monitoring the weather powered by a solar panel, and a base station to display data. The
remote station includes sensors to measure temperature, relative humidity, rain and solar
radiation level. The goal in system design is optimizing cost and power. The main
intention of the proposed model was to make a weather station which is powered by
renewable sources of energy. Hence we built a solar powered weather station which can
capture the various environmental factors and send the reading back to the LCD for
monitoring.

Page | 10
CHAPTER -3
3.1 BLOCK DIAGRAM
The following is the block diagram of the Weather Station using Raspberry Pi. It consists
of the six essential components for the Weather Station.

Figure 1: Block Diagram of Weather Station using Raspberry Pi

3.2 CIRCUIT DIAGRAM

Figure 2: Circuit diagram of Weather Station using Raspberry Pi

Page | 11
3.2.2 Circuit Specifications

The pin specifications for the circuit diagram are-

Table 1: Circuit specifications

S.No. Devices Pins Connections

1. LCD Vss GND

Vdd Vcc

Vo Contrast Potentiometer

Rs GPIO26

E(pin) GPIO19

D4 GPIO13

D5 GPIO06

D6 GPIO05

D7 GPIO11

LED+ Brightness Potentiometer

LED- GND

2. DHT11 GND GND

Vcc +5V DC

Data s/g GPIO04

Page | 12
3. BMP180 GND GND

Vcc 3.3V DC

SCL GPIO03

SCD GPIO02

4. Contrast Potentiometer GND GND

Center Pin Vo

5. Brightness Potentiometer Vcc 5V DC

Center Pin LED+

Page | 13
CHAPTER -4

4. HARDWARE REQUIREMENTS

4.1. Raspberry Pi 3 Model B+

Raspberry Pi 3 Model B was released in February 2016 with a 64 bit quad core processor,
on-board WiFi, Bluetooth and USB boot capabilities. On Pi Day 2018 model 3B+
appeared with a faster 1.4 GHz processor and a three times faster network based
on gigabit Ethernet (300 Mbit / s) or 2.4 / 5 GHz dual-band Wi-Fi (100 Mbit / s). Other
options are: Power over Ethernet (PoE), USB boot and network boot (an SD card is no
longer required).

Figure 3: Raspberry Pi 3 Model B+


4.1.1. Hardware of Raspberry Pi 3 Model B+

The Raspberry Pi hardware has evolved through several versions that feature variations
in memory capacity and peripheral-device support.

Figure 4: Block Diagram of Raspberry Pi 3 Model B+ Hardware

Page | 14
This block diagram describes Model B and B+; Model A, A+, and the Pi Zero are similar,
but lack the Ethernet and USB hub components. The Ethernet adapter is internally
connected to an additional USB port. In Model A, A+, and the Pi Zero, the USB port is
connected directly to the system on a chip (SoC). On the Pi 1 Model B+ and later models
the USB/Ethernet chip contains a five-port USB hub, of which four ports are available,
while the Pi 1 Model B only provides two. On the Pi Zero, the USB port is also
connected directly to the SoC, but it uses a micro USB (OTG) port.

4.1.2 General purpose input-output (GPIO) connector: Pin Configurations

Figure 5: Raspberry Pi 3 GPIO Header Pin Configurations

Page | 15
4.1.3. Technical Specifications of Raspberry Pi 3 Model B+

The Raspberry Pi 3 Model B+ is the latest product in the Raspberry Pi 3 range having the
following specifications:-

Table 2: Technical Specifications of Raspberry Pi 3 Model B+

S.No. Parameter Technical Specification

1. Device Specs Broadcom BCM2837B0,Cortex-A53(ARMv8) 64-bit SoC@1.4GHz

2. RAM 1GB LPDDR2 SDRAM

3. USB conf. Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps)

4. Pin conf. Extended 40-pin GPIO header

5. Cable Full-size HDMI

6. USB ports 4 USB 2.0 ports

7. Camera conn. CSI camera port for connecting a Raspberry Pi camera

8. Display DSI display port for connecting the Pi touchscreen display

9. Output port 4-pole stereo output and composite video port

10. Storage Micro SD port for loading the operating system & storing data

11. Input Power 5V/2.5A DC power input

12. Ethernet conf. Power-over-Ethernet (PoE) support (requires separate PoE HAT)

Page | 16
4.2. DHT11 Temperature and Humidity Sensor
This DHT11 Temperature and Humidity Sensor features a calibrated digital signal output
with the temperature and humidity sensor capability. Its technology ensures the high
reliability and excellent long-term stability. This sensor includes a resistive element
and a sensor for wet NTC temperature measuring devices and is connected with a high-
performance 8-bit microcontroller. It has excellent quality, fast response, anti-
interference ability and high performance. The calibration coefficients stored in the OTP
program memory, internal sensors detect signals in the process, we should call these
calibration coefficients. Small size, low power, signal transmission distance up to 20
meters, enabling a variety of applications and even the most demanding ones. The
product is 4-pin single row pin package.

Figure 6: Three pin type DHT11 Sensor


4.2.1. Technical Specifications of DHT11
Table 3: Technical Specifications of DHT11

S.No. Parameter Value

1. Supply Voltage: +5 V

2. Current Rating: 2.5 mA

3. Temperature range: 0-50 °C error of ± 2 °C

4. Humidity: 20-90% RH ± 5% RH error

5. Sampling Rate: 1Hz (one reading every second)

6. Interface: Digital

7. Body Size: 15.5mm*12mm*5.5mm

8. Resolution Range: 1% RH

Page | 17
4.2.2. Reading Digital Output from DHT11

DHT11 uses a Single bus data format for communication. Only a single data line between
an MCU like Raspberry Pi and the DHT11 Sensor is sufficient for exchange of
information. In this setup, the Microcontroller acts as a Master and the DHT11 Sensor
acts as a Slave. The Data OUT of the DHT11 Sensor is in open-drain configuration and
hence it must always be pulled HIGH with the help of a 5.1KΩ Resistor. This pull-up
will ensure that the status of the Data is HIGH when the Master doesn’t request the data
(DHT11 will not send the data unless requested by the Master). Now, we will the how the
data is transmitted and the data format of the DHT11 Sensor. Whenever the
Microcontroller wants to acquire information from DHT11 Sensor, the pin of the

Figure 7: Reading Digital Output from DHT11

Microcontroller is configured as OUTPUT and it will make the Data Line low for a
minimum time of 18ms and releases the line. After this, the Microcontroller pin is made
as INPUT. The data pin of the DHT11 Sensor, which is an INPUT pin, reads the LOW
made by the Microcontroller and acts as an OUTPUT pin and sends a response of LOW
signal on the data line for about 80µs and then pulls-up the line for another 80µs. After
this, the DHT11 Sensor sends a 40 bit data with Logic ‘0’ being a combination of 50µs of
LOW and 26 to 28µs of HIGH and Logic ‘1’ being 50µs of LOW and 70 to 80µs of
HIGH. After transmitting 40 bits of data, the DHT11 Data Pin stays LOW for another
50µs and finally changes its state to input to accept the request from the
Microcontroller.

Page | 18
4.3 BMP180 Pressure Sensor

BMP180 is one of the sensor of BMP XXX series. They are all designed to measure
Barometric Pressure or Atmospheric pressure. BMP180 is a high precision sensor
designed for consumer applications. Barometric Pressure is nothing but weight of air
applied on everything. The air has weight and wherever there is air its pressure is
felt. BMP180 sensor senses that pressure and provides that information in digital output.
Also the temperature affects the pressure and so we need temperature compensated
pressure reading. To compensate, the BM180 also has good temperature sensor. The
BMP180 is the new digital barometric pressure sensor of Bosch Sensortec, with a very
high performance, which enables applications in advanced mobile devices, such as
smartphones, tablet PCs and sports devices. It follows the BMP085 and brings many
improvements, like the smaller size and the expansion of digital interfaces.The ultra-low
power consumption down to 3 μA makes the BMP180 the leader in power saving for
your mobile devices. BMP180 is also distinguished by its very stable behavior
(performance) with regard to the independency of the supply voltage.

Figure 8: BMP180 Sensor Module

Figure 9: BMP180 Sensor Pinout

4.3.1 BMP180 Module Features

 Can measure temperature and altitude.


 Pressure range: 300 to 1100hPa
 High relative accuracy of ±0.12hPa
 Can work on low voltages
 3.4Mhz I2C interface
 Low power consumption (3uA)

Page | 19
 Pressure conversion time: 5msec
 Potable size

4.3.2 I2C Technology used in BMP180 Pressure Sensor

I2C (Inter Integrated Circut) is a communication protocol that the MCU’s like Raspberry
Pi can use to speak to other embedded devices (temperature sensors, displays,
accelerometers, etc). I2C is a two wire bus, the connections are called SDA (Serial Data)
and SCL (Serial Clock). Each I2C bus has one or more masters ( like the Raspberry Pi)
and one or more slave devices, like the I/O Expander. As the same data and clock lines
are shared between multiple slaves, we need some way to choose which device to
communicate with. With I2C, every device has an address that each communication must
be prefaced with. The temperature sensor defaults to an address of 0x77. The BMP180
communicates with a host microcontroller via communication standard “I2C” (for Inter
Integrated Circuit). I2C uses two wires, usually labelled SCL (Serial Clock) and SDA
(Serial Data). To function properly, I2C requires a pull-up resistor on each of those lines.
The BMP180 board includes these resistors. They are enabled by default, but you can
disable them by clearing solder jumper SJ1. I2C allows you to have multiple devices
connected to the same two lines (collectively called a bus). The pullup resistors allow the
bus to function, but you should only have one set of pullup resistors per bus. By default,
the BMP180 breakout board is set up to have the I2C bus communicate at 3.3V. This will
work for most 3.3V and 5V microcontrollers. However, if you wish to connect the
BMP180 to a lower-voltage microprocessor, such as one that operates at 1.8V, you can
do so by removing the solder from the jumper labelled “SJ2”. Once you do this, you will
need to provide the board with your desired I/O voltage via the “IO” header. The
BMP180 will accept I/O voltages from 1.62V to 3.6V.

4.3.3 Applications

 Indoor navigation
 Sport devices
 Computer Peripherals
 GPS
 Weather forecast
 Vertical velocity Indication
 Hobby projects

Page | 20
4.3.4 BMP180 Module Technical Specifications

Table 4: Technical Specifications of BMP180

S.No. Parameter Value

1. Operating voltage: 1.3V – 3.6V

2. Input voltage: 3.3V to 5.5V

3. Peak current: 1000uA

4. Power consumption: 0.1uA

5. Maximum voltage at SDA,SCL: VCC + 0.3V

6. Operating temperature: -40ºC to +80ºC

7. Pressure sensing range: 300-1100 hPa(9000m to -500m above sea level)

8. Technology used: I2C Technology

4.3.5 BMP180 Pin Configuration

BMP180 is available in two modules. One is Five pin module and other is Four pin
module. With Five pin module we have additional +3.3V pin which is absent in four pin
module. Other than that the functioning is same.

Table 5: Pin Configuration of BMP180

Pin Name Description

VCC Connected to +5V

GND Connected to ground.

SDA Serial Data pin (I2C interface)

SCL Serial Clock pin (I2C interface)

3.3V If +5V is not present. Can power module by connecting +3.3V to this pin.

Page | 21
4.4 16 x 2 Liquid Crystal Display (LCD)
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide
range of applications. A 16 x 2 LCD display is very basic module and is very commonly
used in various devices and circuits. These modules are preferred over seven
segments and other multi segment LEDs. The reasons being: LCDs are economical,
easily programmable, have no limitation of displaying special & even custom
characters (unlike in seven segments), animations and so on. Here in this project the
JHD162A series of 16x2 LCD is used.

Figure 10: Liquid crystal display (LCD)


A 16x2 LCD can display 16 characters per line and there are 2 such lines. In this LCD
each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely,
Command and Data. The command register stores the command instructions given to the
LCD. A Command is an instruction given to LCD to do a predefined task like initializing
it, clearing its screen, setting the cursor position, controlling display etc. The data register
stores the data to be displayed on the LCD. The data is the ASCII value of the character
to be displayed on the LCD.

4.4.1 Features of 16x2 LCD module

 Operating Voltage is 4.7V to 5.3V


 Current consumption is 1mA without backlight
 Alphanumeric LCD display module, meaning can display alphabets and numbers
 Consists of two rows and each row can print 16 characters.
 Each character is build by a 5×8 pixel box
 Can work on both 8-bit and 4-bit mode
 It can also display any custom generated characters
 Available in Green and Blue Backlight

Page | 22
Table 6: LCD 16x2 Datasheet

Pin No. Pin Name Description

1. Vss (Ground) Ground pin connected to system ground.

2. Vdd (+5 Volt) Powers the LCD with +5V (4.7V – 5.3V).

3. VE(Contrast V) Decides contrast level of display. Grounded to get maximum contrast.

4. Register select Connected to Microcontroller to shit between command/data register.

5. Read/Write Used to read or write data. Normally grounded to write data to LCD.

6. Enable Connected to Microcontroller Pin and toggled between 1 and 0 for data
acknowledgement.

7. Data pin 0 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

8. Data pin 1 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

9. Data pin 2 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

10. Data pin 3 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

11. Data pin 4 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

12. Data pin 5 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

13. Data pin 6 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

14. Data pin 7 Forms 8-bit data line & connected to Microcontroller to send 8-bit data.

15. LED positive Backlight LED pin positive terminal.

16. LED negative Backlight LED pin negative terminal.

Page | 23
4.5 10K Pre-set Potentiometer

Pre-set or trimmer potentiometers are small “set-and-forget” type potentiometers that


allow for very fine or occasional adjustments to be easily made to a circuit, (e.g. for
calibration). Single-turn rotary pre-set potentiometers are miniature versions of the
standard variable resistor designed to be mounting directly on a printed circuit board and
are adjusted by means of a small bladed screwdriver or similar plastic tool. Their low
cost, small size and simplicity makes them popular in non-critical circuit applications.
Pre-sets can be adjust from its minimum to maximum value within a single turn, but for
some circuits or equipment this small range of adjustment may be too coarse to allow for
very sensitive adjustments.
Here in this project we are using two 10K ohm Pre-set Potentiometers. The 10 kilo ohm
Preset Potentiometer is a three terminal variable resistor which is used to vary or change
the resistance. It is normally used to control any device.

Figure 11: 10K Pre-set Potentiometer

4.5.1 Features of 10K Preset Potentiometer


 Low temperature coefficient.
 Lower noise.
 Tighter resistance tolerance.
 Long-term resistance stability.
4.5.2 Applications of 10K Preset Potentiometer
 DIY kits.
 Major projects.
 Mini projects.
 Audio control.
 Television control.
 Motion control.
 Computation.

Page | 24
4.6 Ethernet Cable

An Ethernet cable is one of the most common forms of network cable used on wired
networks. Ethernet cables connect devices within a local area network, like PCs, routers,
and switches. Given that these are physical cables, they do have their limitations, both in
the distance that they can stretch and still carry proper signals, and their durability. These
limits are one reason there are different types of Ethernet cables optimized to perform
certain tasks in particular situations. Here in this project we are using Ethernet Cable
named RJ25 connector.

Figure 12: Ethernet Cable

Page | 25
CHAPTER- 5
5. SOFTWARE REQUIREMENTS

5.1 VNC Viewer

Sometimes it is not convenient to work directly on the Raspberry Pi. Maybe you would
like to work on it from another device by remote control. VNC is a graphical desktop
sharing system that allows you to remotely control the desktop interface of one computer
(running VNC Server) from another computer or mobile device (running VNC Viewer).
VNC Viewer transmits the keyboard and either mouse or touch events to VNC Server,
and receives updates to the screen in return. You will see the desktop of the Raspberry Pi
inside a window on your computer or mobile device. You'll be able to control it as though
you were working on the Raspberry Pi itself.
In computing, Virtual Network Computing (VNC) is a graphical desktop sharing system
that uses the Remote Frame Buffer protocol (RFB) to remotely control another computer.
It transmits the keyboard and mouse events from one computer to another, relaying the
graphical screen updates back in the other direction, over a network. VNC is platform-
independent – there are clients and servers for many GUI-based operating systems and
for Java. Multiple clients may connect to a VNC server at the same time. Popular uses for
this technology include remote technical support and accessing files on one's work
computer from one's home computer, or vice versa.
VNC was originally developed at the Olivetti & Oracle Research Lab in Cambridge,
United Kingdom. The original VNC source code and many modern derivatives are open
source under the GNU General Public License. VNC and RFB are registered trademarks
of RealVNC Ltd. in the U.S. and in other countries. VNC Connect from RealVNC is
included with Raspbian. It consists of both VNC Server, which allows you to control
your Raspberry Pi remotely, and VNC Viewer, which allows you to control desktop
computers remotely from your Raspberry Pi should you want to.

Page | 26
5.2 Noobs

NOOBS is a way to make setting up a Raspberry Pi for the first time much, much easier.
You won’t need network access, and you won’t need to download any special imaging
software. Just head to the downloads page, grab a copy of the NOOBS zip file, and
unpack it onto a freshly formatted 4GB (or larger) SD card. When you boot up for the
first time, you’ll see a menu prompting you to install one of several operating systems
into the free space on the card. The choice means you can boot the Pi with a regular
operating system like Raspbian, or with a media-centre specific OS like RaspBMC.
Once you’ve installed an operating system, your Pi will boot as normal. However,
NOOBS stays resident on your card, so by holding shift down during boot you can return
to the recovery interface. This allows you to switch to a different operating system, or
overwrite a corrupted card with a fresh install of the current one; it also provides a handy
tool to let you edit the config.txt configuration file for the currently installed operating
system, and even a web browser so you can visit the forums or Google for pointers if you
get stuck.

5.3 Python

Python is an interpreted high-level programming language for general-purpose


programming. Created by Guido van Rossum and first released in 1991, Python has a
design philosophy that emphasizes code readability, notably using significant whitespace.
It provides constructs that enable clear programming on both small and large scales. In
July 2018, Van Rossum stepped down as the leader in the language community after 30
years.
Python features a dynamic type system and automatic memory management. It supports
multiple programming paradigms, including object oriented, imperative, functional and
procedural, and has a large and comprehensive standard library.
Python interpreters are available for many operating systems. CPython, the reference
implementation of Python, is open source software and has a community-based
development model, as do nearly all of Python's other implementations. Python and
CPython are managed by the non-profit Python Software Foundation.

Page | 27
5.3.1 Applications
The Python Package Index (PyPI) hosts thousands of third-party modules for Python.
Both Python's standard library and the community-contributed modules allow for endless
possibilities.
 Web and Internet Development
 Database Access
 Desktop GUIs
 Scientific & Numeric
 Education
 Network Programming
 Software & Game Development

5.3.2 Python is used because-

 Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
 Python has a simple syntax similar to the English language.
 Python has syntax that allows developers to write programs with fewer lines than
some other programming languages.
 Python runs on an interpreter system, meaning that code can be executed as soon as it
is written. This means that prototyping can be very quick.
 Python can be treated in a procedural way, an object-orientated way or a functional
way.

Page | 28
5.4 Programming Code

import sys

import RPi.GPIO as GPIO

from time import sleep

import Adafruit_DHT

import urllib2

from Adafruit_BMP.BMP085 import BMP085

import Adafruit_CharLCD as LCD

# Raspberry Pi pin setup for LCD

lcd_rs = 26

lcd_en = 19

lcd_d4 = 13

lcd_d5 = 6

lcd_d6 = 5

lcd_d7 = 11

# Define LCD column and row size for 16x2 LCD.

lcd_columns = 16

lcd_rows = 2

lcd = LCD.Adafruit_CharLCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns,


lcd_rows)

Page | 29
lcd.message(' Welcome to\nWEATHER STATION')

sleep(5.0)

lcd.clear()

bmp = BMP085(1)

def readBMP180(): # Reading from BMP180

P=bmp.read_pressure()

return(str(P))

def getSensorData(): # Reading from DHT11

lcd.home()

RH,T = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 4)

pres=bmp.read_pressure()

lcd.message('Hum Temp Pressure\n{0:0.0f}% {1:0.0f}*C {2:0.0f}Pa'.format(RH, T,pres))

print('Humidity={0:0.1f}% Temp={1:0.1f}*C Pressure={2:0.1f}Pa'.format(RH, T,pres))

return (str(RH), str(T))

# main() function

def main():

if len(sys.argv) < 2:

print('Usage: python tstest.py VHOCE784F0HSOAS4')

exit(0)

Page | 30
print ('starting...')

baseURL = 'https://api.thingspeak.com/update?api_key=%s' % sys.argv[1]

while True:

try: # Transfer values to ThingsSpeak

RH,T = getSensorData()

P=readBMP180()

f = urllib2.urlopen(baseURL +

"&field1=%s&field2=%s" % (RH, T)+"&field3=%s" % (P))

f.read()

f.close()

sleep(15)

except KeyboardInterrupt:

print ('exiting.')

lcd.clear()

lcd.enable_display(False)

break

# call main

if __name__ == '__main__':

main()

Page | 31
CHAPTER -6
6. RESULTS
The designed weather station looks like:-

Figure 13: Weather Station Displaying Temperature, Humidity and Pressure

The observations for Day-1, Day-2, Day-3 and Day-4 are as follows. The temperature,
humidity and pressure readings for 5 different timings of the day are determined.

100
23 NOV' 18 99400
90 99200
80 99000
Temperature
Humidity &

Pressure
70
98800
60
98600
50
40 98400
26 26 27 29 27
30 98200
20 98000
7:27 1:31 4:24 7:46 11:02
AM PM PM PM PM
TEMPERATURE (*C) 26 26 27 29 27
HUMIDTY (%) 48 63 71 47 49
PRESSURE (Pa) 99293 98716 98562 98618 99242

Figure 14: Temperature, Humidity and Pressure readings of Day-1

Page | 32
24 NOV' 18
100 99400
90 99200
80 99000

Temperature
Humidity &

Pressure
70
98800
60
98600
50
40 98400

30 26 26 27 26 98200
22
20 98000
7:17 1:18 4:29 7:17 11:15
AM PM PM PM PM
TEMPERATURE (*C) 22 26 26 27 26
HUMIDTY (%) 57 31 49 43 42
PRESSURE (Pa) 99294 98553 98910 99143 99166

Figure 15: Temperature, Humidity and Pressure readings of Day-2

25 NOV' 18
100 99300
90 99200
80 99100
Temperature
Humidity &

Pressure
70
99000
60
98900
50
40 98800

30 27 26 25 27 98700
21
20 98600
7:57 1:08 4:14 7:12 11:36
AM PM PM PM PM
TEMPERATURE (*C) 21 27 26 25 27
HUMIDITY (%) 58 38 44 48 47
PRESSURE (Pa) 99224 98989 98857 98997 99009

Figure 16: Temperature, Humidity and Pressure readings of Day-3

Page | 33
28 NOV' 18
100 99400
90
99200
80
99000

Temperature
70

Humidity &

Pressure
60 98800
50
40 98600
24 26 25 27
30 19 98400
20
98200
10
0 98000
7:29 1:08 4:04 7:11 11:36
AM PM PM PM PM
TEMPERATURE (*C) 19 24 26 25 27
HUMIDITY (%) 67 62 49 55 47
PRESSURE (Pa) 99180 98635 98420 99076 99006

Figure 17: Temperature, Humidity and Pressure readings of Day-4

Page | 34
CHAPTER -7
7. PROPOSED WORK FOR THE MAJOR PROJECT: SMART MIRROR
The hardware and software of Weather Station has been successfully designed. This
Weather Station is capable of detecting and displaying the temperature, humidity and
pressure.

Moving on to the major project as we know that at present, more and more close to the
life of intelligent products are emerging, smart T.V, smart watches to now appear again
intelligent mirror. There are smart mirrors in 3D somatosensory fitting mirrors and hair
salons in foreign countries which are limited to use in public places. The main reason is
that cost is high, and the imaging effect is not good, and there is the phenomenon of
picture delay. We spend a lot of time from getting up to getting ready. In order to make
full use of this time, in the mirror at the same time, can effectively access the relevant
information of the day, this project designed a kind of SMART MIRROR can be used in
the home of things.

The SMART MIRROR is the principle of one-way perspective, the actual picture in the
form of specular reflection transmitted to our vision. The picture displayed behind the
mirror can also be transmitted to us through the mirror, so as to achieve the effect of
showing the pattern on the mirror

Compared with the method of collecting pictures by the camera used in the 3D
somatosensory fitting mirror, the picture is smoother and the cost is reduced. When a
SMART MIRROR gets opened, it is equivalent to an intelligent interactive center to help
people understand relevant information in a timely manner.

It is an IOT based project. The Internet of things is the network of physical devices,
home appliances and other items embedded with electronics, software, sensors, actuators,
and connectivity which enables these things to connect, collect and exchange data. The
Smart Mirror is made of raspberry pi as the host controller.

The Smart Mirror will be a Voice controlled mirror capable of displaying the features like
Weather, Clock, News widgets, etc. It will make things easier with its Youtube browsing
facility.

Page | 35
Figure 18: The SMART MIRROR

Page | 36
CONCLUSION
This IOT Weather Station thus tells us the current temperature, humidity and
air pressure to keep track of agricultural field weather conditions ranging to
industrial conditions monitoring. Weather Monitoring would help in keeping
track of different climatic behaviors including temperature, humidity and
atmospheric pressure. Weather Monitoring system can be either wired or
wireless one. Our Personal IOT based Weather Station helps in scheduling
our day to day activities.

Page | 37
REFERENCES
1) Adnan Shaout , Yulong Li, Mohan Zhou and SelimAwad “Low Cost Embedded Weather

Station with Intelligent System”,978-1-4799-5241-0114 / pp. no 100-106 IEEE 2014.

2) R. Lajara, J. Alberola, J. Pelegri, T. Sogorb, J.V. Llario, "Ultra Low Power Wireless

Weather Station," 2007 IEEE DOl1O.1109/SENSORCOMM.2007.61

3) M. Popa, Member IEEE, and C. lapa, “Embedded Weather Station with Remote Wireless

Control," 2011 IEEE, Serbia, Belgrade, November 22-24, 2011.

4) O. Krejcar, "Low Cost Weather Station with Remote Control," SAMI 2012 • 10th IEEE

Jubilee International Symposium on Applied Machine Intelligence and Informatics·

January 26- 28,2012· Herl'any, Slovakia.

5) A. Ghosh, A. Srivastava, A. Patidar, C.Sandeep, S. Prince, "SOLAR POWERED

WEATHER STATION AND RAIN DETECTOR" 2013 Texas Instruments India

Educators' Conference

6) Kang Wentao, Hong Zhihui, Shen Xin, Li Yingchun, Research and Implementation of

Smart Mirror based on ARM Chip. “Modern Computer, 2017, (6):54-58.

7) https://en.wikipedia.org/wiki/Weather_station

8) https://en.wikipedia.org/wiki/Temperature

9) https://en.wikipedia.org/wiki/Humidity

10) https://learn.sparkfun.com/tutorials/bmp180-barometric-pressure-sensor-hookup-/all

11) https://en.wikipedia.org/wiki/Raspberry_Pi

12) https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/

13) https://tutorials-raspberrypi.com/raspberry-pi-measure-humidity-temperature-dht11-

dht22/

Page | 38
14) https://howtomechatronics.com/tutorials/arduino/dht11-dht22-sensors-temperature-and-

humidity-tutorial-using-arduino/

15) https://www.electronicshub.org/raspberry-pi-dht11-humidity-temperature-sensor-

interface/

16) https://en.wikipedia.org/wiki/Python_(programming_language)

17) https://components101.com/sensors/bmp180-atmospheric-pressure-sensor

18) https://en.wikipedia.org/wiki/Virtual_Network_Computing

19) https://www.raspberrypi.org/blog/introducing-noobs

Page | 39

You might also like