← Back to Basic Projects
Basic . Project #18

🌧️ Automatic Rain Sensor

Detect rainfall instantly and trigger a buzzer alarm to protect your outdoor belongings.

📋 Overview

The rain sensor consists of a sensing pad with nickel-coated traces. Water drops bridge these traces, changing the board's resistance, which the Arduino detects via an analog pin.

What you'll learn: Moisture sensing, analog thresholds, and environment-triggered events.

Estimated time: 30-40 minutes. Difficulty: ⭐⭐ Easy.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R35V1
Rain Sensor ModuleSensing pad + Comparator1
Piezo BuzzerAlarm1
Jumper WiresF-M and M-M6

📖 Step-by-Step Tutorial

1

Wire the Sensor

Connect VCC → 5V, GND → GND, AO → Pin A0.
2

Connect Buzzer

Connect buzzer positive to pin 8, negative to GND.
3

Test Dry

Serial Monitor should show high values (e.g., 1023) when dry.
4

Test Wet

Put a single drop of water on the pad. The value should drop sharply and trigger the buzzer.
💡
Keep the sensor module (the green electronics board) dry! Only the sensing pad (the larger plate with traces) should be exposed to rain.

💻 Arduino Code

rain_alarm.ino
INO
// Rain Alarm : Volt X
const int sensor = A0;
const int buzzer = 8;
const int threshold = 500;

void setup() {
  pinMode(buzzer, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  int val = analogRead(sensor);
  Serial.println(val);

  if (val < threshold) { // Water detected
    tone(buzzer, 1000);
  } else {
    noTone(buzzer);
  }
  delay(500);
}

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0

Loading reviews…

Automatic Rain Sensor — Arduino Tutorial | Volt X