Raspberry Pi Weather Station Features Wireless Sensor Nodes

Online weather services are great for providing generic area forecasts, but they don’t provide hyperlocal data specific to your location. [Harald Kreuzer] needed both and built a Raspberry Pi Weather Station that provides weather forecasts for the next 7 days as well as readings from local sensors. The project is completely open source and based on a Raspberry Pi base station which connects to ESP32 based sensor nodes and online services to nicely present the data on a 7″ touch screen display.

The architecture is quite straightforward. The ESP32 based sensor nodes publish their readings to an MQTT broker running on the Raspberry Pi. The Pi subscribes to these sensor node topics to pick up the relevant sensor data. This makes it easy to add additional sensor nodes in future. Weather forecast data is collected by connecting to the OpenWeatherMap API. All of the collected information is then displayed through an app built using the Kivy: open source Python app development framework.

The base station hardware is simple and housed in an elegant 3D printed enclosure supported on a 3D printed base support. The remote sensor node electronics are a little bit more involved. [Harald]’s design uses a simple custom PCB which is basically a carrier board for mounting the ESP32, a two way DIP switch for sensor node address setting, a voltage divider to measure battery voltage, a BME280 sensor that provides temperature, humidity and atmospheric pressure readings, and a TP4056 based battery charger for the 18650 lithium ion battery. The battery is charged via a solar cell that forms the top cover of the sensor node enclosure.

Remote sensor applications such as these work well when the battery life can be extended as long as possible, and this requires lowering power consumption to the bare minimum. [Harald] selects an ESP32 board with a low quiescent current voltage regulator. This results in about 20uA current drawn during deep sleep periods of 10 minutes, and 200mA over a 10s period for connecting to WiFi and transmitting the data. He reckons this will give him about a 25 day window before the battery loses charge. Hopefully, he will get enough hours of sunshine during the winter months to keep the battery topped up.

There are several bits of software that need to work in unison to make the weather station tick, and [Harald] walks us through the installation and configuration of each part in detail. From setting up the OS on the Raspberry Pi and the Kivy: framework in which the weather station app is coded, to setting up the OpenWeather API, the Mosquitto MQTT broker, and flashing the code on the ESP32 sensor nodes. [Harald] has shared all the details for the hardware and software components of the weather station on Github repositories, making it easy to replicate his efforts.

The weather station works as expected, but [Harald] already has a “feature creep” list of enhancements that he would like to implement in the next version, which shouldn’t come as a surprise to us. Weather Station projects are staple favourites of hackers, and there are many different approaches to choose from, such as this Weather Station For Whether It Rains Or Shines or this Hackaday Prize 2022 submission for a Solar Powered LoRa Weather Station For The Masses.

3 thoughts on “Raspberry Pi Weather Station Features Wireless Sensor Nodes

  1. This is awesome! Like most hackers (and as pointed in the article) I also built my own weather station but it pales in comparison to this. My version is entirely RS485 based (no wifi), but I like the idea of using MQTT to gather all the sensor data. The UI is fantastic and the custom 3D enclosures and PCB are also great. I love that you can easily just mount existing devices too. Fantastic build!

    1. I’m going down a considerably-simpler path using Home Assistant, but I realized I can run rtl_433 on my proxmox “bare metal” hypervisor system and pass the sensor data it picks up into the HA virtual machine via MQTT. Should be pretty easy once the bits show up in the mail. It’ll be nice to put away the useless chunky base station for my 433 MHz sensors and gain that scrap of free space back.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.