It is no easy task to build a remote reading wind vane although a search of the internet will show a plethora of idea for the masthead sensor.
The obvious one is a 360 degree potentiometer and many commercial units use these. They are not all bad but they are not ideal, most will have a dead zone (which may not be significant) and all except the expensive ones will involve a sliding contactor and hence friction, wear and limited life.
Reed switches are another common idea, they have long life and no sliding contacts but a lot of reeds are required if you desire fine resolution output.
Nowadays we can buy a magnetometer chip and use that with a magnet on the wind vane shaft. This had great promise until I found they (or least the chip I have) require calibration every time they are turned on and having low lever signal output they need more than a simple connection to the display system. The chip has I2C output but this does not have the required range to reach the display unit.
Some commercial systems use an optical system with a Gray encoded disk. The only disadvantage I had with these is that it was hard to find one at a reasonable price and it appeared beyond my level of skill to make one.
The 'gold standard' for these systems used to be a pair of Selsyns. I happen to have a selection of these in my store and I could use a pair of these but I am keeping them in case I need them in another project!
It is about now that you are thinking "Rotary encoders are just a couple of dollars from China". Yes that is true but a wind vane requires an 'absolute' encoder or some system to locate the zero position.
So I looked in my junk stash and found what I needed for a quadrature encoded absolute encoder..

The principle is easy enough. As the eccentric disk rotates more or less of the LDR is uncovered and exposed to the light of the LED. Current through the LDR is processed by the display unit Arduino to give the wind direction. It works quite well and is sensitive to the slightest movement of the wind vane. The sensors are at 90 degree offset so a graph of the sensor outputs is a sine cosine pair.
But then my parcel arrived and I now have a Hall effect absolute rotary encoder! The unit looks just like a potentiometer but of course has no internal moving contacts etc and has no blank gap. The unit outputs a voltage (which I can read with 10 bit ADC). The voltage is in the range 0 to 5V. The Arduino reads the voltage then maps it to a range of 1 - 384 which is the number of steps in the wind direction display unit.
John
The obvious one is a 360 degree potentiometer and many commercial units use these. They are not all bad but they are not ideal, most will have a dead zone (which may not be significant) and all except the expensive ones will involve a sliding contactor and hence friction, wear and limited life.
Reed switches are another common idea, they have long life and no sliding contacts but a lot of reeds are required if you desire fine resolution output.
Nowadays we can buy a magnetometer chip and use that with a magnet on the wind vane shaft. This had great promise until I found they (or least the chip I have) require calibration every time they are turned on and having low lever signal output they need more than a simple connection to the display system. The chip has I2C output but this does not have the required range to reach the display unit.
Some commercial systems use an optical system with a Gray encoded disk. The only disadvantage I had with these is that it was hard to find one at a reasonable price and it appeared beyond my level of skill to make one.
The 'gold standard' for these systems used to be a pair of Selsyns. I happen to have a selection of these in my store and I could use a pair of these but I am keeping them in case I need them in another project!
It is about now that you are thinking "Rotary encoders are just a couple of dollars from China". Yes that is true but a wind vane requires an 'absolute' encoder or some system to locate the zero position.
So I looked in my junk stash and found what I needed for a quadrature encoded absolute encoder..
The principle is easy enough. As the eccentric disk rotates more or less of the LDR is uncovered and exposed to the light of the LED. Current through the LDR is processed by the display unit Arduino to give the wind direction. It works quite well and is sensitive to the slightest movement of the wind vane. The sensors are at 90 degree offset so a graph of the sensor outputs is a sine cosine pair.
But then my parcel arrived and I now have a Hall effect absolute rotary encoder! The unit looks just like a potentiometer but of course has no internal moving contacts etc and has no blank gap. The unit outputs a voltage (which I can read with 10 bit ADC). The voltage is in the range 0 to 5V. The Arduino reads the voltage then maps it to a range of 1 - 384 which is the number of steps in the wind direction display unit.
John
Comment