📘 Project Overview
Ever forgotten your clothes outside and then it started to rain? This fun DIY Rain Detector Clothesline Using a Micro Servo lets you build a smart mini clothesline that moves when it starts to rain—using a rain sensor and a micro servo motor.
It’s a simple and creative way to learn about electronics, sensors, and Arduino programming. Great for science fairs or STEM classes!
🧠 What It Does
When rain is detected, a micro servo motor rotates, pulling a small clothesline arm (or blocking rain with a cover). It’s a basic automation system that uses sensors and code to respond to weather.
🧰 Materials Needed
Item | Description |
---|---|
Arduino Uno or Nano | The microcontroller (the brain) |
Rain Sensor Module (YL-83 or FC-37) | Detects raindrops |
Micro Servo Motor (SG90) | Rotates when rain is detected |
Jumper Wires | To connect everything |
Breadboard | To build the circuit |
USB Cable | To upload code to Arduino |
Cardboard or Plastic Arm | Simulates the clothesline or cover |
Power source (USB or 5V) | To run the Arduino |
🧱 Circuit Connections
Rain Sensor
VCC → 5V on Arduino
GND → GND on Arduino
DO → Pin 7 on Arduino
Micro Servo
Red wire (VCC) → 5V on Arduino
Brown wire (GND) → GND
Orange wire (Signal) → Pin 9
💻 Arduino Code
Upload this code using the Arduino IDE:
#include <Servo.h>
int rainSensor = 7;
Servo myServo;
void setup() {
pinMode(rainSensor, INPUT);
myServo.attach(9); // Servo on pin 9
myServo.write(0); // Start at position 0
}
void loop() {
int rainValue = digitalRead(rainSensor);
if (rainValue == LOW) { // Rain detected
myServo.write(90); // Rotate to 90 degrees
} else {
myServo.write(0); // Stay at 0 degrees (default)
}
delay(1000); // Wait 1 second before next check
}
🔧 Assembly Tips
Use cardboard or plastic to create a small clothesline or arm that the servo can move.
Ensure the servo isn’t overloaded—this is a demonstration model.
You can place the rain sensor on top of the project or outside a window with wires running in.
📚 What You’ll Learn
How sensors work
Basics of servo motor control
Simple Arduino coding
How to automate real-world problems
🧪 Extra Ideas
Add a buzzer to beep when it rains
Use an LCD screen to display status
Build a waterproof mini cover for clothes using the servo
🎓 Conclusion
This Rain Detector Clothesline with a Micro Servo is a fun, educational, and creative project. You’ll learn electronics, programming, and automation while solving a real-world problem in a small model format—perfect for school presentations!
Add comment