ESP32 আবহাওয়া স্টেশন (BME280 + OLED)Arduino Weather Station with ESP32 & BME280
BME280 তাপমাত্রা, আর্দ্রতা আর বায়ুচাপ মাপে (GPIO21 = SDA, GPIO22 = SCL)। এক-দুই ঘণ্টায় বায়ুচাপ নামলে সাধারণত বৃষ্টি আসে — OLED তে তিনটাই দেখা যায়।
The BME280 measures temperature, humidity and air pressure over I2C (GPIO21 = SDA, GPIO22 = SCL). Pressure that drops over an hour or two usually means rain is on the way — the OLED shows all three live.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × ESP32 DevKit V1 ESP32 DevKit V1
- 1 × Weather sensor BME280 আবহাওয়া সেন্সর BME280
- 1 × OLED display 0.96" (SSD1306) OLED ডিসপ্লে ০.৯৬" (SSD1306)
- 8 × Jumper wires জাম্পার তার
সব part একসাথে · All parts in one box: weather station kit bme280 esp32
তার লাগানো · Wiring
| Weather sensor BME280 VCC | → | ESP32 DevKit V1 3V3 |
| Weather sensor BME280 GND | → | ESP32 DevKit V1 GND |
| Weather sensor BME280 SDA | → | ESP32 DevKit V1 D21 |
| Weather sensor BME280 SCL | → | ESP32 DevKit V1 D22 |
| OLED display 0.96" (SSD1306) VCC | → | ESP32 DevKit V1 3V3 |
| OLED display 0.96" (SSD1306) GND | → | ESP32 DevKit V1 GND |
| OLED display 0.96" (SSD1306) SDA | → | ESP32 DevKit V1 D21 |
| OLED display 0.96" (SSD1306) SCL | → | ESP32 DevKit V1 D22 |
Code (Arduino C++)
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
// Weather station on an ESP32: the BME280 measures temperature, humidity and air
// pressure on I2C (GPIO21 = SDA, GPIO22 = SCL). Pressure dropping over an hour
// usually means rain is coming — that is how the OLED can "forecast".
Adafruit_BME280 bme;
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void setup() {
Serial.begin(115200);
if (!bme.begin(0x76)) { Serial.println("BME280 not found"); while (1) delay(10); }
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);
}
void loop() {
float t = bme.readTemperature();
float h = bme.readHumidity();
float p = bme.readPressure() / 100.0F;
Serial.print("Temp: "); Serial.print(t); Serial.print(" C Hum: "); Serial.print(h);
Serial.print(" % Pressure: "); Serial.print(p); Serial.println(" hPa");
display.clearDisplay();
display.setCursor(0, 0); display.print("Temp: "); display.print(t); display.println(" C");
display.setCursor(0, 16); display.print("Hum: "); display.print(h); display.println(" %");
display.setCursor(0, 32); display.print("Pres: "); display.print(p); display.println(" hPa");
display.display();
delay(2000);
}
আরো project · More projects
- হোম অটোমেশন: ব্লুটুথে ৪টা বাতি (রিলে মডিউল)Home automation: 4 lamps over Bluetooth (relay module)
- IR রিমোট কন্ট্রোল (VS1838B রিসিভার)IR remote control (VS1838B receiver)
- GPS ট্র্যাকার: NEO-6M + SIM800L দিয়ে SMS এ লোকেশনGPS tracker: NEO-6M + SIM800L sends coordinates by SMS
- DS3231 RTC ঘড়ি (বিদ্যুৎ না থাকলেও সময় মনে রাখে)Digital clock with a DS3231 RTC (keeps time without power)