Close

Rain Gauge ( Rain Fall Sensor )

A project log for Solar Powered WiFi Weather Station V3.0

ESP32 based Open Source Weather Station

open-green-energyOpen Green Energy 10/07/2021 at 14:250 Comments

Here I have used a most common type of Rain Sensor which is called a Tipping Bucket rain gauge. Basically, there's a little see-saw shape tipper bucket inside the sensor ( see the above picture ). The rain fills up a bucket on one end and it tips over so that it empties and the bucket on the other side starts to fill. Each time the bucket tips it passes a magnet over a reed switch making a momentary electrical connection. The buckets are calibrated to a volume of water, which means if we can count how many times the switch closes we can calculate how much rainfall there's been.

Much like the wind speed gauge, the rainfall gauge generates ticks to tally the amount of rain that has fallen. Count ticks to determine how much rain has fallen recently. Each tick represents 0.011" ( 0.28mm ) of rainfall. This sensor is connected to pin 25 of the ESP32.

The rain gauge that I have used here is from Sparkfun. It has an RJ-11 plug on the end, you can directly plug it into the Weather Station V3.0 PCB.

You can make your 3D printed Rain Gauge by following this article

Measuring the Rainfall:

In the previous step, we have discussed that each time the bucket tips, it passes a magnet over a reed switch making a momentary electrical connection. Here each tip of the bucket in the rain gauge can be assumed as a button press. We can easily then connect the gauge as if it were a button.

The rain gauge is connected to the ESP GPIO pin 25 and GND. After that, all we need to do then is to monitor for button presses which are pretty straightforward. We can use the pin interrupts method to monitor the button press ( tips). When the reed switch closes the circuit (pressing the button, the bucket tipping), it triggers a software event.

Here I am using attachInterrupt()to monitor the number of tips. You can find the details from ArduinoPage.

Discussions