Skip to content

sduras/weatherbox

Repository files navigation

weatherbox

Weatherbox

MicroPython Pico 2W ntfy.sh License: Apache-2.0

A compact, always-on weather monitor built with MicroPython and the Raspberry Pi Pico 2W.


What It Does

  • Continuously monitors environmental conditions:

    • Outdoor temperature
    • Indoor temperature, humidity, and atmospheric pressure
  • Fetches daily weather forecasts

  • Displays real-time data on an OLED screen:

    • Automatically cycles through:
      • Indoor conditions
      • Tomorrow’s forecast
      • Current time (from RTC)
      • Agave font used for displaying info on screen.
  • Indicates weather changes visually:

    • An RGB LED reflects the severity of detected weather changes:

      • 🟢 Green – Normal
      • 🔵 Blue – Mild change
      • 🔴 Flashing Red – Severe weather alert
    • Color and blinking speed indicate severity level.

  • Sends notifications via ntfy.sh:

    • Sends real-time weather alerts
    • Posts a daily summary at a fixed time
  • Runs autonomously and reliably:

    • Refreshes readings and forecast data every few minutes
    • Uses a watchdog timer to recover from failures
    • Synchronizes the Real-Time Clock with NTP time servers

Hardware Used

Component Purpose
Raspberry Pi Pico 2W Main microcontroller with Wi-Fi
DS3231 RTC Module Keeps accurate time across reboots
DS18B20 (1-Wire) Measures outdoor temperature
BME280 (I2C) Measures indoor temperature, humidity, pressure
SH1106 OLED Display Displays data and weather forecast
HW-479 RGB LED Module Indicates alert severity (via color and blinking)
Wi-Fi For online forecasts and time sync

Wi-Fi credentials are read from a local credentials.txt file containing 2 lines: your SSID and password.


Wiring

Component Pico Pin(s) Notes
DS18B20 (1-Wire) GPIO15 Requires 4.7kΩ pull-up resistor on data line
BME280 (I2C) GPIO5 (SCL), GPIO4 (SDA) Indoor sensor (dedicated I2C bus)
OLED SH1106 GPIO16 (SCL), GPIO17 (SDA) Dedicated I2C bus for display
RTC (DS3231) GPIO19 (SCL), GPIO18 (SDA) Dedicated I2C bus for Real-Time Clock module
RGB LED (HW-479) GPIO0 (Red), GPIO1 (Green), GPIO2 (Blue) PWM pins; LED color/blinking reflects weather severity
Power Supply 3.3V / GND Ensure all components share a common ground

Licensed under the Apache License 2.0.

About

🌤️ Weather display & notification system

Topics

Resources

License

Stars

Watchers

Forks

Languages