In this project, we demonstrate a fascinating and practical application of automation using the Arduino UNO R3, Servo Motor, and Rain Detection Sensor. The concept is simple yet effective—detect rain and automatically move clothes to a sheltered area, ensuring they stay dry. This project combines the power of IoT and automation, offering a smart solution to everyday problems.

How It Works:

The project relies on the Rain Detection Sensor and Servo Motor to automatically protect clothes from rainfall. The Rain Detection Sensor is connected to Pin 2 on the Arduino UNO, while the Servo Motor is connected to Pin 3. Here’s how it functions:

  1. Rain Detection Sensor:
    The Rain Detection Sensor continuously monitors the weather conditions. When it detects raindrops, it sends a signal to the Arduino board, indicating that rain has started. The sensor’s output pin goes LOW when moisture is detected, signaling the Arduino to trigger the movement mechanism.
  2. Arduino UNO R3:
    The Arduino UNO R3 serves as the brain of the system. When the Rain Sensor detects rain, the Arduino processes the signal and activates the connected Servo Motor. The motor then moves clothes, shifting them from the open space to a protected area under a roof or awning.
  3. Servo Motor Movement:
    The Servo Motor plays a critical role in this project, moving the clothes to the desired position once the rain is detected. The servo motor is programmed to rotate a specific angle, depending on the setup of your cloth movement mechanism.

Project Components:

  • Arduino UNO R3: The main microcontroller board used for processing and controlling the system.
  • Rain Detection Sensor: A moisture-sensing device that detects the presence of rain.
  • Servo Motor: A motor that helps move the clothes to safety when activated.
  • Jumper Wires: For connecting the components to the Arduino.
  • Clothesline or Cloth Hanger: For practical implementation of the project.

Code Overview :

#include <Servo.h>

// Define pin connections
const int rainSensorPin = 2; // Digital pin for rain sensor
Servo myServo;              // Create Servo object

void setup() {
  // Initialize pin modes
  pinMode(rainSensorPin, INPUT);

  // Attach the servo motor to pin D3
  myServo.attach(3);

  // Initialize servo position to 0 degrees
  myServo.write(0);

  // Start Serial Monitor (optional for debugging)
  Serial.begin(9600);
}

void loop() {
  // Read the rain sensor's digital output
  int rainDetected = digitalRead(rainSensorPin);

  if (rainDetected == LOW) {
    // Rain detected
    Serial.println("Rain detected! Turning servo to 90 degrees.");
    myServo.write(0); // Turn servo to 90 degrees
  } else {
    // No rain
    Serial.println("No rain detected. Servo at 0 degrees.");
    myServo.write(90); // Reset servo to 0 degrees
  }

  // Small delay for stability
  delay(500);
}

Applications and Benefits:

This system can be expanded and customized for various applications. Some potential uses include:

  • Smart Laundry Systems: Automatically protecting your clothes when it starts raining.
  • Smart Home Integration: This project can be integrated with home automation systems, allowing you to monitor weather conditions and automate actions accordingly.
  • IoT Projects: With the use of sensors and Arduino, this project serves as a great introduction to IoT-based systems.

Conclusion:

This rain detection and automatic cloth movement system is an excellent example of how we can apply basic electronics and programming to solve real-world problems. By using affordable components like the Arduino UNO R3, Servo Motor, and Rain Detection Sensor, anyone can build this system and make their environment smarter.

Feel free to customize and modify the design based on your needs—whether it’s a more complex mechanism for clothes protection or integration with a larger home automation setup. The possibilities are endless!