By now, we’ve hopefully whetted your appetite with this
simple design. Most of the mechanical detail here is "roll your own" but there
is an alternative commercial rain sensor available if you don’t have the time or
inclination to make one. For those who do . . .
Making the rain sensor
The rain sensor uses a tipping bucket mechanism, consisting of
a rain collection funnel that feeds water into a pivoting bucket divided into
two opposing halves. When one side of the bucket fills and tips, it empties
itself, at the same time positioning the opposing side under the funnel outlet
where it can fill, tip and repeat the cycle.
The main funnel is glued using silicon sealant into a 100mm PVC pipe end-cap which has its end removed. Note the mesh leaf and insect trap on the bottom end.
The tipping back and forth can be detected in various ways.
Since power consumption was important for this project, a passive sensing
mechanism was chosen. This involves momentarily closing a switch each time the
bucket tips. As shown in the circuit diagram, the switch closure pulls the rain
sensor line low (it is normally held high by a 220kΩ pull-up resistor).
To keep the design simple and maximise reliability, I used a
magnetic reed switch that is mounted on a bracket next to the tipping bucket.
The switch is closed by a tiny rare-earth magnet (measuring
only 3x2mm) that is mounted on the tipping bucket. As the bucket swings, the
magnet moves past the reed switch, closing it for a brief moment. A similar
mechanism is found in many commercial rain sensors and has the advantage that
the reed switch is practically immune to moisture, corrosion, etc.