sensor-experiments

Introduction

This experiment demonstrates how to measure rain intensity using a raindrop sensor with Arduino.

Components Needed

No Ads Available.

Circuit Setup

  1. Connect the raindrop sensor's output pin to a digital input pin on the Arduino.
  2. Connect VCC and GND to the Arduino's 5V and GND pins.

The sensor detects the number of raindrops falling through the sensor's surface, allowing you to calculate rain intensity.

Code for Rain Intensity Measurement

Upload the following code to your Arduino to measure rain intensity:


const int sensorPin = 2; // Connect the raindrop sensor to pin 2
int rainDetected = 0;

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

void loop() {
  rainDetected = digitalRead(sensorPin);
  if (rainDetected == HIGH) {
    Serial.println("Rain Detected!");
  } else {
    Serial.println("No Rain.");
  }
  delay(1000);
}
            

Explanation

The sensor detects rain by measuring the change in electrical conductivity when raindrops fall on it, allowing the Arduino to output rain intensity data.

Troubleshooting

Contact Us

If you have any questions or inquiries, feel free to reach out to us at Microautomation.no@icloud.com .

Follow our Socials for the newest updates!