The wind direction is detected by a low-inertia wind vane. The axis of the wind vane is running in ball bearings and carries a diametrically magnetized magnet at the inner end.
The angle position of the axis is canned contact-free by a magnetic angle sensor, (TMR = Tunnel Magneto Resistance) which gives two sinus- and cosinus-dependent voltages as output signal.
A connected micro-controller calculates from this voltages the wind direction in 1024 sectors (0.35°/sector). Related to sector 1 is the wind direction 0°-35°, sector 1024 corresponds to the wind direction 359.65°-360°.