RAIN DROP SENSOR
RAIN DROP SENSOR
The rain drop sensor module is used for rain detection. It can be
used as a switch when raindrop falls through the raining board and also for
measuring rainfall intensity. The analog output of raindrop is used in
detection of drops in the amount of rainfall. Now, we can
interface rain drop sensor with Arduino to automatically identify the rain.
Application:
- It is used to detect Rain Drop.
- It can be used as Car Wiper Control.
- It can be used as Condensation Sensing.
Sample Project With Arduino:
In this we going to turn ON red LED & OFF green LED whenever it is raining outside and turn ON green LED & OFF red LED whenever it is not raining.
Material required:
- ARDUINO UNO Board
- Rain Sensor
- Red LED
- Green LED
- Bread Board
- 2 x 220 ohms resistors
- Jumper Wires
Circuit:
Code:
int rainPin = A0;
int greenLED = 6;
int redLED = 7;
int thresholdValue = 500; // you can adjust the threshold value
void setup(){
pinMode(rainPin, INPUT);
pinMode(greenLED, OUTPUT);
pinMode(redLED, OUTPUT);
digitalWrite(greenLED, LOW);
digitalWrite(redLED, LOW);
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(rainPin); // read the input on analog pin 0:
Serial.print(sensorValue);
if(sensorValue < thresholdValue){
Serial.println(" - It's wet");
digitalWrite(greenLED, LOW);
digitalWrite(redLED, HIGH);
}
else {
Serial.println(" - It's dry");
digitalWrite(greenLED, HIGH);
digitalWrite(redLED, LOW);
}
delay(500);
}
Comments
Post a Comment