Wind direction sensor

There is a previous thread in which a person goes through the perils of trying to get a commercial wind direction sensor working, and running into all sorts of issues with false or incorrect readings. The sensor is based on someone’s design based on magnets, reed switches and resistors.
It seems to me that this design suffers from:
(A) a lack of precision. Only 16 different directions are allowed.
(B) you can’t just plug it in, align it and know it’s right. It has to be carefully calibrated and sketch code adjusted each time it is used.

It seems to me an all digital approach would be simpler and more reliable.
A printed screen that has (say) 8 concentric circles made of dashed lines. The disk is mounted on the shaft of the wind direction vane.
Above the disk is mounted a light source.
Below the disk is mounted a row of photo transistors.
Each transistor is turned on or off depending on the rotational position of the disk.
Readout is a binary 8 bit number.
This should give a precision of 256 different directions.
Accurate positioning of the transistors and printing of the disk will ensure accurate and repeatable readings.
Add more circles and transistors to get even greater accuracy.
Installation involves determination of the local north relative to the disk position and put that number into your code. Determination of direction is a simple maths problem, not requiring a lookup table.
Add a shift register to serialise the data and feed it into one Arduino I/o pin. Power the transistors from another pin and you have an on/off function.

The question is, does anyone know where I can buy one of these ready made ?

What you describe is an absolute encoder, and those things definitely exist - in many different shapes and forms and with up to 65536 positions.
I think the price is a dead giveaway on why they’re not used that much.
Now I can’t help but wonder how the wind vane of our school’s weather station really works. I just had to aim the thing north…

For some reason absolute encoders as you describe are expensive. Using an Arduino you can achieve the same results using an incremental encoder.

Cheap absolute rotary encoders based on using a magnet are available like the 10bit AS5040

https://www.digikey.co.uk/product-detail/en/ams/AS5040-SS_EK_AB/AS5040-EK-AB-ND/2339617

Not what I call "cheap" but definitely more affordable than the mechanical ones that I found :slight_smile:

10-bit resolution should be plenty for most applications. That's almost three points output change per degree of rotation.

With stiction in wind vanes and constantly varying wind direction , 8 points is usually sufficient - wind direction is rarely given to a higher accuracy .

With more precision you may find the read values constantly changing and you’ll need to throw away some resolution to get a steady reading

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.