Raspberry Pi weather station with BME280 and SQLite history
Indoor or sheltered outdoor temp, humidity and pressure on Pi 4/5: I2C wiring, Python logger, daily min/max and CSV export.
AI-generated illustration
Indoor or sheltered outdoor temp, humidity and pressure on Pi 4/5: I2C wiring, Python logger, daily min/max and CSV export.
Also available in French.
The BME280 reports temperature, humidity and barometric pressure. With a Raspberry Pi you log every five minutes to SQLite, print daily summaries and export CSV—falling pressure often hints at worsening weather locally.
~/meteo.db.--resume for 7-day min/max/mean.--csv for spreadsheets.Pi 4/5, Bookworm. BME280 I2C module (not BMP280—no humidity): UK · US.
| BME280 | Pi |
|---|---|
| VCC | 3V3 (pin 1) |
| GND | GND (pin 6) |
| SDA | pin 3 |
| SCL | pin 5 |
i2cdetect -y 1 → 0x76 or 0x77.
pip install adafruit-circuitpython-bme280
Script: meteo_bme280_sqlite.py.
ALTITUDE_M=150 python meteo_bme280_sqlite.py
python meteo_bme280_sqlite.py --resume
python meteo_bme280_sqlite.py --csv > meteo.csv
ALTITUDE_M converts station pressure to sea-level equivalent for comparison with forecasts.
station-meteo.service with Environment=ALTITUDE_M= and BME280_ADDR= if needed.
sqlite3 ~/meteo.db "SELECT ROUND((SELECT pression FROM mesures ORDER BY ts DESC LIMIT 1) - (SELECT pression FROM mesures WHERE ts <= strftime('%Y-%m-%dT%H:%M:%S', 'now', '-3 hours') ORDER BY ts DESC LIMIT 1), 1);"
Negative → falling pressure locally; interpret as a hint, not a forecast.
ESP alternative: ESPHome BME280. CO₂ sibling project: SCD41 MQTT.
Torn between two models or stuck on a build? Drop us a line and we will get back to you by email.