Rain Sensor Module
Rain Sensor Module
Description
The rain sensor module is an easy tool for rain detection. It can be used as a
switch when raindrop falls through the raining board and also for measuring rainfall
intensity. The module features, a rain board and the control board that is separate for
more convenience, power indicator LED and an adjustable sensitivity though a
potentiometer.
switch indicator will turn on. Brush off the water droplets, and when restored to the initial
state, outputs high level.
Specifications
Comparator output signal clean waveform is good, driving ability, over 15mA;
Output format: Digital switching output (0 and 1) and analog voltage output AO;
Pin Configuration
1
2
3
4
1. VCC: 5V DC
2. GND: ground
3. DO: high/low output
4. AO: analog output
Wiring Diagram
12 34
Schematic Diagram
Sample Sketch
void setup(){
Serial.begin(9600);
pinMode(2, OUTPUT);
}
void loop(){
//analog output
if(analogRead(0)<300) Serial.println("Heavy Rain");
else if(analogRead(0)<500) Serial.println("Moderate Rain");
else Serial.println("No Rain");
// //digital output
// if(digitalRead(2) == HIGH) Serial.println("No Rain
Detected");
// else Serial.println("Rain Detected");
delay(250);
}
How to Test
Testing Results
The serial monitor shows the results when the raining module was
soaked with water. Based on the amount of water, the analog output can
read different levels of amount of water drop.