Objective:
To design and develop a smart weather station using Arduino that measures temperature, humidity, pressure, and altitude, and predicts weather conditions using pressure trend analysis.
TEAM DETAILS:
HALEEMA KHAN { Teacher }
Priyanshi katore { student }
Parth Bhaskar { Student }
Components Used:
Arduino UNO
DHT22 Temperature & Humidity Sensor
BMP085 Pressure Sensor
16x2 I2C LCD Display
LED
Buzzer
Breadboard
Jumper Wires
Working Principle:
The system reads:
Temperature and Humidity from DHT22
Atmospheric Pressure and Altitude from BMP085Objective:
To design and develop a smart weather station using Arduino that measures temperature, humidity, pressure, and altitude, and predicts weather conditions using pressure trend analysis.
Every 30 seconds, the system compares the current pressure with the previous pressure to detect weather changes.
If pressure:
Increases → Weather improving
Decreases slightly → Rain likely
Decreases sharply → Storm risk
The prediction is displayed on the LCD.
If storm or rain is predicted:
LED turns ON
Buzzer activates as alert
Output Features:
Real-time Temperature Display
Real-time Humidity Display
Pressure in hPa
Altitude in meters
Weather Prediction
Audio-Visual Alert System
Find the codes for the project below :
#include <Wire.h>
#include <Adafruit_BMP085.h>
#include <DHT.h>
#include <LiquidCrystal_I2C.h>
// ====== PIN DEFINITIONS ======
#define DHTPIN 2
#define DHTTYPE DHT11
#define LEDPIN 8
#define BUZZERPIN 9
// ====== OBJECTS ======
Adafruit_BMP085 bmp;
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(0x27, 16, 2);
// ====== VARIABLES ======
float temperature;
float humidity;
float currentPressure = 0;
float lastPressure = 0;
float pressureDifference = 0;
float altitude;
String weatherPrediction = "Initializing";
unsigned long lastCheckTime = 0;
const long interval = 30000; // 30 seconds
void setup() {
Serial.begin(9600);
pinMode(LEDPIN, OUTPUT);
pinMode(BUZZERPIN, OUTPUT);
digitalWrite(LEDPIN, LOW);
digitalWrite(BUZZERPIN, LOW);
dht.begin();
bmp.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print(" SkySense v1.0 ");
lcd.setCursor(0,1);
lcd.print(" Weather Station ");
delay(3000);
lcd.clear();
lastPressure = bmp.readPressure() / 100.0;
}
void loop() {
// ====== READ SENSORS ======
temperature = dht.readTemperature();
humidity = dht.readHumidity();
currentPressure = bmp.readPressure() / 100.0;
altitude = bmp.readAltitude();
// ====== SMART WEATHER PREDICTION ======
if (millis() - lastCheckTime >= interval) {
pressureDifference = currentPressure - lastPressure;
if (pressureDifference > 2.0)
weatherPrediction = "Very Clear";
else if (pressureDifference > 0.5)
weatherPrediction = "Improving";
else if (pressureDifference < -2.0)
weatherPrediction = "Storm Risk!";
else if (pressureDifference < -0.5)
weatherPrediction = "Rain Likely";
else
weatherPrediction = "Stable";
lastPressure = currentPressure;
lastCheckTime = millis();
}
// ====== ALERT SYSTEM ======
if (weatherPrediction == "Storm Risk!" || weatherPrediction == "Rain Likely") {
digitalWrite(LEDPIN, HIGH);
digitalWrite(BUZZERPIN, HIGH);
} else {
digitalWrite(LEDPIN, LOW);
digitalWrite(BUZZERPIN, LOW);
}
// ====== DISPLAY SCREEN 1 ======
lcd.setCursor(0,0);
lcd.print("T:");
lcd.print(temperature,1);
lcd.print("C H:");
lcd.print(humidity,0);
lcd.print("% ");
lcd.setCursor(0,1);
lcd.print("P:");
lcd.print(currentPressure,0);
lcd.print("hPa");
delay(3000);
lcd.clear();
// ====== DISPLAY SCREEN 2 ======
lcd.setCursor(0,0);
lcd.print("Alt:");
lcd.print(altitude,0);
lcd.print(" m");
lcd.setCursor(0,1);
lcd.print(weatherPrediction);
delay(3000);
lcd.clear();
}
