To Hack or Not to Hack
Malte Pöggel retrofitted a cheap rain gauge with a custom LoRa-enabled circuit, making it the perfect addition to his IoT weather station.
When you want to do some hacking on a budget, picking up cheap or older hardware that is not quite ideal — but that can get the job done — is often the best way to go. With a bit of ingenuity and soldering, many of the hardware’s limitations can be overcome. But one must always count the cost before taking this approach. How much time will have to go into bringing the hardware up to snuff? And what will the new components cost? Would it make more sense to just pony up for better hardware up front and save some hassle later?
Engineer and electronics hobbyist Malte Pöggel recently took on a project that may have crossed over the line and left practicality in the rear view mirror, but it was a great exercise in revitalizing dated hardware that we can learn from all the same. Pöggel wanted to add a rain gauge to his existing IoT weather station, so he picked up an inexpensive TFA Dostmann rain transmitter 30.3161. It is quite capable of sensing rainfall, however, it transmits that data via a custom radio protocol that requires a separate receiver to decode.
Pöggel did not like the idea of having a separate receiver, or having to decode a proprietary protocol for this one sensing unit, so he decided to retrofit the rain gauge to communicate via LoRa. This is where things get a bit complicated, and where one might question the decision to upgrade the existing hardware. It was not a simple matter of wiring a LoRa-capable development board into the mix — the upgrade involved a complete redesign of the internal components.
The original circuit boards were replaced with custom-designed boards. The main board now houses an ATmega328P microcontroller clocked at 8 MHz, a LoRa RFM95W radio module for connectivity, and additional sensors such as a BMP280 for temperature and air pressure measurements. A tunnel magnetoresistive sensor replaced the original reed contact for detecting rainfall pulses, offering higher sampling rates and lower power consumption. About the only thing retained in the new design was the original contacts for AA batteries.
The original transmitter board was repurposed as nothing more than an antenna holder. Furthermore, FRAM memory was integrated to store LoRaWAN activation data and sensor readings, ensuring data recovery after battery changes. A pressure-equalization membrane was added to the housing to allow accurate air pressure readings while preventing moisture intrusion.
The firmware for the modified rain gauge was developed using the PlatformIO build environment, leveraging the MCCI LMIC library to enable LoRaWAN integration. It manages data acquisition, transmission, and deep sleep modes to optimize power consumption. The firmware supports over-the-air activation, allows configuration updates via downlink messages, and stores activation data and rainfall counts.
To visualize the data, a Telegraf-InfluxDB-Grafana stack was implemented using Docker. The system retrieves decoded JSON payloads via MQTT integration with The Things Network, stores the data in InfluxDB, and provides real-time insights through a pre-configured Grafana dashboard, offering a complete and user-friendly solution for monitoring rainfall data.
If all you want is a rain gauge to plug into your existing IoT weather station, there are easier paths to follow. But if you want to learn some new things and personalize the system to your heart’s content, then Pöggel’s solution is hard to beat.