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.
Key Learning Objectives & Robotics Concepts
By building and programming this project, you will master the following core engineering skills:
Power Architecture & Voltage Staging
5V / 3.3V Regulated PowerPowering 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.
Bill of Materials (BOM) & Hardware Components
| Component | Specifications & Alternative | Qty | Approx Cost |
|---|---|---|---|
| Arduino Uno R3 | ATmega328P @ 16MHz | 1 | $8.00 |
| FC-37 / YL-83 Raindrop Sensor Module | 50×40mm plated rain plate + LM393 breakout | 1 | $1.80 |
| 5mm Blue/Red LED + 220Ω Resistor | Rain onset alert indicator | 1 | $0.15 |
| Breadboard & Jumper Wires | 7× breadboard leads | 1 | $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.
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.
Step-by-Step Physical Assembly & Wiring Tutorial
Follow each of the 5 sequential milestone stages with technical photos, wiring checks, and pre-flight tests.
Connect Rain Sensing Plate to LM393 Board
Join the two pins on the large striped rain board to the 2-pin side of the LM393 PCB (non-polarized).
- 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!
Wire Switched Power (D7), AO (A0) & Alert LED (D8)
Connect the 4-pin Arduino side of the LM393 board cleanly.
- 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.
Test Dry Baseline & Single-Drop Sensitivity
Verify dry reading sits near 1020, then place 1–2 droplets on the grid.
- 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.
Upload 3-Stage Rainfall Intensity Monitor
Flash the pulsed rain classifier distinguishing Dry, Light Drizzle, and Heavy Rain.
- 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.
Tune Hardware DO Trimpot (Optional)
Dial the blue potentiometer on the LM393 board so DO trips right at Light Drizzle onset.
- 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.
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 DiagnosticMinimal standalone sketch to verify pin wiring and signal response for FC-37 / YL-83 Raindrop Plate + LM393 Board before running the full project firmware.
// 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);
}Complete Production Firmware
Full working C++ source code with pin mappings, non-blocking timers, and FSM avoidance routines.
/**
* 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
Input Signal vs. System Output Truth Table:
| Input / State | Pin / Signal | Detected Condition | Expected Output |
|---|---|---|---|
| ADC ≥ 850 | 0–20% Wet | Dry Plate | D8 LED OFF (Clear) |
| 480 – 849 | 21–70% Wet | Light Drizzle | D8 LED Slow Blink |
| ADC < 480 | > 70% Wet | Heavy Downpour | D8 LED Solid ON |
Engineering Troubleshooting Matrix
| Problem | Likely Cause | Diagnostic Check | Engineering Solution |
|---|---|---|---|
| Always reports Heavy Rain even when dry | Missing power on D7 (reading 0V) or shorted grid traces | Verify LM393 power LED pulses every second | Check D7→VCC wire and inspect plate for conductive debris. |
| Stays Dry when drops land on plate | Drops too small to bridge two adjacent copper traces | Use a slightly larger tap-water droplet across two stripes | Confirm rain plate jumpers connect tightly to LM393 module. |
| Slow return to Dry after wiping | Moisture film left on PCB solder mask | Dry plate thoroughly with tissue | Mount plate angled 35°–45° for rapid drainage. |
Engineering Challenges & Upgrades
Take your build to the next level with these progressive engineering upgrades:
Sweep Project 8 SG90 servo slowly during Light Drizzle and rapidly during Heavy Rain!
Drive Project 15 Stepper Motor to pull a miniature drying rack indoors at first raindrop.
Combine DHT11 (Project 3) + Raindrop + OLED (Project 4) into a desktop weather console.