I also came across this small product for £4.50 EB
Its 16pos 4bit hex similar
So I sent off for one to test
I fully expect the same problems as before above.
On the subject of encoding, I understand the need for ABS position (mine also) and also that Gray is designed so that only one bit changes per step, hex code can have all 4 bits change at once (15 to 0 xover etc).
As a naive dabbler pls advise if my reasoning is flawed hereon -
It seems to me that a 4bit hex o/p will give an absolute reading of physical position
Problems may arise with poling the data pins at Arduino level (noise and metastable timing - 2 or more bit changes)
My application doesnt do high speed rotation - say 100rpm max from short period (wind vane)
It seems to me that the hex o/p will always give the absolute data eventually (assuming good new contact surfaces) in spite of bounce and c/o issues if given sufficient WAIT time to stabilise _ this assumes a slow rotation (I intend some form of damping on the vane mechanism as IMHO responding to vortices is hardly helpful practically.
So this crude approach may not need clever debounce code , just some caps on the pins perhaps?
Maybe a schmitt trigger chip (cheap enough)
@robint is not big on information as it took until post #44 on the earlier thread about this to reveal the wind vane so one may only speculate. I speculate that OP is going to or is building/modifying their own wind vane. The choice of a mechanical encoder may not be the most reliable as @DrDiettrich has alluded. An optical or magnetic would probably give longer service and would be easier for the wind to turn.
Some commercial wind vanes use reed switches and a resistor network to encode the direction and are read with an ADC.
Schematically like this:
@DrDiettrich Hi Looking at @EmilyJane scope trace above one might say chose 5x 10x say 250 - 500µs, given the low rate of position update required - say 1-5s to filter out random buffeting. I was thinking of incorporating a kind of adjustable damping with eddy current? so as to get a more consistent average - seen the way small domestic wind vanes fly around chaotically. A church spire weather cock doesnt do that - it wouldnt last long.
@EmilyJane The cheap encoder I suggested seems to have a spec life of 20,000 rotations? Weather vanes dont rotate continuously so whats a good guess. Worth a shot I thought. You are right about the oz-ins torque needed for the Grayhill device - would need a big vane say 05m radius - but field work needed here.
I have seen the resistor ladder/reed switch used on marine weather vanes - a well known system amongst yachties. Now the gotcha here is to contrive a suitable dial indicator (not a $$$ LCD screen type), something say size of a domestic wall clock 200-250mm that can be seen across a room 5m. Only crude sectors say 16 as per points of compass. A radial array of LED bars with say 10 divs that could indicate wind strength and direction green low <2m/s to >20m/s. I have a scheme to provide wind pressure (another thread needed). The icing on the cake barometric recorder, temp and wind chill (thats already available).
Indeed a magnetic/optical/capacitive sensor would provide 10^2 10^4 times the life but at significant cost. My Omron EB62 photo encoder knock off is here ca £25 , the real thing from Mouser ca £250 both from PRC btw. This 10x markup seems a common factor between commercial vs industrial/military/medical
A quadrature encoder can work only if it has an index output and the index (home) position can be reached on start up. As wind can not be controlled the output of such an encoder is widely unusable
Ah, right. I lost sight of that requirement.
My current wind vane is of the reed switch/resistor variety and I'm satisfied with it. It's been in service for several years now and was around $20. I have had the Hall effect switch version as well and that was satisfactory as well. I haven't seen any specification for what OP really requires so it's hard to comment. However, the absolute encoders mentioned have had the same resolution as the sensors I've used.
@DrDiettrich took the wind out of my sail - its a quad and impractical for index to physical zero. Just as well or people might think me a churl.
EMS22Q51-B28-LS3 is £41 Bournes pot hall effect.
I have a cunning plan using a magnetic sensor but still gathering kit together for testing so its under wraps just now. @EmilyJane with your simple reed switch variety, what indicator does it use? Digital read out? Degrees?
Every boardroom/stateroom should have one of these
I looked at how a ships telegraph works between bridge and engine room it has two cycle chains connecting a handle to indicator either end and a bell is swung both ends to alert a change of orders
I am guessing the dial may be connected to the roof wind vane by a similar chain wheel system, or it may be by bevel gears and a transmission shaft?
My readout is an OLED screen. It reads out in direction and degrees. It has a resolution of 22.5º. Since two reed switches at a time can be closed, it encodes 16 positions. Any sort of readout is conceivable as long as you take the resolution into account.