Arduino Rain Drop Sensor Module
Rainfall is an important factor for some advanced as well as some simple projects such as a automatic irrigation system, Rainfall intensity detection system, auto rain sensing wipers and various other projects. Rain drop sensor module has Nickel strips laid parallel to each other. Since water is a conductor it reduces the resistance and the voltage drop between two parallel Nickel strips. This principle is basically used to sense the presence of Water.
1 - Outputs a analog voltage relative to the amount of rainfall
2 - Digital output (HIGH or LOW)
3 - Ground pin
4 - 5V Power input
Rain drop sensor to Arduino Uno Connections
Digital Out-------------------------->Digital Pin 2 Of Arduino Uno
5V------------------------------------>5V Pin Of Arduino
Ground pin-------------------------->GND Of Arduino
Code Segment To Get The Readings
Once we have wired up everything correct, Let's move to the next important step reading the output from the sensor.
Reading The Analog Output
int analogVal;
void setup() {
pinMode(A0,INPUT); //Declaring the pin A0 as input
pinMode(2,INPUT); //Declaring pin D2 ad input
Serial.begin(9600);
}
void loop() {
analogVal = analogRead(A0); //reading the analog input from A0 and assigning the value to the variable analogVal
Serial.print(analog_val); //printing the above stored variable values in the serial monitor
}
Reading The Digital Output
int digitalVal
void setup() {
pinMode(A0,INPUT); //Declaring the pin A0 as input
pinMode(2,INPUT); //Declaring pin D2 ad input
Serial.begin(9600);
}
void loop() {
digitalVal = digitalRead(A0); //reading the digital input from A0 and assigning the value to the variable analogVal
Serial.print(digital_Val); //printing the above stored variable values in the serial monitor
}
Just as simple as that. Feel free to ask and clarify any doubts in the comment section below!!!!!
CHEERS!!
π very useful
ReplyDeleteπππ
Deleteπ Good Explanation
ReplyDeleteπππthank u
Delete