Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MH-RD Rain Sensor: Examples, Pinouts, and Specs

Image of MH-RD Rain Sensor
Cirkit Designer LogoDesign with MH-RD Rain Sensor in Cirkit Designer

Introduction

The MH-RD Rain Sensor is a simple yet effective electronic component designed to detect the presence of rain. It consists of a rain detection board and a control module. When rainwater comes into contact with the detection board, the sensor outputs a signal that can be used in various applications. This sensor is commonly used in automated irrigation systems, weather monitoring stations, and smart home projects to prevent unnecessary watering or to trigger alerts during rainfall.

Explore Projects Built with MH-RD Rain Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano-Based Rain Detection and Light Sensing System
Image of smart window: A project utilizing MH-RD Rain Sensor in a practical application
This circuit features an Arduino Nano microcontroller connected to a rain sensor and a photocell (LDR) for environmental sensing, and a Tower Pro SG90 servo for actuation. The rain sensor's analog output (AO) is connected to the Arduino's analog input (A0) to measure rain intensity, while the photocell is connected to another analog input (A1) through a 220-ohm resistor to measure light levels. The servo is controlled by a digital output (D2) from the Arduino, and all components share a common power supply from the Arduino's 5V and ground (GND) pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Based Weather Monitoring System with Rain Sensor and DHT11
Image of projekmikro: A project utilizing MH-RD Rain Sensor in a practical application
This circuit features an Arduino UNO microcontroller interfaced with a rain sensor, a DHT11 temperature and humidity sensor, and a servo motor (MG996R). Two LEDs with series resistors are connected to digital pins for indication purposes. The rain sensor's digital output is connected to the Arduino, as is the DHT11 data line, and the servo motor is controlled via a signal line from the Arduino. The code provided for the Arduino is a template with empty setup and loop functions, indicating that the specific functionality is yet to be implemented.
Cirkit Designer LogoOpen Project in Cirkit Designer
Rain Sensor Alarm System with Buzzer and 9V Battery
Image of Rain water sensor: A project utilizing MH-RD Rain Sensor in a practical application
This circuit is a rain detection system that uses a rain sensor to detect moisture and activates a buzzer when rain is detected. The system is powered by a 9V battery, which supplies power to both the rain sensor and the buzzer.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Environmental Monitoring System with DHT11, LDR, and Rain Sensor
Image of snsors: A project utilizing MH-RD Rain Sensor in a practical application
This circuit is a weather monitoring system using an ESP32 Devkit V1 microcontroller. It includes a DHT11 sensor for measuring temperature and humidity, an LDR photoresistor for detecting light levels, and a rain sensor for detecting precipitation. The ESP32 reads analog values from the rain sensor and photoresistor, and digital humidity and temperature data from the DHT11, then outputs the sensor readings via serial communication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MH-RD Rain Sensor

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of smart window: A project utilizing MH-RD Rain Sensor in a practical application
Arduino Nano-Based Rain Detection and Light Sensing System
This circuit features an Arduino Nano microcontroller connected to a rain sensor and a photocell (LDR) for environmental sensing, and a Tower Pro SG90 servo for actuation. The rain sensor's analog output (AO) is connected to the Arduino's analog input (A0) to measure rain intensity, while the photocell is connected to another analog input (A1) through a 220-ohm resistor to measure light levels. The servo is controlled by a digital output (D2) from the Arduino, and all components share a common power supply from the Arduino's 5V and ground (GND) pins.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of projekmikro: A project utilizing MH-RD Rain Sensor in a practical application
Arduino UNO Based Weather Monitoring System with Rain Sensor and DHT11
This circuit features an Arduino UNO microcontroller interfaced with a rain sensor, a DHT11 temperature and humidity sensor, and a servo motor (MG996R). Two LEDs with series resistors are connected to digital pins for indication purposes. The rain sensor's digital output is connected to the Arduino, as is the DHT11 data line, and the servo motor is controlled via a signal line from the Arduino. The code provided for the Arduino is a template with empty setup and loop functions, indicating that the specific functionality is yet to be implemented.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Rain water sensor: A project utilizing MH-RD Rain Sensor in a practical application
Rain Sensor Alarm System with Buzzer and 9V Battery
This circuit is a rain detection system that uses a rain sensor to detect moisture and activates a buzzer when rain is detected. The system is powered by a 9V battery, which supplies power to both the rain sensor and the buzzer.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of snsors: A project utilizing MH-RD Rain Sensor in a practical application
ESP32-Based Environmental Monitoring System with DHT11, LDR, and Rain Sensor
This circuit is a weather monitoring system using an ESP32 Devkit V1 microcontroller. It includes a DHT11 sensor for measuring temperature and humidity, an LDR photoresistor for detecting light levels, and a rain sensor for detecting precipitation. The ESP32 reads analog values from the rain sensor and photoresistor, and digital humidity and temperature data from the DHT11, then outputs the sensor readings via serial communication.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

  • Operating Voltage: 3.3V to 5V
  • Output Type: Digital and Analog
  • Output Voltage:
    • Digital: 0V (rain detected) or 5V (no rain detected)
    • Analog: Varies based on the amount of water on the detection board
  • Current Consumption: < 20mA
  • Dimensions:
    • Control Module: 3.1cm x 1.5cm
    • Detection Board: 5.4cm x 4.0cm
  • Interface: 3-pin header (VCC, GND, OUT)

Pin Configuration and Descriptions

Control Module

Pin Name Description
VCC Power supply input (3.3V to 5V)
GND Ground connection
OUT Output signal (digital or analog, depending on the connection used)

Detection Board

Pin Name Description
S Signal pin connected to the control module
+ Power supply input (connected to VCC on the control module)
- Ground connection (connected to GND on the control module)

Usage Instructions

How to Use the MH-RD Rain Sensor in a Circuit

  1. Connect the Detection Board to the Control Module:
    • Use the included jumper wires to connect the S, +, and - pins of the detection board to the corresponding pins on the control module.
  2. Connect the Control Module to Your Microcontroller:
    • Connect the VCC pin to a 3.3V or 5V power source.
    • Connect the GND pin to the ground of your circuit.
    • Connect the OUT pin to a digital or analog input pin on your microcontroller.
  3. Adjust the Sensitivity:
    • Use the potentiometer on the control module to adjust the sensitivity of the sensor. Turning the potentiometer clockwise increases sensitivity, while turning it counterclockwise decreases sensitivity.

Important Considerations and Best Practices

  • Placement: Ensure the detection board is placed in an open area where it can directly come into contact with rain. Avoid placing it under obstructions like roofs or tree canopies.
  • Waterproofing: While the detection board is designed to detect rain, prolonged exposure to water can cause corrosion. Consider using a protective coating or regularly cleaning the board to maintain its functionality.
  • Power Supply: Use a stable power source to avoid erratic readings.
  • Signal Filtering: If using the analog output, consider adding a low-pass filter to smooth out noise in the signal.

Example Code for Arduino UNO

// MH-RD Rain Sensor Example Code for Arduino UNO
// This code reads both the digital and analog outputs of the sensor
// and prints the results to the Serial Monitor.

const int digitalPin = 2; // Digital output pin from the sensor
const int analogPin = A0; // Analog output pin from the sensor

void setup() {
  pinMode(digitalPin, INPUT); // Set digital pin as input
  Serial.begin(9600);         // Initialize serial communication
}

void loop() {
  int digitalValue = digitalRead(digitalPin); // Read digital output
  int analogValue = analogRead(analogPin);   // Read analog output

  // Print the sensor readings to the Serial Monitor
  Serial.print("Digital Output: ");
  Serial.print(digitalValue); // 0 = Rain detected, 1 = No rain
  Serial.print(" | Analog Output: ");
  Serial.println(analogValue); // Varies based on water level

  delay(1000); // Wait for 1 second before the next reading
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output Signal:

    • Cause: Loose connections or incorrect wiring.
    • Solution: Double-check all connections between the detection board, control module, and microcontroller.
  2. Erratic Readings:

    • Cause: Electrical noise or unstable power supply.
    • Solution: Use a decoupling capacitor (e.g., 0.1µF) across the power supply pins to stabilize the voltage.
  3. Corrosion on the Detection Board:

    • Cause: Prolonged exposure to water.
    • Solution: Clean the board with isopropyl alcohol and apply a waterproof coating.
  4. Sensor Not Detecting Rain:

    • Cause: Sensitivity set too low.
    • Solution: Adjust the potentiometer on the control module to increase sensitivity.

FAQs

  • Q: Can the sensor detect the intensity of rainfall?
    A: Yes, the analog output provides a variable signal that corresponds to the amount of water on the detection board, which can be used to estimate rainfall intensity.

  • Q: Is the sensor suitable for outdoor use?
    A: The detection board is designed for outdoor use, but it is recommended to protect it from prolonged exposure to water to prevent corrosion.

  • Q: Can I use the sensor with a 3.3V microcontroller?
    A: Yes, the sensor operates at both 3.3V and 5V, making it compatible with most microcontrollers.

  • Q: How do I clean the detection board?
    A: Use a soft cloth and isopropyl alcohol to gently clean the board. Avoid using abrasive materials.