Whether you’re building an automated greenhouse, a smart irrigation system, or simply want to detect the first drops of rain on your weather station — the Raindrop Detection Module (MH-RD) is your go-to sensor. In this guide, you’ll learn everything about this sensor, its pinout, applications, and how to use it in real-world IoT projects.

What is the Raindrop Detection Module?
The MH-RD rain sensor is a low-cost module designed to detect water presence. It consists of two main components:
1. Sensor Plate (Rain Board)
This is a PCB with exposed parallel copper traces. When raindrops fall onto the board, they create a conductive path between the traces — allowing current to flow. The more water, the lower the resistance.
2. Signal Conditioning Board
This blue breakout board includes an LM393 voltage comparator, sensitivity potentiometer, digital/analog outputs, and indicator LED’s. It converts the analog signal from the sensor plate into a clean digital output.
Designed for Weather Awareness
The module is optimized for detecting water and integrating into control systems. It’s often used in:
- Rain alarms
- Window closing automation
- Agricultural automation
- Smart weather stations
- Car windshield sensors (DIY-style)
Key Features
- Analog output (AO): Returns a voltage relative to moisture level.
- Digital output (DO): High or Low depending on threshold set by the onboard potentiometer.
- Onboard LM393 comparator: For digital switching logic.
- LED indicators: Power and digital output status.
- Voltage Range: 3.3V – 5V compatible (perfect for ESP32, Arduino, Raspberry Pi).
- Mounting holes: For easy fixture in outdoor enclosures.
MH-RD Raindrop Sensor Module Pinout
Here’s a breakdown of the pin labels and their function:
Pin | Label | Description |
---|---|---|
1 | AO | Analog output signal (variable) |
2 | DO | Digital output signal (0 or 1) |
3 | GND | Ground |
4 | VCC | Power supply (3.3V to 5V) |
How it Works
Dry Condition:
No water between the tracks → high resistance → low analog voltage → digital output is HIGH (no rain).
Wet Condition:
Water bridges the copper tracks → lower resistance → higher analog voltage → digital output goes LOW (rain detected). The potentiometer sets the threshold at which the digital output flips.
Practical Applications
Smart Weather Station: Detect rainfall and log precipitation events to cloud dashboards via ESP32/ESP8266.
Auto Window Closer: Trigger relays or motors to shut windows when rain is detected.
Irrigation System: Interrupt watering if it’s already raining — saving water.
Home Automation: Combine with temperature/humidity for full weather-aware automation.
How to Use It (with ESP32 / Arduino)
Wiring (ESP32 example):
MH-RD Pin | ESP32 Pin |
---|---|
AO | GPIO34 |
DO | GPIO26 |
GND | GND |
VCC | 3.3V |
Note: GPIO34 is input-only on the ESP32 — perfect for analog reads.
Sample Arduino Code
#define RAIN_ANALOG 34
#define RAIN_DIGITAL 26
void setup() {
Serial.begin(115200);
pinMode(RAIN_DIGITAL, INPUT);
}
void loop() {
int analogValue = analogRead(RAIN_ANALOG);
int digitalValue = digitalRead(RAIN_DIGITAL);
Serial.print("Analog: ");
Serial.print(analogValue);
Serial.print(" | Digital: ");
Serial.println(digitalValue ? "Dry" : "Rain Detected");
delay(500);
}
Best Practices & Tips
- Corrosion: Prolonged outdoor use causes oxidation of the sensor plate. Use a conformal coating or replace the sensor periodically.
- Positioning: Angle the plate slightly so water doesn’t pool.
- Debouncing: Add software debouncing to handle false triggers due to splashes or brief contact.
- Protection: Enclose the electronics (not the plate!) in waterproof enclosures like IP65-rated boxes.
Conclusion: Raindrop Ready
The MH-RD Raindrop Detection Module is an ideal sensor for beginners and professionals alike. With simple wiring, both analog and digital outputs, and onboard logic, it’s one of the most accessible weather sensors in the maker ecosystem.
Pair it with an ESP32 and you’ve got a weather-smart IoT device — capable of protecting your windows, garden, or greenhouse from unpredictable rain.