Detect when it's raining with this raindrop detection sensor.
You’ve been left at home in charge of the laundry. It’s already washed and hanging out to dry on the line. But you were warned – on pain of death – to bring it in if it starts to rain. The trouble is, you’re totally into whatever it is you’re coding right now and you won’t even notice if it rains. You’ll be toast if it rains and the laundry gets wet. So which is it to be? Code or laundry? That was your choice – until now!
Let's Build an Alert System to Monitor this for you
Full project build guide and Python code is here on RasPi.TV
To get an alert when it starts to rain, we’re going to rig this sensor up to a Raspberry Pi and trigger a buzzer. You could also have it blink LEDs, send you an SMS or tweet a photo of the washing line and the sky. But we’re going with a buzzer for now. You could use a Wemos or Arduino instead of a Pi.
This is the Circuit
For Python code and other build instructions click here
- Raindrop sensing board
- Control board
- 5 jumper wires with F-F DuPont connectors
- 10 jumper wires with M-F DuPont connectors
- Buzzer (active piezo)
- Mini breadboard
Controller Vcc to 3.3V or 5V
Controller GND to GND or - on power source.
Controller - to one connector on sensor (doesn't matter which)
Controller + to the other connector on sensor
Controller DO to whatever you want to trigger when rain is detected. (HIGH when dry, LOW when rain detected).
Controller AO to an ADC, Microcontroller or Voltmeter (if required).
Digital Output (DO)
Adjusting the potentiometer will change the sensitivity of the digital trigger. DO is HIGH when the sensor is dry and LOW when triggered. With the potentiometer in the middle, one large drop (spanning 3 lines of copper) is enough to trigger the detection of rainfall. This causes the signal to change from HIGH to LOW. The controller can output up to 100 mA which is enough to drive a relay or a few LEDs (remember to add a resistor to your LED). It's also fine to connect DO to a micro-controller or Raspberry Pi GPIO port. Power the raindrop sensor with 3.3V if using a Pi.
Analog Output (AO)
With Vin = 5.17V, when completely dry, AO = Vin = 5.17V. With one large drop on the sensor (spanning 3 lines of copper) AO drops to 2.45V. 2 large drops, it falls to 2.16V. You would need to calibrate this if you want to use the analog output to give an indication of "amount" of rain.