This channel is only for knowledge sharing to help the community.
if you like video please subscribe share and like
#raindropsensormodule
#rain
#raindetection
#skillchargewithanurag
In this project you learn about rain detection sensor module with Arduino interfacing and coding and learn how to make simple rain detection alarm system for your school projects.
if you want to explore more must watch full video
thankyou
project code-
/***SKILL CHARGE WITH ANURAG***/
/***RAIN DETECTION ALARM***/
int rainDigitalPin = 3;
int redLED = 12;
int alarm = 10; //PWM (~) Pin
int greenLED = 11;
void setup(){
pinMode(rainDigitalPin, INPUT);
pinMode(alarm, OUTPUT);
pinMode(redLED, OUTPUT);
digitalWrite(alarm, LOW);
digitalWrite(redLED, LOW);
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 0:
int sensorAnalogValue = analogRead(rainAnalogPin);
Serial.print("Rain sensor analog value: ");
Serial.println(sensorAnalogValue);
// read the input on digital pin 2:
int sensorDigitalValue = digitalRead(rainDigitalPin);
Serial.print("Rain sensor digital value: ");
Serial.println(sensorDigitalValue);
//digital output
if(sensorDigitalValue == LOW) //High means rain detected; In some case vise versa
{
digitalWrite(redLED, HIGH);
tone(alarm, 2000); //the buzzer sound frequency at 5000 Hz
Serial.println("Rain Detected");
}
else {
digitalWrite(redLED, LOW);
noTone(alarm);
Serial.println("No Rain Detected");
}
delay(250);
}
Anurag gaur
Негізгі бет RAIN Alert alarm system/ RAIN DETECTION SENSOR MODULE with Arduino FULL DETAILS|DIY project
No video
Пікірлер