Weather meter kit
The SparkFun weather meter kit: a cup anemometer and a rain gauge that click a reed switch, and a wind vane that is a resistor ladder.
The same kit Argent Data sells as the 80422 and misol makes (SEN-15901). Aliases: weather station, anemometer, wind speed sensor, wind vane, wind direction sensor, rain gauge, tipping bucket.
None of the three has any electronics in it. They are reed switches, magnets and resistors, so what the board reads depends on the pull-ups your circuit gives them.
Pins
Each sensor has its own pair of wires, as on the RJ11 plugs (on the real kit the anemometer and the vane share one cable, and the rain gauge has its own). Which wire of a pair is which does not matter.
| Pin | What it does |
|---|---|
WIND1, WIND2 |
The anemometer's reed switch. |
VANE1, VANE2 |
The wind vane: a resistance, 688 ohms to 120 kohms by direction. |
RAIN1, RAIN2 |
The rain gauge's reed switch. |
The usual wiring: each reed between a pin with INPUT_PULLUP (an interrupt pin on an
Uno, 2 or 3) and ground; the vane between ground and an analog pin that has a 10 kohm
resistor up to 5 V.
Properties
wind is the starting wind speed in km/h (0 to 150), direction the starting vane
position (0 to 15: 0 north, 4 east, 8 south, 12 west), and rain the starting rain
rate in mm/h (0 to 100). The three sliders on the part change them while it runs.
What the model gets right
From the SparkFun and Argent Data datasheet:
The anemometer. "A wind speed of 2.4 km/h causes the switch to close once per second." 24 km/h is ten closures a second. Count them on an interrupt for a fixed time and multiply.
The rain gauge. "Each 0.2794 mm of rain causes one momentary contact closure." 100 mm/h tips the bucket every 10 seconds; 1 mm/h about every 17 minutes. The bucket keeps what it has caught: change the rate halfway to a tip and the tip comes when the bucket is full, not a whole tip later.
The vane. Eight reeds and eight resistors; the magnet closes one or two side by side, so 16 positions. The part is the resistance the datasheet tabulates for each:
| Direction | Ohms | Volts (10 k to 5 V) |
|---|---|---|
| N (0) | 33 k | 3.84 |
| NNE (22.5) | 6.57 k | 1.98 |
| NE (45) | 8.2 k | 2.25 |
| ENE (67.5) | 891 | 0.41 |
| E (90) | 1 k | 0.45 |
| ESE (112.5) | 688 | 0.32 |
| SE (135) | 2.2 k | 0.90 |
| SSE (157.5) | 1.41 k | 0.62 |
| S (180) | 3.9 k | 1.40 |
| SSW (202.5) | 3.14 k | 1.19 |
| SW (225) | 16 k | 3.08 |
| WSW (247.5) | 14.12 k | 2.93 |
| W (270) | 120 k | 4.62 |
| WNW (292.5) | 42.12 k | 4.04 |
| NW (315) | 64.9 k | 4.33 |
| NNW (337.5) | 21.88 k | 3.43 |
It is a real resistor in the circuit, so a different pull-up, or a 3.3 V board, reads what it would on the bench, and the sketch has to look up the nearest entry. The voltages are not in compass order, which surprises everyone once.
No timers when still. With no wind and no rain the part schedules nothing.
What it does not model
Reed bounce: each closure here is one clean edge, where a real anemometer needs a few milliseconds of debounce (the template does it anyway). How long each closure lasts is not in the datasheet: the anemometer's reed is held shut for half of each turn and the rain gauge's for 50 ms, both assumptions. The vane snaps between its 16 positions, where on a real one the switch-over angles do not fall exactly on the 22.5 degree marks and a swinging vane can catch the ladder mid-change. Gusts, the cups' inertia, the cups stalling in light air, and rain splash are not modeled; the pulses are exact and evenly spaced.
Common mistakes
Reading the vane without a pull-up. The vane is just a resistor; with nothing to make a divider with, the pin floats.
Using the table's voltages on a 3.3 V board. They are for 5 V and 10 k. Work the expected readings out from the resistances and your own pull-up, as the template does.
Counting the reeds by polling. At 100 km/h the anemometer closes 40 times a second; an interrupt does not miss them.
See it in action
Wind and rain station shows the wind speed, the compass point and the rain on an I2C LCD. Open it at /templates.