Raindrop & Surface Moisture Sensor (FC-37 / YL-83)
Complete engineering manual covering physical operating principles, pinout architecture, circuit schematics, non-blocking Arduino/ESP32 code, and troubleshooting.

What is the FC-37 Raindrop Sensor?
The FC-37 (also categorized as the YL-83) is an open-face conductive sensing board designed to detect rain, moisture precipitation, and water surface accumulation. It consists of two components: a nickel-coated FR-4 sensing board with interdigitated copper traces, and a signal conditioning module housing an LM393 dual comparator and sensitivity adjustment potentiometer.
When the surface board is dry, the air gap provides virtually infinite resistance between the interleaving trace patterns. As raindrops land on the nickel tracks, the conductive ionic nature of water bridges the gap, dropping electrical resistance and creating a measurable analog voltage drop that also trips a digital active-LOW alarm output.
Key Technical Specifications
Precipitation Intensity Measurement
Analog output voltage correlates directly to droplet density and surface wetness coverage.
Dual Analog & Digital Output
Provides continuous ADC levels for rain volume and a clean digital trip for immediate rain alarms.
Nickel-Plated Anti-Oxidation Finish
Surface tracks are nickel-coated to resist corrosion, oxidation, and electrochemical pitting.
5 cm x 4 cm Sizable Sensing Area
Broad surface grid captures first incoming raindrops within seconds of storm onset.
Remote Module Separation
Sensing board can be mounted outdoors while the sensitive comparator PCB stays dry inside.
Wide 3.3V–5V Power Range
Compatible with both standard 5V Arduino boards and low-power 3.3V IoT platforms.
Components Required
| Component | Quantity | Engineering Purpose |
|---|---|---|
| Raindrop & Surface Moisture Module | 1x | Primary physical environmental sensing module |
| Arduino Uno R3 or ESP32 DevKit | 1x | Microcontroller for ADC sampling and digital processing |
| Solderless Breadboard (830 tie-points) | 1x | Prototyping circuit layout and common power rail distribution |
| Jumper Wires (Male-to-Male, Male-to-Female) | 6x | Interconnecting microcontroller GPIO, power, and ground |
| Decoupling Capacitor (100nF Ceramic) | 1x | Filtering power rail high-frequency switching transient noise |
| Pull-up / Current Limiting Resistor (10kΩ / 220Ω) | 1x | Level conditioning and bus stability |
Pin Configuration & Connection Diagram
VCC
3.3V to 5V DC power supply line.
GND
Common 0V circuit ground return reference.
DO
Digital Output pin. Active LOW when surface moisture exceeds potentiometer threshold.
AO
Analog Output pin. Outputs high voltage (~5V) when bone dry, dropping toward 0V when saturated.
| Sensor Pin | Arduino Uno | ESP32 Node | Signal Description |
|---|---|---|---|
| VCC | Digital Pin 7 (Switched Power) | GPIO 25 (Switched) | Power via GPIO pin to enable pulsed power and prevent galvanic trace electrolysis. |
| GND | GND | GND | Common reference ground. |
| AO | Analog In A0 | GPIO 34 (ADC1 input-only) | Analog voltage representing moisture level (5V = Dry, <1.5V = Heavy Rain). |
| DO | Digital Pin 2 (Interrupt 0) | GPIO 4 | Digital comparator alarm output for immediate roof/window motor activation. |
Electrical Best Practices & Noise Mitigation:
- When wiring the Raindrop & Surface Moisture, ensure power leads are kept short to minimize stray loop inductance and inductive bounce during rapid current draw changes.
- If using an analog sensor output with a 3.3V microcontroller like an ESP32 or STM32, verify the maximum sensor output does not exceed 3.3V. If operating from a 5V supply, insert a 2:1 resistive voltage divider (e.g. 2kΩ / 1kΩ) on the signal line.
- Place a 100nF ceramic capacitor across the sensor VCC and GND pins as close to the module package as physically possible to shunt high-frequency ripple generated by nearby motors, servos, or Wi-Fi transients.
Working Principle & Mathematical Modeling
Electrolytic Conduction Physics & Mitigation Strategies
Pure distilled water is a poor conductor, but natural raindrops dissolve atmospheric carbon dioxide, airborne minerals, and dust, creating weak carbonic acid and dissolved ions (H+, HCO3-, Na+, Cl-). These mobile electrolytes drastically lower electrical resistance across the interdigitated traces from >1 MΩ down to 10 kΩ–100 kΩ.
A critical engineering hazard with DC-powered resistive rain sensors is galvanic electrolysis: continuous DC current in the presence of water accelerates anode oxidation, destroying the nickel copper traces within days. Pulsing power to the sensor only during active ADC sampling extends board lifespan from weeks to years.
Rain Resistance & Electrolysis Equations:
Parallel Trace Resistance: R_total = (R_gap) / (Number of Bridging Droplets)
Faraday's Law of Electrolysis Mass Loss: m = (Q × M) / (F × z)
Pulsed Power Duty Cycle: Duty Cycle = (T_on / T_period) = (10 ms / 60,000 ms) = 0.016%
Rainfall Categorization: ADC > 900 (Dry), 600–900 (Light Mist), < 400 (Heavy Downpour)
Note: Always tilt the rain sensing board at a 30° to 45° angle to allow water runoff, preventing stagnant puddling from giving false rain readings after rainfall ceases.
Arduino & ESP32 Implementation Code
// Production-Grade Electrolysis-Protected Rain Sensor Driver
// Platform: Arduino Uno / ESP32 (volt-X Lab Implementation)
const int SENSOR_POWER_PIN = 7; // Digital pin powering sensor to prevent electrolysis
const int RAIN_ANALOG_PIN = A0; // Analog input reading moisture
const int SERVO_TRIGGER_PIN = 9;// Controls motorized window / awning
const unsigned long READ_INTERVAL = 10000; // Read every 10 seconds
unsigned long lastCheckTime = 0;
void setup() {
Serial.begin(115200);
pinMode(SENSOR_POWER_PIN, OUTPUT);
digitalWrite(SENSOR_POWER_PIN, LOW); // Keep powered OFF until reading
pinMode(SERVO_TRIGGER_PIN, OUTPUT);
digitalWrite(SERVO_TRIGGER_PIN, LOW);
Serial.println(F("Electrolysis-Protected Rain Monitoring System Online"));
}
int readRainSensorWithPulsedPower() {
// 1. Energize the sensor rail briefly
digitalWrite(SENSOR_POWER_PIN, HIGH);
delay(15); // Allow comparator and RC filter to settle
// 2. Perform analog reading
int adcValue = analogRead(RAIN_ANALOG_PIN);
// 3. Immediately de-energize the sensor to eliminate DC current flow
digitalWrite(SENSOR_POWER_PIN, LOW);
return adcValue;
}
void loop() {
unsigned long now = millis();
if (now - lastCheckTime >= READ_INTERVAL) {
lastCheckTime = now;
int rainLevel = readRainSensorWithPulsedPower();
float voltage = (rainLevel / 1023.0f) * 5.0f;
Serial.print(F("Rain Sensor ADC: "));
Serial.print(rainLevel);
Serial.print(F(" | Sensor Tap: "));
Serial.print(voltage, 2);
Serial.print(F("V | Status: "));
if (rainLevel > 900) {
Serial.println(F("☀️ Bone Dry (Clear Skies)"));
digitalWrite(SERVO_TRIGGER_PIN, LOW);
} else if (rainLevel > 650) {
Serial.println(F("🌧️ Light Mist / Drizzle Detected"));
digitalWrite(SERVO_TRIGGER_PIN, LOW);
} else if (rainLevel > 350) {
Serial.println(F("⛈️ Moderate Rain (Retracting Awning)"));
digitalWrite(SERVO_TRIGGER_PIN, HIGH);
} else {
Serial.println(F("🌊 Heavy Downpour! Emergency Close Active!"));
digitalWrite(SERVO_TRIGGER_PIN, HIGH);
}
}
}Code Architecture Breakdown:
- Pulsed Power Power-Gating: Powers the sensor via digital pin 7 for only 15 milliseconds per sample. This 0.15% duty cycle eliminates galvanic corrosion and increases board life by 500x.
- Multi-Tier Categorization: Divides ADC readings into Clear, Drizzle, Moderate Rain, and Heavy Downpour for graduated smart home actions.
- Automatic Actuator Control: Triggers motorized awning retraction or skylight closing when rainfall exceeds the moderate precipitation threshold.
- Non-Blocking Execution: Runs on a 10-second timer without blocking the loop, allowing other IoT tasks to execute in parallel.
Real-World Engineering Applications
Automated Smart Skylight & Window Closers
Detects initial raindrops and automatically triggers stepper motors to close residential roof windows before rain enters.
Smart Agriculture & Irrigation Suppression
Suspends scheduled lawn sprinkler timers when natural rainfall is detected, conserving municipal water.
Automotive Automatic Windshield Wipers
Detects precipitation density on glass surfaces to control variable-speed windshield wiper motor relays.
Solar Panel Protection & Awning Retraction
Retracts outdoor canvas awnings and patio umbrellas during heavy rainstorms to prevent wind and water weight tears.
✅ Engineering Advantages
- Immediate microsecond detection of first raindrop impact on dry surface.
- Extremely inexpensive, widely available, and simple to interface with any microcontroller.
- Remote sensing board allows high-voltage electronic components to remain indoors protected from weather.
⚠️ Physical Constraints & Limitations
- Prone to rapid galvanic electrochemical corrosion if powered with continuous DC voltage.
- Stagnant water droplets remain on horizontal boards after rainfall ceases, causing lingering false positives.
- Does not measure rainfall accumulation volume in millimeters (requires a tipping bucket rain gauge).
Diagnostic & Troubleshooting Guide
| Fault / Symptom | Probable Root Cause | Corrective Action |
|---|---|---|
| Sensing board traces turn green/black and stop conducting after two weeks | Galvanic electrolysis caused by continuous 5V DC power applied to the wet traces. | Replace the board and implement pulsed GPIO power gating in your code as demonstrated. |
| Sensor reports rain long after the storm has ended and the sun is out | The sensing board is mounted completely flat, causing water puddles to stay trapped between traces. | Mount the sensor at a 30° to 45° angle so gravity naturally drains water droplets away. |
| Digital output LED flickers erratically in light mist | Sensitivity potentiometer is positioned right on the edge of the comparator boundary. | Adjust the multiturn trimpot and introduce a software moving average filter in code. |
Frequently Asked Questions (EE/ECE Reference)
Q: How do you prevent the traces on a rain sensor from corroding and oxidizing?
The primary cause of rapid trace corrosion is galvanic electrolysis, which occurs when continuous DC voltage passes through conductive water. To prevent this, never connect the sensor directly to the 5V power rail. Instead, connect VCC to a digital microcontroller GPIO pin and only turn it HIGH for 10–15 milliseconds right before taking an analog reading, then immediately turn it LOW. This reduces current exposure by 99.9% and extends sensor life for years.
Q: Why should the rain sensor board be mounted at an angle rather than flat?
If mounted horizontally, water will puddle on the flat surface. Even after the rain stops and the weather clears, the pooled water will continue bridging the traces, causing the system to falsely report heavy rain for hours until the water fully evaporates. Mounting at a 30° to 45° angle ensures excess water drains off immediately, reflecting real-time precipitation.
Q: Can the FC-37 rain sensor measure total rainfall volume (e.g. in millimeters)?
No. The FC-37 is a surface presence and intensity detector, not a volumetric rain gauge. It measures whether it is currently raining and provides a rough estimate of droplet density. To measure total rainfall accumulation over time in millimeters or inches, an automated tipping bucket rain gauge or an acoustic disdrometer is required.
Q: How does the digital output (DO) pin compare to the analog output (AO) pin?
The AO pin outputs a continuous variable voltage from ~5V (completely dry) down to ~1.0V (drenched in water), allowing your code to distinguish between mist, drizzle, and downpours. The DO pin is a simple binary switch (HIGH or LOW) controlled by the onboard LM393 comparator; it trips LOW the moment water bridges the traces past the potentiometer threshold, making it ideal for hardware interrupts and direct relay triggering.