Monday, 22 January 2018

Rainfall Sensor – How to Use it?

Rainfall Sensor

Introduction:

Rainfall sensor is a very compact sensor which is used to detect droplets. This module allows us to measure moisture with the help of analog output pins and it provides a digital output when a threshold of moisture is exceeded. 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 rain drops are collected on the circuit board, they create paths of parallel resistance that are measured via the op amp.
The lower the resistance (or the more water), the lower the voltage output. Conversely, the less water, the greater the output voltage on the analog pin.

Usage:

Rainfall sensors are most commonly used in Irrigation field, Wiper control, Industrial area, Rain water harvesting etc.

Application:

Project for Reference:


Code:

Code to get analog value
int nRainIn = A1;
int nRainDigitalIn = 2;
int nRainVal;
boolean bIsRaining = false;
String strRaining;


void setup() {
  Serial.begin(9600);
  pinMode(2,INPUT);
}
void loop() {
  nRainVal = analogRead(nRainIn);
  bIsRaining = !(digitalRead(nRainDigitalIn));
  
  if(bIsRaining){
    strRaining = "YES";
  }
  else{
    strRaining = "NO";
  }
  
  Serial.print("Raining?: ");
  Serial.print(strRaining);  
  Serial.print("\t Moisture Level: ");
  Serial.println(nRainVal);
  
  delay(200);

}

No comments:

Post a Comment

SMART BLIND STICK The smart blind stick is the project made to help the blind people who is suffering when walking.It just uses to de...