Rain Sensor Arduino Tutorial
Overview
In This Tutorial, I will show how you interface the Rain Sensor With Arduino Nano Microcontroller And How You Write the Code.
The Raindrop sensor module is used for rain detection.it is also for measuring rainfall intensity you also used to all kinds of weather monitoring systems.
Rain Sensor can be used to monitor a variety of weather conditions and turned int several fixed output signal and analog output.
rain Seno is also in blut the LM393 Voltage comparator in and is operating Voltage is 5v.
Rain Sensor
Rain Drop sensor Are collected on the circuit board they created paths of parallel resistance that measure the op-amp .
The Lower Resistence the lower the voltage output .If the Less Water the greater output voltage on the analog PIN A0.
Features:-
- TTL Compatible
- Both Digital And Analog Output
- Output LED Indicator
- LM393 Voltage Comparator
- Compatible With Arduino,Esp8266,Esp32 And STM32.
Rain Sensor Pinout
Wiring Diagram Rain Sensor With Arduino
Testing of Rain Sensor
Display Rain Sensor Reading In Serial Monitor
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#define sensorPower 4 #define sensorPin 10 void setup() { pinMode(sensorPower, OUTPUT); digitalWrite(sensorPower, LOW); Serial.begin(9600); } void loop() { int val = readSensor(); Serial.print("Digital Output: "); Serial.println(val); if (val) { Serial.println("Sensor Status: Clear"); } else { Serial.println("Sensor Status: It's raining"); } delay(1000); Serial.println(); } int readSensor() { digitalWrite(sensorPower, HIGH); delay(10); int val = digitalRead(sensorPin); digitalWrite(sensorPower, LOW); return val; } |
Display Rain Sensor Reading In LCD Display
Code
If You are Interested In More Projects Then Plz Check Out
- Vehicle Accident Alert System
- DIY Ventilator Using Arduino
- Arduino Based Blind Stick With GPS And GSM
- Dam Monitoring System Using Arduino
Video