Arduino Farm Weather Station with Anemometer and Rain Gauge for Spray Advice
Build a spray-weather advisor for a farm: count an anemometer and a rain gauge with two interrupts, debounce their reed switches, and show whether it is safe to spray, with one reason.

Your project challenge
Count the anemometer on D2 and the rain gauge on D3 with interrupts, ignoring bounces under 5 ms. Every 3 seconds show Wind and the km/h on row 1. Row 2: RAIN and the mm if it rained in the last 5 seconds, else TOO WINDY over 15, TOO CALM under 3, else SPRAY OK (green LED).
Components you’ll use
- Arduino Uno
- Cup Anemometer (weather meter kit)
- Tipping-Bucket Rain Gauge
- LCD 16x2 Display
- LED (Light-Emitting Diode) × 2
What you’ll build
A spray-weather advisor for a farm. Before a farmer sprays a crop, it says whether the weather is safe, and why not.
How it works
Wind spins the cups of an anemometer. A magnet closes a switch once a second for every 2.4 km/h of wind. Rain fills a tiny see-saw bucket that tips at every 0.2794 mm and closes a second switch. Use the Wind slider and the Tip the bucket button.
The key idea
Count closures with attachInterrupt and volatile counters. Every 3 seconds, wind = closures × 2.4 ÷ 3. Spray only between 3 and 15 km/h: stronger wind blows the spray away, and in still air the fine drops float and drift. Rain washes it off, so wait 5 seconds after the last tip.
⚠ Watch out
A reed switch bounces: one closure gives a few quick pulses. In the interrupt, ignore a pulse that comes within 5 ms of the last one.
Make it yours: add the kit’s wind vane on A0 and warn when the wind blows towards the neighbour’s field.
The editor has the wiring guide, the code and the simulator.
Build this project