What are the options to determine wind direction?

MrChips

Joined Oct 2, 2009
34,892
You could do it with just two pairs of UP/DOWN quadrature encoders.
You just need to do a home calibration when you power up the MCU.

4-bits would give you 22.5° resolution.
 

Tonyr1084

Joined Sep 24, 2015
9,744
You just need to do a home calibration when you power up the MCU.
The way I'm thinking on the TS plan is the weather vane is somewhere up high on a mast or on top of a building. Doing a home calibration every time power is interrupted, switched off and back on, or other issue, it doesn't seem convenient to have to zero out the vane. That's why I'm thinking something with dedicated directions. The Opto Wheel seems like a good approach, but again, there's the need to zero the weather vane every time power is interrupted. Then comes the need to know every time you zero it, knowing exactly what direction north is. With the dedicated direction once north is established it's always there unless something moves the mast.
 

MrChips

Joined Oct 2, 2009
34,892
I think a quadrature encoder and a single N-S detector will do it.

There are four possibilities:

encoder + N-S detector transition
increasing + N->S = reset to 270°
decreasing + N->S = reset to 90°
decreasing + S->N = reset to 270°
increasing + S ->N = reset to 90°
 

panic mode

Joined Oct 10, 2011
5,037
quadrature encoder only need to be initialized upon powerup. so... is you have a system that never powers down (battery backup) you got yourself equivalent of absolute position feedback. if that is not good enough, use true absolute encoder. parallel encoders have multiple outputs allowing to monitor eat bit individually, regardless if unit was moved while powered down or not. for just wind direction, high resolution is not needed so one can make own absolute encoder using pcb and wipers, or even contactless - print the code on a piece of paper and tape it to the shaft, then decode bit positions using optical sensors. LEDs can be used as sensors so 4-led bargraph would allow one to get true absolute position feedback with 22.5 deg resolution (360deg/2^4).
one can do the same to make it analog.... by making the printed code simple ramp/wedge.
or one could use endless potentiometer. this gives you sin/cos values that are easily processed using pair of analog inputs on an MCU for example.
or attach small magnet at the end of the shaft and use one of the hall ICs for absolute position... or ... or ... or... there are practically endless possibilities.
 

Lo_volt

Joined Apr 3, 2014
373
I have not completed it yet, but I'm attempting to use a triple axis magnetometer chip with a neodymium magnet on the rotor shaft. So far I've taken a NEMA 23 stepper motor, removed the rotor and windings and mounted that in a weather proof enclosure with a weather vane attached to the shaft. This gives me a pair of bearings for the vane to rotate on. The motor shell has a hole in the bottom that exposes the short end of the shaft. I plan on gluing the magnet on that end of the shaft. Then I'll mount the magnetometer (I'm using a ready made Adafruit PCB magnetometer board) beneath it to sense rotation of the magnet on the shaft. Triple axis is necessary because a single axis only gives magnetic field magnitude. Three axes can be translated into a rotational vector. It's a work-in-progress so I don't know really how well it will work.
 

MrChips

Joined Oct 2, 2009
34,892
I have not completed it yet, but I'm attempting to use a triple axis magnetometer chip with a neodymium magnet on the rotor shaft. So far I've taken a NEMA 23 stepper motor, removed the rotor and windings and mounted that in a weather proof enclosure with a weather vane attached to the shaft. This gives me a pair of bearings for the vane to rotate on. The motor shell has a hole in the bottom that exposes the short end of the shaft. I plan on gluing the magnet on that end of the shaft. Then I'll mount the magnetometer (I'm using a ready made Adafruit PCB magnetometer board) beneath it to sense rotation of the magnet on the shaft. Triple axis is necessary because a single axis only gives magnetic field magnitude. Three axes can be translated into a rotational vector. It's a work-in-progress so I don't know really how well it will work.
That will work. In my opinion, the goal would be to have contactless, minimum friction and no power connections on the rotor.
Hence a magnet on the rotor is an excellent idea. Then all you need is a fixed 2-axis magnetometer underneath the rotating magnet. I think that you don't need a neodymium magnet. An ordinary small bar magnet would have a strong enough magnetic field.
 
Top