Interfacing of Rain Drop Sensor with Arduino Uno.
What is a Rain Drop Sensor?
A raindrop sensor is a board on which nickel is coated in the form of lines. It works on the principle of resistance. The rain Sensor module allows the measurement of moisture via analog output pins and it provides a digital output when a threshold of moisture exceeds. The module is based on the LM393 op amp. It includes the electronics module and a printed circuit board that “collects” the rain drops. As raindrops are collected on the circuit board, they create paths of parallel resistance that are measured via the op amp.
Material Required:
Material Quantity
Arduino Uno 1
Raindrop sensor 1
Jumper cables 4
Pinout Diagram:
Circuit Diagram:
Vcc +5 Volts Power Source
GND Ground or negative power source
A0 Analog Output – A0
Tested Programming Code:
const int sensorMin = 0;
const int sensorMax = 1024;
void setup()
{
Serial.begin(9600);
}
void loop()
{
int sensorReading = analogRead(A0);
int range = map(sensorReading, sensorMin, sensorMax, 0, 3); switch (range)
{
case 0:
Serial.println("RAINING");
break;
case 1:
Serial.println("RAIN WARNING");
break;
case 2:
Serial.println("NOT RAINING");
break;
}
delay(1000);
}
Precautions:
Double-check the connections before powering on the circuit.
Don’t use loose jumper cables.
Check whether the proper board is selected from Arduino IDE.
Ensure proper placement of Rain drop Sensor for correct working.
Don’t lose hope if Rain Drop Sensor does not run properly for the first time, try again.
Conclusion:
Once your sketch is running, you have to open your serial monitor. There you can see the Moisture or Rain on the Board.