Skip to main content

Rain Drop Sensor Module

Arduino Rain Drop Sensor Module

drawn top view image of a 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

a drawn top view image of a connection between arduino uno and a  raindrop sensor module
          Analog Out ------------------------->Analog Pin A0 Of Arduino Uno
          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!!

Comments

Post a Comment

Popular posts from this blog

Arduino Real Time Clock Module DS3231

Arduino Real Time Clock Module DS3231 We all know most of the microcontrollers can measure time in milliseconds and perform tasks timely, But what if all of a sudden the power is lost even though if the power is back again all the times will be reset. Also most of the MCUs are unaware of the around them in this case the DS3231 Real time module will come in handy.            1 - Will provide a stable reference clock value            2 - This pin can be used as a interrupt.            3 - This line carries the serial clock signal(Serial Clock).            4 - This line will transmit and receive serial data(Serial Data).            5 - 3.3V-5V power input.            6 - Ground pin. Real Time Module to Arduino uno Connection SCl------------------------>Arduino SCL SDL------------------...