MyRoboPathOpen Robotics Lab
Arduino Uno #33 of 35
Est. 0.5 Hours
Budget: $2 - $4
Beginner

Raindrop Detection Sensor & Smart Roof/Wiper Alert

Measure rainfall onset and intensity across a nickel-plated sensing grid to automate smart windows and windshield wipers.

Build an automatic rain-sensing weather alert with the FC-37 / YL-83 raindrop sensor module. Measure surface raindrop conductivity across the angled sensing pad via analog pin A0, classify Dry / Light Drizzle / Heavy Rain states, and drive an automated warning LED or window-closing servo.

Arduino Uno R3FC-37 Rain SensorPulsed D7 ExcitationWeather AutomationLM393 Comparator
Raindrop Detection Sensor & Smart Roof/Wiper Alert Blueprint
Raindrop Detection Sensor & Smart Roof/Wiper AlertCAD Blueprint

Key Learning Objectives & Robotics Concepts

By building and programming this project, you will master the following core engineering skills:

1Understand how raindrop droplets bridge interleaved PCB comb traces, pulling A0 voltage down proportionally.
2Apply switched GPIO excitation (D7) to eliminate outdoor trace electrolysis.
3Classify analog ADC bands into Dry, Light Drizzle, and Heavy Downpour intensities.
4Angle the sensor board mechanically so droplets shed cleanly after rain stops.

Power Architecture & Voltage Staging

5V / 3.3V Regulated Power

Powering the LM393 rain comparator module via switched pin D7 for 20ms per second protects the outdoor copper-nickel grid from electrochemical oxidation during long rainstorms. Mount sensing plate at a 30°–45° tilt so rain runs off naturally once a shower ends; use pulsed D7 excitation to keep the nickel traces gleaming.

Raindrop Detection Sensor & Smart Roof/Wiper Alert Power Architecture Schematic
Figure: Regulated Arduino Uno supply rails, current budget, and component protection.Power Schematic

Bill of Materials (BOM) & Hardware Components

Bill of Materials for Raindrop Detection Sensor & Smart Roof/Wiper Alert
ComponentSpecifications & AlternativeQtyApprox Cost
Arduino Uno R3ATmega328P @ 16MHz1$8.00
FC-37 / YL-83 Raindrop Sensor Module50×40mm plated rain plate + LM393 breakout1$1.80
5mm Blue/Red LED + 220Ω ResistorRain onset alert indicator1$0.15
Breadboard & Jumper Wires7× breadboard leads1$2.00

Electrical & System Architecture

Link the 2-pin rain plate to the LM393 interface module. Connect interface VCC to D7 (switched), GND to GND, AO to A0, DO to D2, and Rain Alert LED (+220Ω) to D8.

Figure: Complete Arduino Uno R3 pin-to-pin wiring schematic for Raindrop Detection Sensor & Smart Roof/Wiper Alert.
Figure: Complete Arduino Uno R3 pin-to-pin wiring schematic for Raindrop Detection Sensor & Smart Roof/Wiper Alert.Wiring Schematic

Autonomous Behavior & Finite State Machine (FSM)

Deterministic Arduino loop handling FC-37 / YL-83 Raindrop Plate + LM393 Board acquisition, filtering, and real-time output updates.

Figure: Firmware execution flow and state transitions for Raindrop Detection Sensor & Smart Roof/Wiper Alert.
Figure: Firmware execution flow and state transitions for Raindrop Detection Sensor & Smart Roof/Wiper Alert.Control Algorithm

Step-by-Step Physical Assembly & Wiring Tutorial

Follow each of the 5 sequential milestone stages with technical photos, wiring checks, and pre-flight tests.

1

Connect Rain Sensing Plate to LM393 Board

Duration: 5 Mins

Join the two pins on the large striped rain board to the 2-pin side of the LM393 PCB (non-polarized).

Raindrop Detection Sensor & Smart Roof/Wiper Alert hardware layout diagram
Stage 1: FC-37 / YL-83 Raindrop Plate + LM393 Board hardware inspection & pinout overview.Stage 1 Diagram
Step Action Checklist:
  • Connect the rain plate via two Female-to-Female jumper wires to the LM393 module.
  • Prop the sensing plate at a ~35° tilt on a small cup or spacer so drops roll off naturally.
  • Keep the Arduino Uno and breadboard safely dry and away from your water dropper!
Engineering & Tuning Tip: Never spray water directly onto the Arduino—use a single cotton swab or eye dropper strictly over the rain plate.
2

Wire Switched Power (D7), AO (A0) & Alert LED (D8)

Duration: 5 Mins

Connect the 4-pin Arduino side of the LM393 board cleanly.

Raindrop Detection Sensor & Smart Roof/Wiper Alert breadboard wiring check diagram
Stage 2: Breadboard layout & Arduino Uno pin-to-pin wiring audit.Stage 2 Diagram
Step Action Checklist:
  • Connect LM393 VCC → D7, GND → GND, AO → A0, and DO → D2.
  • Wire Blue/Red LED (+220Ω) to D8.
  • Connect USB cable to power the Uno.
Engineering & Tuning Tip: Notice the sensor reads ~1000–1023 when completely dry and drops toward ~200–400 as more droplets bridge the grid.
3

Test Dry Baseline & Single-Drop Sensitivity

Duration: 5 Mins

Verify dry reading sits near 1020, then place 1–2 droplets on the grid.

Raindrop Detection Sensor & Smart Roof/Wiper Alert power rail protection diagram
Stage 3: Supply rail check (Switched D7 Excitation (5V pulsed 20ms)) and circuit protection verification.Stage 3 Diagram
Step Action Checklist:
  • Upload the diagnostic snippet and open Serial Monitor.
  • Confirm dry plate prints ~1010–1023.
  • Place 2 drops of tap water on the stripes and watch ADC fall to ~600–750.
Engineering & Tuning Tip: More droplets bridging more trace pairs lowers parallel resistance further, giving true rainfall intensity!
4

Upload 3-Stage Rainfall Intensity Monitor

Duration: 10 Mins

Flash the pulsed rain classifier distinguishing Dry, Light Drizzle, and Heavy Rain.

Raindrop Detection Sensor & Smart Roof/Wiper Alert serial telemetry verification diagram
Stage 4: Firmware upload & 115200 baud Serial Monitor verification.Stage 4 Diagram
Step Action Checklist:
  • Upload the production sketch below.
  • Test Dry (0% wet), Light Drizzle (1–2 drops), and Heavy Rain (wet tissue / several drops).
  • Confirm D8 LED blinks slowly during drizzle and locks solid ON during heavy rain.
Engineering & Tuning Tip: Pat the nickel plate dry with a soft cloth after testing so no mineral residue accumulates.
5

Tune Hardware DO Trimpot (Optional)

Duration: 5 Mins

Dial the blue potentiometer on the LM393 board so DO trips right at Light Drizzle onset.

Raindrop Detection Sensor & Smart Roof/Wiper Alert live operational logic diagram
Stage 5: Live operational logic flow & calibration verification.Stage 5 Diagram
Step Action Checklist:
  • With 2 water drops on the grid, adjust the trimpot until the onboard DO LED lights.
  • Wipe the plate dry and verify the DO LED turns OFF cleanly.
  • Verify D2 digital state matches your weather alert.
Engineering & Tuning Tip: Pair this module with Project 8 (SG90 Servo) to automatically close a miniature skylight or sweep a wiper blade!

Subsystem Benchtop Verification Scripts

Test each hardware subsystem independently before deploying the full autonomous firmware.

1Bench Diagnostic: FC-37 / YL-83 Raindrop Plate + LM393 Board Hardware Check

Subsystem Diagnostic

Minimal standalone sketch to verify pin wiring and signal response for FC-37 / YL-83 Raindrop Plate + LM393 Board before running the full project firmware.

Arduino IDE Diagnostic ScriptC++ / Arduino
// Diagnostic: Pulsed Raindrop Grid ADC Check
void setup() { pinMode(7, OUTPUT); Serial.begin(115200); }
void loop() {
  digitalWrite(7, HIGH); delay(20);
  int v = analogRead(A0);
  digitalWrite(7, LOW);
  Serial.print("Rain Grid ADC: "); Serial.println(v);
  delay(1000);
}
Expected Output: Prints ~1018 dry, ~650 with a few drops, and <380 when drenched.

Complete Production Firmware

Full working C++ source code with pin mappings, non-blocking timers, and FSM avoidance routines.

arduino_uno_raindrop_weather_sensor.ino
arduino_uno_raindrop_weather_sensor.inoArduino C++
/**
 * Project 33: Anti-Corrosion Raindrop Intensity Sensor & Smart Alert
 * Board: Arduino Uno R3 | Pins: D7 (Switched VCC), A0 (AO), D8 (Rain LED)
 */
const uint8_t RAIN_PWR = 7;
const uint8_t RAIN_AO  = A0;
const uint8_t RAIN_LED = 8;

const int TH_DRIZZLE = 850; // Below 850 = Drizzle detected
const int TH_HEAVY   = 480; // Below 480 = Heavy rain

int readRainAdc() {
  digitalWrite(RAIN_PWR, HIGH);
  delay(20);
  int val = analogRead(RAIN_AO);
  digitalWrite(RAIN_PWR, LOW);
  return val;
}

void setup() {
  pinMode(RAIN_PWR, OUTPUT);
  pinMode(RAIN_LED, OUTPUT);
  Serial.begin(115200);
  Serial.println(F("Smart Raindrop Weather Sentinel Ready"));
}

void loop() {
  int raw = readRainAdc();
  int wetnessPct = constrain(map(raw, 1020, 250, 0, 100), 0, 100);

  Serial.print(F("Raw ADC: ")); Serial.print(raw);
  Serial.print(F(" | Wetness: ")); Serial.print(wetnessPct);
  Serial.print(F("% | Weather: "));

  if (raw < TH_HEAVY) {
    Serial.println(F("HEAVY RAIN -> CLOSE ROOF!"));
    digitalWrite(RAIN_LED, HIGH);
    delay(800);
  } else if (raw < TH_DRIZZLE) {
    Serial.println(F("LIGHT DRIZZLE"));
    digitalWrite(RAIN_LED, HIGH); delay(250);
    digitalWrite(RAIN_LED, LOW);  delay(550);
  } else {
    Serial.println(F("DRY / CLEAR"));
    digitalWrite(RAIN_LED, LOW);
    delay(800);
  }
}

Firmware Architecture Explanation:

  • Switches power on D7 for only 20ms per cycle so outdoor rain grids stay corrosion-free.
  • Converts inverted raw ADC (1020 dry → 250 drenched) into intuitive 0–100% wetness.
  • Uses distinct visual signatures: OFF for dry, pulsing blink for drizzle, solid ON for heavy rain.

Operational Verification & Pin State Matrix

1Double-check all 5 Arduino Uno pin connections against the wiring schematic before plugging in USB.
2Upload the Bench Diagnostic sketch first and confirm Serial Monitor at 115200 baud matches: Prints ~1018 dry, ~650 with a few drops, and <380 when drenched.
3Upload the complete production sketch and verify every condition in the operational truth table below.

Input Signal vs. System Output Truth Table:

Operational truth table for Raindrop Detection Sensor & Smart Roof/Wiper Alert
Input / StatePin / SignalDetected ConditionExpected Output
ADC ≥ 8500–20% WetDry PlateD8 LED OFF (Clear)
480 – 84921–70% WetLight DrizzleD8 LED Slow Blink
ADC < 480> 70% WetHeavy DownpourD8 LED Solid ON

Engineering Troubleshooting Matrix

Engineering troubleshooting matrix for Raindrop Detection Sensor & Smart Roof/Wiper Alert
ProblemLikely CauseDiagnostic CheckEngineering Solution
Always reports Heavy Rain even when dryMissing power on D7 (reading 0V) or shorted grid tracesVerify LM393 power LED pulses every secondCheck D7→VCC wire and inspect plate for conductive debris.
Stays Dry when drops land on plateDrops too small to bridge two adjacent copper tracesUse a slightly larger tap-water droplet across two stripesConfirm rain plate jumpers connect tightly to LM393 module.
Slow return to Dry after wipingMoisture film left on PCB solder maskDry plate thoroughly with tissueMount plate angled 35°–45° for rapid drainage.

Engineering Challenges & Upgrades

Take your build to the next level with these progressive engineering upgrades:

Level 1Auto-Speed Windshield Wiper

Sweep Project 8 SG90 servo slowly during Light Drizzle and rapidly during Heavy Rain!

Level 2Automatic Clothesline Retractor

Drive Project 15 Stepper Motor to pull a miniature drying rack indoors at first raindrop.

Level 3Complete Outdoor Weather Station

Combine DHT11 (Project 3) + Raindrop + OLED (Project 4) into a desktop weather console.