How-to · Intermediate · 3 min read
Weather Station Sensors
Anemometer, Wind Vane and Rain Gauge
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
A DIY weather station needs three outdoor sensors: an anemometer for wind speed, a wind vane for direction and a tipping-bucket rain gauge. Hobby versions give a pulse or a resistance value you read on a microcontroller. Industrial versions use RS485 Modbus, 0 to 5 V or 4 to 20 mA outputs. Count pulses with an interrupt and calibrate against the datasheet.
Key specs at a glance
- Anemometer
- Pulse, voltage, 4-20 mA or RS485 Modbus output
- Wind vane
- Reed switch resistor network (16 positions), voltage or RS485
- Rain gauge
- Tipping bucket, one reed pulse per fixed amount of rain
- Rain drop module
- Detects rain presence only, not amount
- Supply
- Pulse sensors need none; industrial types use 5 to 24 V
- Mounting
- Open air, away from walls, at roof height
The three core sensors
cups spin in the wind. A magnet and reed switch or Hall sensor give pulses per rotation. Count pulses over a few seconds and multiply by the datasheet factor to get speed. Ultrasonic versions have no moving parts.
a magnet turns a ring of reed switches, each with a different resistor, giving 8 or 16 directions through a voltage divider and ADC. Ultrasonic and RS485 vanes report degrees directly.
a funnel fills a small bucket that tips when it holds a fixed volume of rain, often a fraction of a millimetre. Each tip closes a reed switch for a pulse.
Pick the output type
The output sets how you wire it and how far the cable can run.
| Output | Cable length | Wiring | Notes |
|---|---|---|---|
| Reed pulse | Short, a few metres | Input pin with pull-up | Cheapest; debounce in software |
| 0-5 V or 0-10 V analog | Medium | ADC, maybe divider | Check supply and scale |
| 4-20 mA | Long | Current shunt resistor to ADC | Resists noise; see the 4-20 mA current loop entry in the glossary |
| RS485 Modbus RTU | Long, up to 1 km | RS485 module, address and baud | Several sensors on one pair; see RS485 |
- Reed pulse
- Cable length:
- Short, a few metres
- Wiring:
- Input pin with pull-up
- Notes:
- Cheapest; debounce in software
- 0-5 V or 0-10 V analog
- Cable length:
- Medium
- Wiring:
- ADC, maybe divider
- Notes:
- Check supply and scale
- 4-20 mA
- Cable length:
- Long
- Wiring:
- Current shunt resistor to ADC
- Notes:
- Resists noise; see the 4-20 mA current loop entry in the glossary
- RS485 Modbus RTU
- Cable length:
- Long, up to 1 km
- Wiring:
- RS485 module, address and baud
- Notes:
- Several sensors on one pair; see RS485
Counting rain tips and wind pulses
Use interrupts so no pulse is missed. Debounce by ignoring pulses closer than a few milliseconds. Multiply the rain tips by the sensor's volume per tip, which is on the datasheet.
const uint8_t RAIN_PIN = 2;
const float MM_PER_TIP = 0.2794; // check your gauge datasheet
volatile unsigned long tips = 0, last = 0;
void onTip() {
unsigned long now = millis();
if (now - last > 50) { tips++; last = now; } // 50 ms debounce
}
void setup() {
Serial.begin(115200);
pinMode(RAIN_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(RAIN_PIN), onTip, FALLING);
}
void loop() {
noInterrupts(); unsigned long t = tips; interrupts();
Serial.print("Rain mm: "); Serial.println(t * MM_PER_TIP);
delay(5000);
}Installation tips
- Mount the anemometer high and clear of roofs and trees; a standard height is 10 m, but a clear mast above the roofline works at home.
- Level the rain gauge and keep the funnel clear of leaves.
- Use weatherproof connectors and seal cable entries.
- Protect against lightning by grounding the mast and using surge protection on long RS485 runs.
Try it: Current shunt resistor calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Not debouncing the reed switch and counting double pulses.
- Mounting the anemometer in the shelter of a wall.
- Using the wrong volume per tip for a different gauge.
- Running a long analog cable without shielding.
- Leaving the rain drop module powered in the weather; the plate corrodes.
Frequently asked questions
What does a rain drop sensor module measure?
Whether the plate is wet. It does not measure the amount of rain, so use a tipping bucket for that.
How do I convert pulses to wind speed?
Use the factor on the datasheet, for example a certain speed for one pulse per second. It differs between models.
Can I use RS485 sensors with Arduino?
Yes, with a TTL to RS485 module and a Modbus library. See the Modbus guide.
How do I read a 16-position wind vane?
Read the ADC through a divider and match the value against a table of the vane's resistances.
Do I need a power supply for a reed pulse sensor?
No, a reed switch is passive. Just give it a pull-up resistor on the input.
Parts for this guide
Calculators
Terms in this guide
Projects that use it
Put this into practice: 7 step-by-step builds in our project library use parts from this guide.
Keep learning
Sources
- Manufacturer data sheets for pulse anemometers and tipping-bucket gauges
- World Meteorological Organization guide to instruments and observation methods
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.




