Тёмный

RAIN Alert alarm system/ RAIN DETECTION SENSOR MODULE with Arduino FULL DETAILS|DIY project 

SKILL CHARGE WITH ANURAG
Подписаться 718
Просмотров 169
50% 1

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

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Starman🫡
00:18
Просмотров 11 млн
Fake watermelon by Secret Vlog
00:16
Просмотров 8 млн
How IR Sensor Works | DIY IR Sensor Module | Part-1
16:27
I built my own computer. by hand.
13:03
Просмотров 1,2 млн
Raindrop alarm without Arduino || school project
8:01