Raspberry Pi Weather Station Features Wireless Sensor Nodes [Hackaday]

View Article on Hackaday

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.