Projects / Rain on the clothes line alert

Rain on the clothes line alert

Beginner1 hGuided buildReviewed

Build it step by step

0 of 8 done
  1. NANO

    Wire the module

    VCC to D7, GND to GND, AO to A0.

  2. NANO

    Connect the plate

    Two thin wires from the plate to the module.

  3. NANO18.3 mA

    Wire the alarm

    Buzzer on D6, red LED through 330 ohm on D5, mute button on D2.

  4. NANO

    Upload the sketch

    Serial monitor shows readings near 1000 when dry.

  5. NANORAIN

    Drop a little water on the plate

    The value falls below 600.

  6. NANO18.3 mA

    Keep it wet for six seconds

    The LED lights and the buzzer beeps.

  7. NANO

    Press the mute button

    The beeping stops.

  8. NANO18.3 mA

    Dry the plate

    The LED goes off and the alarm re-arms later.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Rain module VCCNano D7Powered only while measuring, to slow corrosion of the plate
Rain module GNDNano GNDGround
Rain module AONano A0Analog wetness reading, low means wet
Rain plateRain module with two thin leadsPlate sits outside, electronics stay indoors
Active buzzer plusNano D6Alarm
Active buzzer minusNano GNDGround
Red LED through 330 ohmNano D5 to GNDWet indicator
Mute buttonNano D2 to GNDSilence 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.

CheckExpected
Dry plateReading near 1000
A few dropsReading below 600
Wet for 6 secondsAlarm and LED
Mute pressedSilent
Plate wiped dryLED 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 →

Ask Lark AI

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.