Hi,
this is my first posting on this forum so i would like to introduce myself, my name is martyn i am 52 yrs old and live in cardiff, south wales, UK.
I am hoping to make wind direction and wind speed sensors I have already a up and running weather station which uses sensors obtained as spares for the maplins N96GY system, these use reed switches and I am hoping to upgrade these,
I am hoping to use a HC-020k, Speed measuring photo-electric encoder for the wind speed sensor.
For wind direction I am hoping to use the KY-040, a 360 rotary encoder.
These both have 20 pulses per revolution
I am asking if people with better electronic knowledge can advise if they think that these encoders would be suitable and if so advise on what libraries should be used for use with a arduino Nano.
Can you post links to the datasheets for the encoders?
What Arduino experience or programming experience do you have?
(None, is a perfectly acceptable answer - but there may be no need to teach granny to suck eggs)
ever suggested to use an I2C magnetometer for the direction? Sparkfun
The HC-020k can be used for speed measuring. I would use it with on an interrupt pin.
You have to calculate the way (2*radius (distance from the shaft to the encoder) *pi) by time (measured via Interrupt and millis() function).
This would be my first approach, maybe i was able to help you...
Hi,
Thanks for replies so far, arduino programming experiance to date is limited, have programmed 2 nano's so far 1 for a reciever and 1 for a transmiitter, these being used in the weather station that I have built.
Below are 2 links that I have been able find with regards to the request for data on both of these encoders/sensors, the hc-020k link may need translating, hope they are useful for the above request.
If your rotary encoder for the wind direction has 20 steps per revolution, then you will be able to determine the wind direction to the nearest 30°, but you won't be able to use the 'traditional' N, WNE. NE, ENE, E, ...... etc type of display, as that requires 16 steps per revolution.
Well, the compass will only work if it's mounted on the wind vane and then how do you power it and get the data from it? Slipring? (Adafruit has some nice sliprings that would work.)
The links I can find for KY-040 all say that it's an incremental encoder. This won't work for wind direction at all. It also looks like it's intended for a human-operated knob, so it probably has detents/clicks.
I've got a bit of experience with the US Digital absolute encoders. Rather costly but if you need resolution to less than 1 degree in a very small package, this is the best solution. I'm sure there are other encoders out there that have absolute output and no detents. A quick search at Mouser shows 24 different types in stock.
MorganS:
Well, the compass will only work if it's mounted on the wind vane and then how do you power it and get the data from it? Slipring? (Adafruit has some nice sliprings that would work.)
The links I can find for KY-040 all say that it's an incremental encoder. This won't work for wind direction at all. It also looks like it's intended for a human-operated knob, so it probably has detents/clicks.
I've got a bit of experience with the US Digital absolute encoders. Rather costly but if you need resolution to less than 1 degree in a very small package, this is the best solution. I'm sure there are other encoders out there that have absolute output and no detents. A quick search at Mouser shows 24 different types in stock.
It´s true, you have to think about the mechanics. But i think there is a godd chance to get this working...
back to the problem and some solutions...
Maybe this instructable or this instructablewill help you. For the direction you can also try something like this, just use reedswitches instead of the normal ones...
Maybe this instructable or this instructablewill help you. For the direction you can also try something like this, just use reedswitches instead of the normal ones...
In the very first post it was mentioned that the current system uses reed switches and he wants to use something else. Perhaps for wind direction you could use a continuous rotation potentiometer or maybe something like this 360ASMC-01 360ASMC-01 Spec sheet though it might be more of a pain to set up than it's worth.
I do like the idea of using some photo-electric encoders though, but I haven't worked with them myself. I believe the encoders in most hobby servos are just potentiometers though so maybe that would be a better way to go, at-least for wind direction. For wind speed, maybe just a hall-effect sensor and a magnet on the end of the paddle shaft would work okay?