A.Y.2019-20
I Semester
III/IV B. Tech
Skilling(IOT)
MINI WEATHER STATION USING ARDUINO AND LCD
GROUP NO-14
Mini project by
1 K.BHARGAVI 170040390
1
BONAFIDE CERTIFICATE
Signature of HOD
Place:
Date:
2
ACKNOWLEDGMENT
I take privilege to express my gratitude to our Guide sri P.KANAKARAJA sir for his
enthusiastic co-operation, valuable suggestions and in time helps in doing the
main project.
3
TABLE OF CONTENTS
1. Abstract 5
2. Introduction 6-7
4. Components required 11
6. Working 15-17
8. References 19
4
ABSTRACT
The generation of Arduino based mini-weather station with Wi-Fi connection. The
weather station
collects the following data related to the weather and environment using
different sensors:
(1) Temperature
(2) Humidity
The aim is to make a small and simple weather station, using open hardware.
5
INTRODUCTION
(ii) stores data collected at some pre-determined sampling interval, with date and
time stamps,for later retrieval
(iv) introduces the use of packet radio modules for sending weather station data
from one Arduino to another
Even if you are used to working with Arduinos, using them for stand-alone
outdoor applications poses some additional challenges. I rewrote this document
several times as I learned more about converting applications that are easy to
implement in a familiar indoor breadboard/Arduino UNO environment to systems
that minimize power requirements for reliable and sustainable outdoor
applications. This is by no means the only available source of information about
Arduino-based weather stations. But, many of the sources I have looked at are
short on details, and it is often the smallest details that can facilitate or derail such
a project. The first step is to define the equipment needed to meet the project goals.
6
The weather is one such possible factor. In this project we build an Arduino based
device for measurements of ambient air temperature, pressure and humidity. The
weather can be defined merely as the state of the atmosphere. Numerous factors
can influence the weather conditions or the atmosphere. It is almost impossible
to predict the weather conditions, but with technology, it has been made
possible. Weather stations have been specially designed for this purpose. As the
state of the atmosphere is directly related to the air temperature and pressure,
knowing the air temperature as well as strength can give us powerful insight
about the weather around us.
We all know that a weather station is not a single device, but it is a collection of
many small tools to form a larger unit. It consists of various sensors and gadgets
that work together but in specific ways to transmit proper and accurate data of
the weather variables. It is not easy for ordinary people to understand the central
working principle of these units.
So that you can be more familiar with the device, it is quite vital for you to know
the various equipment of a weather station and also the way they work. We have
tried our best to explain to you this mechanism less straightforwardly and
technically.
7
BLOCK DIAGRAM:
8
CIRCUIT DIAGRAM:
(i)Arduino interfacing with sensors:
9
(ii)arduino and lcd interfacing:
10
COMPONENTS REQUIRED:
Arduino
DHT22 sensor
BMP180 sensor
16x2 LCD
Resistors(1k,10k,4.75k)
Light sensor
4x2 PCB
Transformer
Power supply
11
COMPONENTS EXPLANATION
DHT11 Sensor:
The circuit connection from sensor to arduino is very simple. The output of the
sensor is connected to A1 pin of arduino. The supply Vcc and GND are connected
to power supply pins of arduino.
BMP180 sensor:
12
16X2 LCD :
LCD (Liquid Crystal Display) screen is an
electronic display module and find a wide range of applications. A 16x2 LCD
display is very basic module and is very commonly used in various devices and
circuits. ... A 16x2 LCD means it can display 16 characters per line and there are 2
Arduino:
Arduino is an open-source hardware and software company, project and user
community that designs and manufactures single-board microcontrollers
and microcontroller kits for building digital devices. Its products are licensed
under the GNU Lesser General Public License (LGPL) or the GNU General Public
License (GPL), permitting the manufacture of Arduino boards and software
distribution by anyone. Arduino boards are available commercially in
preassembled form or as do-it-yourself (DIY) kits.
Arduino board designs use a variety of microprocessors and controllers. The
boards are equipped with sets of digital and analog input/output (I/O) pins that may
be interfaced to various expansion boards or breadboards (shields) and other
circuits. The boards feature serial communications interfaces, including Universal
Serial Bus (USB) on some models, which are also used for loading programs from
personal computers. The microcontrollers can be programmed using C and C++
programming languages. In addition to using traditional compiler toolchains, the
13
Arduino project provides an integrated development environment (IDE) based on
the Processing language project.
14
WORKING :
To interface a LCD to the ARDUINO UNO, we need to know a few things.
1. #include <LiquidCrystal.h>
2. lcd.begin(16, 2);
3. LiquidCrystal lcd(0, 1, 8, 9, 10, 11);
4. lcd.print("hello, world!");
As by the above table we only need to look at these four lines for establishing a
communication between an ARDUINO and LCD.
First we need to enable the header file (‘#include <LiquidCrystal.h>’), this header
file has instructions written in it, which enables the user to interface an LCD to
UNO in 4 bit mode without any fuzz. With this header file we need not have to
send data to LCD bit by bit, this will all be taken care of and we don’t have to
write a program for sending data or a command to LCD bit by bit.
Second we need to tell the board which type of LCD we are using here. Since we
have so many different types of LCD (like 20x4, 16x2, 16x1 etc.). Here we are
going to interface a 16x2 LCD to the UNO so we get ‘lcd.begin(16, 2);’. For 16x1
we get ‘lcd.begin(16, 1);’.
In this instruction we are going to tell the board where we connected the pins. The
pins which are connected need to be represented in order as “RS, En, D4, D5, D6,
D7”. These pins are to be represented correctly. Since we have connected RS to
PIN0 and so on as show in the circuit diagram, we represent the pin number to
board as “LiquidCrystal lcd(0, 1, 8, 9, 10, 11);”. The data which needs to be
displayed in LCD should be written as “ cd.print("hello, world!");”. With this
command the LCD displays ‘hello, world!’.
As you can see we need not to worry about any thing else, we just have to initialize
and the UNO will be ready to display data. We don’t have to write a program loop
to send the data BYTE by BYTE here.
The way of communication between LCD and UNO is explained step by step in C
code given below:
15
CODE:
#include <dht.h>
#include <stdlib.h>
#include <SoftwareSerial.h>
#include <DHT.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP085_U.h>
#define DHT22_PIN 2
dht DHT;
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);
}
void loop(){
char buffer[10];
//light sensor
float luminance = analogRead(luminancePin);
//temperature and humidity
int chk = DHT.read22(DHT22_PIN);
float humidity = DHT.humidity;
float temperature = DHT.temperature;
//pressure and temperature1
16
sensors_event_t event;
bmp.getEvent(&event);
float pressure = 0;
float temperature1 = 0;
if (event.pressure)
{
pressure = event.pressure;
bmp.getTemperature(&temperature1);
}
lcd.print(" Light:");//print name
lcd.print(luminance);//print name
lcd.print(" ");//print name
lcd.print("Temp:");//print name
lcd.print(temperature);
lcd.print(" ");
lcd.print("Humidity:");
lcd.print(humidity);
lcd.print(" ");
lcd.setCursor(0, 1); // set the cursor to column 0, line 2
lcd.print("Pressure:");//print name
lcd.print(pressure);//print name
lcd.print(" ");//print name
lcd.print("Temp1:");//print name
lcd.print(temperature1);
lcd.print(" ");
delay(700);//delay of 0.75sec
lcd.scrollDisplayLeft();//shifting data on LCD
lcd.setCursor(0, 0);// set the cursor to column 0, line11
Serial.println("Light Sensor");
Serial.println(luminance);
Serial.println("Humidity Sensor");
Serial.println(humidity);
Serial.println("Temperature Sensor");
Serial.println(temperature);
Serial.println("Pressure Sensor");
Serial.println(pressure);
Serial.println("Temperature1 Sensor");
Serial.println(temperature1);
// delay(5000);
}
17
OUTPUTS AND RESULTS:
The parameters like temperature, pressure, humidity, light intensity are
displayed in LCD as below:
18
REFERNCES:
1. https://create.arduino.cc/projecthub/igorF2/arduino-uno-mini-weather-station-
31b555?ref=tag&ref_id=iot&offset=9
2. https://circuitdigest.com/microcontroller-projects/arduino-lcd-interfacing-tutorial
19