Micro weather station
Deepmala Jayswal -teacher
Omkar Mangesh Jagtap
Yashraj more-9th
Yadnesh renukar-6th
Stages of Connection of LCDIdentify LCD Pins
First identify the 4 pins on I2C LCD:
Connect Power Supply
Connect GND of LCD → GND of Arduino
Connect VCC of LCD → 5V of Arduino
This gives power to the LCD.
Connect I2C Communication Pins
Connect SDA of LCD → A4 of Arduino
Connect SCL of LCD → A5 of Arduino
DHT22 Connection
VCC -5V
DATA -2
GND-GND
BMP280 connection
VCC. - 3.3V
GND. - GND
SDA. - A4
SCL. - A5
Connecting of Buzzer
buzzer has two pins:
Long pin → Positive (+)
Short pin → Negative (–)
Buzzer Pin. -Arduino UNO
Positive (+) -Digital Pin 8
Negative (–) -GND
Label 1 completed
Temprature, humidity,pressure completed
Coding
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#include <Adafruit_BMP085.h> // For BMP180
// -------- Pin Definitions --------
#define DHTPIN 2
#define DHTTYPE DHT11
#define LEDPIN 7
#define BUZZER 8
// -------- Object Creation --------
DHT dht(DHTPIN, DHTTYPE);
Adafruit_BMP085 bmp; // BMP180 object
LiquidCrystal_I2C lcd(0x27, 16, 2); // Change to 0x3F if needed
void setup() {
Serial.begin(9600);
pinMode(LEDPIN, OUTPUT);
pinMode(BUZZER, OUTPUT);
lcd.init();
lcd.backlight();
dht.begin();
// BMP180 start
if (!bmp.begin()) {
lcd.setCursor(0,0);
lcd.print("BMP180 Error!");
Serial.println("BMP180 not found!");
while (1);
}
lcd.setCursor(0,0);
lcd.print(“Weather Station”);
delay(2000);
lcd.clear();
}
void loop() {
float temperature = dht.readTemperature();
float humidity = dht.readHumidity();
float pressure = bmp.readPressure() / 100.0; // Convert to hPa
float altitude = bmp.readAltitude(); // Altitude in meters
// -------- Check DHT --------
if (isnan(temperature) || isnan(humidity)) {
lcd.setCursor(0,0);
lcd.print("DHT Error ");
Serial.println("DHT Failed!");
delay(2000);
return;
}
// -------- Serial Monitor --------
Serial.print("Temp: ");
Serial.print(temperature);
Serial.print(" C Hum: ");
Serial.print(humidity);
Serial.print(" % Pressure: ");
Serial.print(pressure);
Serial.print(" hPa Alt: ");
Serial.print(altitude);
Serial.println(" m");
// -------- LCD Display --------
lcd.setCursor(0,0);
lcd.print(“T:”);
lcd.print(temperature);
lcd.print("C ");
lcd.print(“H:”);
lcd.print(humidity);
lcd.print("% ");
lcd.setCursor(0,1);
lcd.print(“P:”);
lcd.print(pressure);
lcd.print("hPa ");
// -------- Alert System --------
if (temperature > 35) {
digitalWrite(LEDPIN, HIGH);
digitalWrite(BUZZER, HIGH);
} else {
digitalWrite(LEDPIN, LOW);
digitalWrite(BUZZER, LOW);
}
delay(2000);
}
Please add new content
Level 2Update
Table no-12JSTM Santpith Team
We would like to inform you that we have completed all the circuit connections for Level 2 of the Weather Station project. However, the coding part is still remaining due to network issues, and we were unable to download/upload the code to the ESP32.
We are working on resolving the issue and will complete the coding part as soon as possible.
