Table of Contents

Play Video

ARDUINO RAIN PROTECT

The Arduino Rain Protect project automates the protection of outdoor clothes drying using a raindrop sensor, servo motor, and Arduino. When rain is detected, the system activates a cover to shield the clothes, preventing them from getting wet. It's an efficient, automated solution for home rain protection.
The Arduino Rain Protect project is designed to automate the process of protecting household items and spaces from rain using a raindrop sensor, a servo motor, and an Arduino microcontroller. This project is particularly useful for preventing rain damage to clothes left to dry outside, open windows, or garden equipment.
At the heart of the project is the Arduino microcontroller, which serves as the central control unit. The raindrop sensor is a key component that detects the presence of rain. When raindrops fall on the sensor, it sends a signal to the Arduino, indicating that it is raining. The Arduino then processes this signal and activates a servo motor.
The servo motor is connected to a mechanical system, such as an umbrella-like cover or a sliding mechanism, designed to protect the target area or items. For instance, if the project is used to protect clothes drying on a clothesline, the servo can pull a cover over the clothes when rain is detected. This ensures that clothes remain dry even during unexpected showers. Similarly, it can be used to close windows or cover garden furniture automatically.
Components required for this project include:
– Arduino Uno
– Raindrop sensor module
– Servo motor
– Breadboard and jumper wires
– Power supply (batteries or a power adapter)
– Mechanical parts for the cover or sliding mechanism
This automated system provides a convenient and reliable way to protect household items from rain without manual intervention. It’s especially useful in scenarios where quick response to rain is crucial. By implementing this project, users can prevent water damage and reduce the inconvenience caused by sudden rain showers. The Arduino Rain Protect project showcases the practical application of microcontroller technology in everyday life, enhancing home automation and protection, particularly for drying clothes outdoors.
#include <Servo.h>

#define RAIN_SENSOR_PIN A0 // Arduino pin connected to rain sensor's pin 

#define SERVO_PIN       9  // Arduino pin connected to servo motor's pin 

Servo servo; // create servo object to control a servo

// variables will change:

int angle = 0;          // the current angle of servo motor

int prev_rain_state;    // the previous state of rain sensor

int rain_state; // the current state of rain sensor

void setup() {

  Serial.begin(9600);                // initialize serial

  pinMode(RAIN_SENSOR_PIN, INPUT); // set arduino pin to input mode

  servo.attach(SERVO_PIN);           // attaches the servo on pin 9 to the servo object

  servo.write(angle);

  rain_state = digitalRead(RAIN_SENSOR_PIN);

}
void loop() {

  prev_rain_state = rain_state;             // save the last state

  rain_state = digitalRead(RAIN_SENSOR_PIN); // read new state

  if (rain_state == LOW && prev_rain_state == HIGH) { // pin state change: LOW -> HIGH

    Serial.println("Rain detected!");

    servo.write(90);

  }

  else

    if (rain_state == HIGH && prev_rain_state == LOW) { // pin state change: HIGH -> LOW

      Serial.println("Rain stopped!");

      servo.write(0);

    }

}

 
Scroll to Top