Rain on the clothes line alert
Build it step by step
0 of 8 doneWire the module
VCC to D7, GND to GND, AO to A0.
Connect the plate
Two thin wires from the plate to the module.
Wire the alarm
Buzzer on D6, red LED through 330 ohm on D5, mute button on D2.
Upload the sketch
Serial monitor shows readings near 1000 when dry.
Drop a little water on the plate
The value falls below 600.
Keep it wet for six seconds
The LED lights and the buzzer beeps.
Press the mute button
The beeping stops.
Dry the plate
The LED goes off and the alarm re-arms later.
How do you build a rain on the clothes line alert?
A rain drop plate near the washing line sounds a buzzer indoors when the first drops fall. You need Arduino Nano, Rain drop sensor module, Active buzzer 5 V, LED 5 mm red, Resistor 330 Ω, Tactile push button 6 mm, 5 V 2 A USB adapter and Breadboard 830 Tie Points. It takes 8 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 8
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- Motors & ActuatorsBuy
- SemiconductorsBuyLED 5 mm red × 1
- PassivesBuyResistor 330 Ω × 1
- SwitchesBuy
- PowerBuy
- PrototypingBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Rain module VCC | Nano D7 | Powered only while measuring, to slow corrosion of the plate |
| Rain module GND | Nano GND | Ground |
| Rain module AO | Nano A0 | Analog wetness reading, low means wet |
| Rain plate | Rain module with two thin leads | Plate sits outside, electronics stay indoors |
| Active buzzer plus | Nano D6 | Alarm |
| Active buzzer minus | Nano GND | Ground |
| Red LED through 330 ohm | Nano D5 to GND | Wet indicator |
| Mute button | Nano D2 to GND | Silence the alarm |
Code
A rain drop plate is a board covered with bare copper tracks. Water bridges the tracks and lowers the resistance between them, so the analog reading falls from about 1000 when dry to a few hundred when wet. Because current flowing through wet copper slowly eats the tracks, the sketch powers the module from a pin and switches it on only for about 30 milliseconds every two seconds, which greatly reduces corrosion compared with leaving it on all the time. The alarm waits for three wet readings in a row so a single drop of dew or a passing splash does not trigger it. A mute button silences the beeps, and the alarm re-arms after ten dry minutes so it can warn you about the next shower. Mount the plate at a slight angle so water runs off, put the electronics indoors in the dry, and keep the thin leads short and sealed where they pass through a window. Everything is low voltage, so there is no danger from mains. After rain, rinse and dry the plate.
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
const int POWER = 7; // powers the sensor only while reading
const int SENSE = A0;
const int BUZZER = 6;
const int LED = 5;
const int MUTE = 2;
const int WET_BELOW = 600; // dry reads near 1000, wet reads much lower
const int NEEDED = 3; // consecutive wet readings before the alarm
const unsigned long CHECK_MS = 2000;
const unsigned long DRY_RESET_MS = 600000UL; // 10 minutes dry before the alarm re-arms
unsigned long lastCheck = 0, lastWet = 0;
int wetCount = 0;
bool muted = false;
int readPlate() {
digitalWrite(POWER, HIGH);
delay(30); // let the reading settle
int v = analogRead(SENSE);
digitalWrite(POWER, LOW);
return v;
}
void setup() {
pinMode(POWER, OUTPUT);
pinMode(BUZZER, OUTPUT);
pinMode(LED, OUTPUT);
pinMode(MUTE, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
unsigned long now = millis();
if (digitalRead(MUTE) == LOW) muted = true;
if (now - lastCheck >= CHECK_MS) {
lastCheck = now;
int v = readPlate();
Serial.println(v);
if (v < WET_BELOW) { wetCount++; lastWet = now; }
else wetCount = 0;
if (!muted || wetCount == 0) digitalWrite(LED, wetCount >= NEEDED);
if (wetCount == 0 && now - lastWet > DRY_RESET_MS) muted = false; // re-arm after a long dry spell
}
bool alarm = (wetCount >= NEEDED) && !muted;
digitalWrite(BUZZER, alarm && ((now / 400) % 2 == 0)); // beep on and off
}What the serial monitor should show
Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual Arduino Nano with its sensors at their default values. Your numbers will follow your real readings, but the format should match.
205 206 205
Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Dry plate | Reading near 1000 |
| A few drops | Reading below 600 |
| Wet for 6 seconds | Alarm and LED |
| Mute pressed | Silent |
| Plate wiped dry | LED off |
If it does not work
Reads low when dry
Humid air or a dirty plate, raise the WET_BELOW threshold.
Never alarms
Lower the check time or check the AO wire.
Alarm triggers in dew
Raise NEEDED to 5 readings.
Plate tracks look dark
Corrosion, clean it and shorten the on time.
Buzzer silent
Check it is an active buzzer on D6.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the rain on the clothes line alert?
Arduino Nano, Rain drop sensor module, Active buzzer 5 V, LED 5 mm red, Resistor 330 Ω, Tactile push button 6 mm, 5 V 2 A USB adapter and Breadboard 830 Tie Points.
How long does the rain on the clothes line alert take to build?
About 60 minutes for a beginner maker, in 8 steps.
How do I know the rain on the clothes line alert works?
Dry plate: Reading near 1000. A few drops: Reading below 600. Wet for 6 seconds: Alarm and LED.
Reads low when dry: what should I check?
Humid air or a dirty plate, raise the WET_BELOW threshold.
Never alarms: what should I check?
Lower the check time or check the AO wire.
Alarm triggers in dew: what should I check?
Raise NEEDED to 5 readings.
Plate tracks look dark: what should I check?
Corrosion, clean it and shorten the on time.
