Rain gauge - ESP8266 Devkit - Blynk

The principal is the same as the anemometer that you’ve posted about in another thread.
When the bucket tips it creates a pulse which you can detect via an interrupt on a pin.

Obviously the anemometer creates many pulses per second when the wind speed is high, but the pulses from the rain gauge are much less frequent, even when it’s raining very heavily.

One tip of the bucket equals 0.2794 mm of rain. You need to decide what rainfall statistics you’re wanting to measure - Rainfall in the past 60 minutes, 24 hours, week, month etc. then create variables to hold this data and routines to throw away the old data that you no longer need. An array with 60 elements that hold the last 60 minutes worth of rainfall data is the way that I do it. Same for the past 24 hours worth of rainfall.

The problem you’ll have is monitoring these interrupts as well as those for your anemometer, as well as maintaining the Blynk heartbeat.

Missing one pulse from the anemometer isn’t a big deal, but missing one tip of the rain gauge would be a problem so you need to prioritise the rain gauge interrupt processing over the anemometer.

Pete.

1 Like