← Back to Basic Projects

🌧️ 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

πŸ—ΊοΈ Component Pin Mapping

Automatic Rain Sensor Component Pin Mapping Infographic

πŸ“– 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...

volt-X / Automatic Rain Sensor β€” Arduino Tutorial