TecnoMate logo
Build a Rain Sensor Alarm System with Arduino
Back to Guides
SensorsArduinoWeatherAlarm

Build a Rain Sensor Alarm System with Arduino

Jan 4, 2026
5 min read

Rain Sensor Alarm System: Never Get Caught Out Again

A Rain Sensor detects the presence of water droplets. When it rains, the sensor triggers an alarm (buzzer) or an action (close a window, retract an awning).

How the Sensor Works

The rain sensor module has a conductive PCB with interleaved traces. When water bridges these traces, the resistance drops significantly. The comparator module reads this change and outputs a digital LOW or an analog value.

Components

  • Arduino Uno
  • Rain Sensor Module (with comparator board)
  • Buzzer
  • LED
  • (Optional) Servo Motor for automatic window closer

Code Logic

```cpp int rainPin = A0; int buzzerPin = 8;

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

void loop() { int sensorValue = analogRead(rainPin); Serial.println(sensorValue);

if (sensorValue < 500) { // Threshold (lower = more water) digitalWrite(buzzerPin, HIGH); // ALARM! } else { digitalWrite(buzzerPin, LOW); } delay(100); } ```

Applications

  • Automatic clothes drying rack that retracts indoors.
  • Smart irrigation systems that pause when raining.
  • Alert system for open car windows.

Get Our Kit

Build this project with the Rain Sensor Alarm System kit!


Ready to start building?

Explore our collection of DIY kits and components. All project components mentioned in this guide are available in our store.

Browse All Projects