A Skill-Oriented Course-1 Report Submitted in Partial Fulfillment of The Requirements For The Award of The Degree of
A Skill-Oriented Course-1 Report Submitted in Partial Fulfillment of The Requirements For The Award of The Degree of
A Skill-Oriented Course-1 Report Submitted in Partial Fulfillment of The Requirements For The Award of The Degree of
in
(Internet of Things)
Submitted by
(Autonomous)
2024
(Autonomous)
Nambur (V), Pedakakani (M), Guntur (Dt.), Andhra Pradesh – 522 508
CERTIFICATE
This is to certify that the research project report entitled “RASPBERRY PI
WEATHER STATION” is being submitted by M.DURGA NAGARJUNA REDDY
(Regd.No: 22BQ1A4932 in partial fulfillment of the requirement for the award of the degree
of the Bachelor of Technology in Computer Science and Engineering (Internet of
Things) to the Vasireddy Venkatadri Institute of Technology is a record of bonafide work
carried out by him/her under our supervision.
The results embodied in this project have not been submitted to any other university
or institute for the award of any degree or diploma.
I hereby declare that the work embodied in this research project entitled
“RASPBERRY PI WEATHER STATION”, which is being submitted by me in
requirement for the B. Tech Degree in Computer Science and Engineering (Internet of
Things) from Vasireddy Venkatadri Institute of Technology, is the result of investigations
carried out by me.
The work is original and the results in this thesis have not been submitted elsewhere
for the award of any degree or diploma.
(Regd.No: 22BQ1A4932)
➢ To mould the fresh minds into highly competent IoT application developers by
enhancing their knowledge and skills in diverse hardware and software design aspects
for covering technologies and multi-disciplinary engineering practices.
➢ To provide the sate- of- the art facilities to forge the students in industry-ready in IoT
system development.
➢ To nurture the sense of creativity and innovation to adopt the socio-economic related
activities.
➢ To promote collaboration with the institutes of national and international repute with a
view to have best careers.
➢ To enable graduates to emerge as independent entrepreneurs and future leaders.
PSO-1: Proficient and innovative with a strong cognizance in the arenas of sensors, IoT,
data science, controllers and signal processing through the application of acquired
knowledge and skills.
PSO-2: Apply cutting-edge techniques and tools of sensing and computation to solve multi-
disciplinary challenges in industry and society.
PSO-3: Exhibit independent and collaborative research with strategic planning while
demonstrating professional and ethical responsibilities of the engineering profession.
CONTENTS
Page No
LIST OF TABLES viii
LIST OF FIGURES viii
CHAPTER-1 INTRODUCTION 01
1.1 OVERVIEW 01
1.2 LITERATURE REVIEW 01
1.3 OBJECTIVES 02
1.4 APPLICATIONS 02
CHAPTER-2 PROJECT DESCRIPTION 04
INTRODUCTION ABOUT DHT-11,BM - 180
2.1 04
SENSORS
2.2 SPECIFICATIONS IN DHT-11 SENSOR 04
2.3 SPECIFICATIONS IN BM-180 SENSOR 05
2.4 COMPONENTS USED 05
2.5 CIRCUIT DIAGRAM 08
2.6 CONNECTIONS 09
2.7 WORKING AND THINGSPEAK SETUP 09
CHAPTER-3 RASPBERRY PI PROGRAMMING 11
LIST OF TABLES
Table.No Description Page No
1.1 COMPONENTS REQUIRED 03
LIST OF FIGURES
Fig. No Description Page No
2.4.1 DHT-11 SENSOR 05
2.4.2 BM-180 SENSOR 06
2.4.3 RASPBERRY PI MODEL 4B 06
2.4.4 JUMPER WIRES 07
2.4.5 LDR MODULE 07
2.4.6 LCD 08
2.5.1 CIRCUIT DIAGRAM 08
2.7.1 WORKING AND THINGSPEAK 10
4.1.1 MONITORING OVER THINGSPEAK 20
4.1.2 RESULTANT OUTPUT 20
CHAPTER-1
INTRODUCTION
1.1 OVERVIEW
Humidity, Temperature and Pressure are three basic parameters to build any Weather
Station and to measure environmental conditions. This IOT Project aims to show
the current Humidity, Temperature and Pressure parameters on the LCD as well on
the Internet server using Raspberry Pi, which makes it a Raspberry Pi Weather
Station. You can install this setup anywhere and can monitor the weather conditions of
that place from anywhere in the world over the internet, it will not only show the current
data but can also show the past values in the form of Graphs.
We have used DHT11 Humidity & temperature sensor for sensing the temperature
and BM180 Pressure sensor module for measuring barometric pressure. This Celsius scale
Thermometer and percentage scale Humidity meter displays the ambient temperature and
humidity through a LCD display and barometric pressure is displayed in millibar or hPa
(hectopascal). All this data is sent to THINGSPEAK server for live monitoring from
anywhere in the world over internet.
This IoT based project has four sections. Firstly DHT11 sensor senses the Humidity &
Temperature Data and BM180 sensor measures the atmospheric pressure. Secondly
Raspberry Pi reads the DHT11 sensor module’s output by using single wire protocol and
BM180 pressure sensor’s output by using I2C protocol and extracts both sensors values into
a suitable number in percentage (humidity), Celsius scale (temperature), hectoPascal or
millibar (pressure). Thirdly, these values are sent to ThingSpeak server by using inbuilt Wi-
Fi of Raspberry Pi 3. And finally Thingspeak analyses the data and shows it in a Graph
form. A LCD is also used to display these values locally.
A literature review of Raspberry Pi weather stations using DHT11 and BMP180 sensors
reveals that this combination offers an accessible and affordable approach to monitoring
local weather conditions. The DHT11 sensor is widely used for measuring temperature and
humidity due to its simplicity and low cost, while the BMP180 sensor provides precise
measurements of atmospheric pressure and temperature. Literature highlights the ease of
1
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
integrating these sensors with the Raspberry Pi using libraries like Adafruit_DHT
andAdafruit_BMP, enabling data collection and processing in Python. Despite challenges
such as moderate accuracy and calibration issues, as well as the need for protective housing,
these projects serve as practical, foundational tools for personal weather monitoring,
educational purposes, and small-scale research. Future work may focus on enhancing data
accuracy and leveraging advanced analytics techniques for deeper insights.
1.3 OBJECTIVES
1.4 APPLICATIONS
local weather conditions, helping them make informed decisions about irrigation,
planting, and harvesting.
The components required for developing this system are tabulated in Table.1.1
3
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
CHAPTER – 2
PROJECT DESCRIPTION
The DHT11 and BMP180 sensors are essential components in weather station projects
due to their ability to measure key weather parameters. The DHT11 sensor is a low-
cost, digital sensor that measures both temperature and humidity, providing data in a
digital format for easy integration with the Raspberry Pi. Although it offers moderate
accuracy and slower response times compared to more advanced sensors, its simplicity
and affordability make it a popular choice for hobbyist projects and educational
purposes. The BMP180 sensor, on the other hand, is known for its precision in
measuring atmospheric pressure and temperature. It uses the I2C protocol for
communication, making it straightforward to connect to the Raspberry Pi. The
BMP180's high accuracy, small size, and low power consumption make it suitable for
a range of applications, including altimeters and wearables. Both sensors enable
effective weather monitoring and data analysis when combined with the Raspberry Pi.
Temperature Measurement:
Accuracy: ±2°C
Resolution: 1°C
Humidity Measurement:
Range: 20% to 90% relative humidity (RH)
Accuracy: ±5% RH
Resolution: 1% RH
Output Data:
Type: Digital
Power Supply:
Voltage: 3.3V to 5V
Operating Modes:
The BMP180 has multiple operating modes, providing different trade-offs between power
consumption, speed, and accuracy:
Ultra-Low Power Mode: Lowest power consumption with less accuracy and speed
Ultra-High Resolution Mode: Highest accuracy and resolution at the cost of more power
consumption and slower spee
2.4 COMPONENTS USED:
The DHT11 sensor is a digital sensor widely used for measuring temperature and humidity
in weather monitoring projects. It offers a cost-effective and straightforward solution,
making it a popular choice among hobbyists and educators.
5
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
BM-180 SENSOR:
RASPBERRY PI :
JUMPER WIRES:-
A jump wire (also known as jumper, jumper wire, DuPont wire) is an electrical
wire, or group of them in a cable, with a connector or pin at each end (or sometimes
without themsimply "tinned"), which is normally used to interconnect the components
of a breadboardor other prototype or test circuit, internally or with other equipment or
components, without soldering.[1] Individual jump wires are fitted by inserting their
"end connectors" into theslots provided in a breadboard, the header connector of a
circuit board, or a piece of test equipment.
LDR:
LDR (Light Dependent Resistor) as the name states is a special type of resistor
that works on the photoconductivity principle means that resistance changes according to
the intensity of light. Its resistance decreases with an increase in the intensity of light.
It is often used as a light sensor, light meter, Automatic street light, and in areas
where we need to have light sensitivity. LDR is also known as a Light Sensor. LDR are
usually available in 5mm, 8mm, 12mm, and 25mm dimensions.
7
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
LCD:-
Liquid Crystal Displays (LCDs) are a popular type of display technology that uses liquid
crystal materials to produce images or text.They are widely used in various applications,
including digital clocks, televisions, computer monitors, smartphones, and other electronic
devices.
8
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
2.6 CONNECTIONS:
For a Raspberry Pi weather station project using a DHT11 sensor, a BMP180 sensor, an
LCD display, and a 10k potentiometer, follow these brief connection points:
DHT11 Sensor:
Connect the data out pin to a GPIO pin on the Raspberry Pi (e.g., GPIO4).
Connect the GND pin to a GND pin on the Raspberry Pi.
BMP180 Sensor:
Connect the SDA pin to the SDA (GPIO2) pin on the Raspberry Pi. Connect
the SCL pin to the SCL (GPIO3) pin on the Raspberry Pi. Connect the GND
pin to a GND pin on the Raspberry Pi.
LCD Display:
10k Potentiometer:
Connect the wiper (middle pin) to the contrast control pin on the LCD.
Connect one outer pin to 5V and the other outer pin to GND for voltage control.
This IoT based project has four sections. Firstly DHT11 sensor senses the Humidity &
Temperature Data and BM180 sensor measures the atmospheric pressure. Secondly
Raspberry Pi reads the DHT11 sensor module’s output by using single wire protocol and
BM180 pressure sensor’s output by using I2C protocol and extracts both sensors values into
a suitable number in percentage (humidity), Celsius scale (temperature), hectoPascal or
millibar (pressure). Thirdly, these values are sent to ThingSpeak server by using inbuilt Wi-
Fi of Raspberry Pi 3. And finally ThingSpeak analyses the data and shows it in a Graph
form. A LCD is also used to display these values locally.
9
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
10
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
CHAPTER-3
RASPBERRY PI PROGRAMMING
To work with the DHT11 and BMP180 sensors in a Raspberry Pi weather station project,
you need to install specific Python libraries to interface with the sensors. Here are the
libraries you should install:
11
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
import Adafruit_DHT
import adafruit_bmp280
import sys
import os
import Adafruit_DHT
import urllib2
import smbus
import time
#Register Address
regCall = 0xAA
regMean = 0xF4
regMSB = 0xF6
regLSB = 0xF7
regPres = 0x34
DEBUG = 1
12
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
sample = 2
deviceAdd =0x77
humi=""
temp=""
DHTpin = 17
GPIO.setmode(GPIO.BCM)
LCD_RS = 18
LCD_EN = 23
LCD_D4 = 24
LCD_D5 = 16
LCD_D6 = 20
LCD_D7 = 21
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(LCD_E, GPIO.OUT)
GPIO.setup(LCD_RS, GPIO.OUT)
GPIO.setup(LCD_D4, GPIO.OUT)
GPIO.setup(LCD_D5, GPIO.OUT)
GPIO.setup(LCD_D6, GPIO.OUT)
GPIO.setup(LCD_D7, GPIO.OUT)
13
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
def readBmp180(addr=deviceAdd):
AC1 = convert1(value, 0)
AC2 = convert1(value, 2)
AC3 = convert1(value, 4)
AC4 = convert2(value, 6)
AC5 = convert2(value, 8)
AC6 = convert2(value, 10
B1 = convert1(value, 12)
B2 = convert1(value, 14)
MB = convert1(value, 16)
MC = convert1(value, 18)
MD = convert1(value, 20)
# Read pressure
(msb, lsb, xsb) = bus.read_i2c_block_data(addr, regMSB, 3) P1 = ((msb << 16) + (lsb << 8) +
xsb) >> (8 - sample)
# Refine temperature
B5 = X1 + X2
14
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
B62 = B6 * B6 >> 12
X2 = AC2 * B6 >> 11
X3 = X1 + X2
X1 = AC3 * B6 >> 13
P = (B7 * 2) / B4
X1 = (P >> 8) * (P >> 8)
X2 = (-7357 * P) >> 16
return (str(pressure/100.0))
def readDHT():
def lcd_init():
lcdcmd(0x33)
lcdcmd(0x32)
lcdcmd(0x06)
lcdcmd(0x0C)
15
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
lcdcmd(0x28)
lcdcmd(0x01)
time.sleep(0.0005)
def lcdcmd(ch):
GPIO.output(RS, 0)
GPIO.output(D4, 0)
GPIO.output(D5, 0)
GPIO.output(D6, 0)
GPIO.output(D7, 0)
if ch&0x10==0x10:
GPIO.output(D4, 1)
if ch&0x20==0x20:
GPIO.output(D5, 1)
if ch&0x40==0x40:
GPIO.output(D6, 1)
if ch&0x80==0x80:
GPIO.output(D7, 1)
GPIO.output(EN, 1)
time.sleep(0.0005)
GPIO.output(EN, 0)
# Low bits
GPIO.output(D4, 0)
GPIO.output(D5, 0)
GPIO.output(D6, 0)
GPIO.output(D7, 0)
if ch&0x01==0x01:
16
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
GPIO.output(LCD_D4, 1)
if ch&0x02==0x02:
GPIO.output(LCD_D5, 1)
if ch&0x04==0x04:
GPIO.output(LCD_D6, 1)
if ch&0x08==0x08:
GPIO.output(LCD_D7, 1)
GPIO.output(EN, 1)
time.sleep(0.0005)
GPIO.output(EN, 0)
def lcddata(ch):
GPIO.output(RS, 1)
GPIO.output(D4, 0)
GPIO.output(D5, 0)
GPIO.output(D6, 0)
GPIO.output(D7, 0)
if ch&0x10==0x10:
GPIO.output(D4, 1)
if ch&0x20==0x20:
GPIO.output(D5, 1)
if ch&0x40==0x40:
GPIO.output(D6, 1)
if ch&0x80==0x80:
GPIO.output(D7, 1)
GPIO.output(EN, 1)
time.sleep(0.0005)
17
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
GPIO.output(EN, 0)
# Low bits
GPIO.output(D4, 0)
GPIO.output(D5, 0)
GPIO.output(D6, 0)
GPIO.output(D7, 0)
if ch&0x01==0x01:
GPIO.output(LCD_D4, 1)
if ch&0x02==0x02:
GPIO.output(LCD_D5, 1)
if ch&0x04==0x04:
GPIO.output(LCD_D6, 1)
if ch&0x08==0x08:
GPIO.output(LCD_D7, 1)
GPIO.output(EN, 1)
time.sleep(0.0005)
GPIO.output(EN, 0)
def lcdstring(Str):
l=0;
l=len(Str)
for i in range(l):
lcddata(ord(message[i]))
lcd_init()
lcdcmd(0x01)
("Circuit Digest")
lcdcmd(0xc0)
18
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
lcdstring("Welcomes you")
# main() function
def main():
while True:
(pressure) =readBmp180()
19
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
CHAPTER-4
4.1 OUTPUT:-
The output of the developed prototype model can be verified on the Thingspeak server. The
fig shown in Fig.4.1, displays the temperature,humidity,pressure measured by the sensors
DHT-11,BM-180.
20
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
In a Raspberry Pi weather station project using DHT11 and BMP180 sensors, along with an
LCD display and a 10k potentiometer, a comparative analysis highlights the different
capabilities of the sensors and their impact on the overall system. The DHT11 sensor offers
a cost-effective and straightforward solution for measuring temperature and humidity,
though it provides moderate accuracy and slower response times compared to advanced
sensors. On the other hand, the BMP180 sensor excels in measuring barometric pressure and
temperature with high precision and versatile operating modes. While the DHT11 is budget-
friendly, the BMP180's slightly higher cost is justified by its superior performance and data
quality. The combination of these sensors allows for comprehensive environmental
monitoring, and the Raspberry Pi's compatibility with the required libraries facilitates easy
data processing and display on the LCD. Overall, the project is versatile and suitable for
various applications such as weather monitoring and educational projects, with potential for
future enhancements in sensor accuracy and additional functionality.
In this Raspberry Pi weather station project, the aim is to build a system capable of
monitoring environmental conditions using various sensors and displaying the data on an
LCD. The project uses a DHT11 sensor for measuring temperature and humidity and a
BMP180 sensor for barometric pressure and temperature readings. These sensors offer
different levels of precision, with the BMP180 providing higher accuracy and faster
response times compared to the DHT11. The LCD display, controlled by a 10k
potentiometer for contrast, allows for real-time visualization of the collected data.
The project is built around a Raspberry Pi, which serves as the main control unit for data
collection, processing, and display. The Raspberry Pi's compatibility with the necessary
libraries (Adafruit_DHT and adafruit-circuitpython-bmp280) simplifies the integration of
the sensors. The overall setup provides a comprehensive analysis of environmental factors
such as temperature, humidity, and atmospheric pressure, making it suitable for various
applications, including weather monitoring, data logging, and educational purposes
21
Department of Computer Science & Technology(IOT)
RASPBERRY PI WEATHER STATION
REFERENCES
https://chat.openai.com/c/664697b8-27d0-4c70-9dfb-febd59c32b30
https://circuitdigest.com/microcontroller-projects/raspberry-pi-iot-weather-station-to-
monitor-temperature-humidity-pressure
https://www.researchgate.net/publication/332676356_Iot_Based_Weather_Station_Usin
g_Raspberry_Pi_3
References
Kodali R & Mandal S, “IoT based weather station”, 2016 Interna- tional
Conference on Control, Instrumentation, Communication and
Computational Technologies (ICCICCT), Kumaracoil, India, pp.
680-683, (2016).
22
Department of Computer Science & Technology(IOT)