How to Use a Rain Sensor

How to Use a Rain Sensor

This project will show you how to use a rain sensor.

  • 30,045 views
  • 3 comments
  • 19 respects

Components and supplies

Apps and online services

About this project

Operation

A rain sensor is composed of a rain detection plate with a comparator who manages intelligence.

The rain sensor detects water that comes short circuiting the tape of the printed circuits.

The sensor acts as a variable resistance that will change status : the resistance increases when the sensor is wet and the resistance is lower when the sensor is dry.

The comparator has 2 outputs connected to the rain sensor, a digital output ( 0/1 ) and an analog output ( 0 to 1023 ).

Sensor characteristics

  • Voltage : 3, 3v-5v
  • Sensor Dimension : 3.9 x 5.4 cm
  • Sensitivity potentiometer
  • 2 control leds

Connections

Arduino --> Comparator

5V --> VCC

GND --> GND

DO --> D4

AO --> A0

For the other two connections...

Adjust the sensitivity

You can also adjust the sensitivity by turning the potentiometer present on the comparator. So the detection can be realize on a drop or in a glass of water.

Code

Code for Rain sensor Arduino
const int capteur_D = 4;
const int capteur_A = A0;

int val_analogique;

void setup()
{
  pinMode(capteur_D, INPUT);
  pinMode(capteur_A, INPUT);
  Serial.begin(9600);
}

void loop()
{
if(digitalRead(capteur_D) == LOW) 
  {
    Serial.println("Digital value : wet"); 
    delay(10); 
  }
else
  {
    Serial.println("Digital value : dry");
    delay(10); 
  }
val_analogique=analogRead(capteur_A); 
 Serial.print("Analog value : ");
 Serial.println(val_analogique); 
 Serial.println("");
  delay(1000);
}

Comments

Similar projects you might like

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Mako

  • 25,183 views
  • 7 comments
  • 25 respects

How to Use a Soil Moisture Sensor

by MisterBotBreak

  • 88,362 views
  • 13 comments
  • 60 respects

DHT11 Temperature/Humidity Sensor

Project tutorial by Zachary Haslam

  • 173,421 views
  • 52 comments
  • 114 respects

How To Use DS18B20 Water Proof Temperature Sensor

Project showcase by Team IoTBoys

  • 152,678 views
  • 25 comments
  • 36 respects

Getting Started with the HC-SR04 Ultrasonic sensor

by Isaac100

  • 135,809 views
  • 34 comments
  • 88 respects
Add projectSign up / Login