What it shows
A rain sensor board has interleaved copper tracks whose resistance drops when water bridges them. The Arduino reads that change and swings a servo to shut a hinged cardboard window, then reopens it when the board dries.
The science
Pure water barely conducts, but rain carries dissolved salts and dust, so a drop across the tracks forms a resistor of a few kilohms. The comparator board gives a digital pin that goes low past a set wetness and an analog pin that falls as the board gets wetter. The servo takes a 50 Hz pulse whose width, 1 to 2 ms, sets the arm angle; the Servo library produces it from a single pin. A delay before reopening lets the board dry and stops the window flapping during light drizzle.
Materials
Cost: under Rs 500. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.
- An Arduino Uno or Nano clone and USB cable
- A rain drop sensor module with its comparator board
- An SG90 servo
- A cardboard window frame with a hinged flap
- A paper clip and thread for the servo link
- Jumper wires and a 5 V power bank
Safety
For this project: Keep water on the sensor board only, away from the Arduino. USB power only.
Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.
All the safety rulesStep by step
9 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.
Wire the sensor board: VCC to 5 V, GND to GND, AO to A0, DO to pin 2.
Wire the servo: brown to GND, red to 5 V, orange to pin 9.
Glue the servo beside the window frame and link its horn to the flap with the paper clip so 0 degrees is open and 90 degrees is closed.
Print analogRead(A0) and note the dry value, close to 1023, then drip water and note the wet value.
Pick a threshold between the two and write it into the sketch.
In the loop: if the reading is below the threshold move the servo to 90; if it is above the threshold for 20 seconds continuously, move it back to 0.
Sprinkle a few drops from a spoon and watch the window shut; wipe the board and see it reopen after the delay.
Tilt the sensor board slightly so water drains and the drying time is realistic.
Add a buzzer beep on closing and a small LED that stays on while the window is shut.
What you should see
Two or three drops close the window within a second; once the board is wiped dry the window reopens after the set delay.
Viva questions
A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.
1Why does water lower the resistance between the tracks?
Dissolved ions in rain water carry charge across the gap, so current flows where dry air did not conduct.
2What signal controls a servo?
A repeated pulse every 20 ms whose width between 1 and 2 ms sets the angle.
3Why add a drying delay before reopening?
So the window does not keep opening and closing during intermittent rain.
4What happens to the copper tracks over time?
They corrode with repeated wetting, so real sensors use gold plating or non-contact methods.
Take it further
Use the analog value to show rain intensity on three LEDs: light, medium, heavy.
Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.
