Daily Archives: March 21, 2018

A Rain Alert for the Raspberry Pi

This Raspberry Pi (RBPi) rain alert will let you know when it starts to rain, so you can reel in the clothes you had let out to dry after washing. Although the kit uses an RBPi3, any model of the RBPi family can easily handle this project. A later extension can make it send tweets as well, but for now, it simply triggers a buzzer.

The primary sensor in this project senses falling raindrops. This raindrop sensor is actually a printed circuit board with two traces running across the entire board in an inter-meshed dual comb pattern. As the two sets of teeth of the comb traces remain separated by about a millimeter, they show high resistance when dry. Their resistance decreases when a drop of water falls across the traces, shorting them.

A sensor controller tracks the resistance between the traces, the resistance reducing as more drops of water fall on the sensor. A potentiometer on the controller allows the user to adjust the level of detection when the normally high digital out pin will go low. When the sensor detects rain, it changes the status of the pin. The RBPi, monitoring the status, sets off the buzzer.

Since it is essential to detect the start of rainfall, setting the potentiometer to trigger when a couple of raindrops have fallen on the sensor is adequate. Adjusting it is easy, which you can do when you have two or three raindrops collected on the sensor. Turn the potentiometer until the buzzer just stops, and turn back until you hear it going again.

Since it has to detect raindrops, placing the sensor such that it is always under an open sky is important. However, as electronics and rain do not work satisfactorily together, it is very important the rest of the circuitry remains protected from rain. The best way to achieve this is to have the RBPi and rest of the electronics inside a waterproof plastic case, with only the raindrop sensor hanging out. Run the Python program here and wait for the beeps to inform you everything is working properly.

Apart from the raindrop sensor and its control board, you need only a few other parts to get the kit working. A few jumper wires, an active piezo buzzer, and a mini breadboard are all you need. You can start by connecting the output of the control board to the GPIO18 port of the RBPi to read its status, and set off the buzzer from the RBPi’s GPIO13 port, while the sensor detects raindrops.

If you do not like sounding a buzzer, you can activate some LEDs instead when it rains. Else, program the RBPi to send an email, an sms, a push notification, or tweets a photo warning when it detects rain. Since the continuous sounding of the buzzer will become tiring after a while, you can tweak the code to stop it after a while.

Since the sensor is out in the open, you will have to run out and wipe it dry as soon as it stops raining, to prepare it for detecting the next shower.