count pulses

Compared to the Arduino's speed, your rain bucket will tip at geologic rates. :slight_smile:

If I was going to build one of these systems, I'd place a small magnet at one side of the bucket, then place a magnetic reed switch in such a way that the rain bucket would close the reed when tipped one way, and open it when tipped the other.

In the Arduino code, you could detect the reed's change of state using either an interrupt or by polling. Since things will be happening slowly, polling is probably the way to go. It also facilitates debouncing.

When you first read and debounce the reed switch, store its state and initialize your counter. In your polling routine, watch for the change of state. Debounce it, then update your counter and change the state you're watching for in the polling routine. (And your debounce routine can use ridiculously long timing. Rather than milliseconds as you might use for a switch, you could debounce in tenths or even seconds to allow for some bucket oscillation at the near-balance point.)

You'll have lots of time left to read and process temperature, humidity, barometric pressure, etc.

Save the interrupt for your anemometer. :slight_smile:

Sounds like a good project. I hope you'll have fun with it!

Tom