Anemometer/Frequency Counting
Jiggs
Posts: 26
Hi all
I'm trying to use the Javelin to read wind speed data from an old anemometer I found laying around. As the device spins, a small magnet moves past a magnetic switch, thus closing a circuit. This happens once every rotation. Running five volts through it and hooking it up to a frequency counter, I found that speed of about 27mph registers 10Hz. (I verified these readings by using a frequency generator to emulate the anemometer and seeing the result on the original base unit.) As you might imagine, I've tried counting these pulses on the Javelin. I tried using both the count() function and the pulseIn() function. However, because of the low frequency, the Javelin returns very course data. 8.68us units seem to be designed to read much faster pulses. Any suggestions?
PS- I have a BS2sx as well, so if anyone thinks that device would be better suited to this task, let me know.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
I'm trying to use the Javelin to read wind speed data from an old anemometer I found laying around. As the device spins, a small magnet moves past a magnetic switch, thus closing a circuit. This happens once every rotation. Running five volts through it and hooking it up to a frequency counter, I found that speed of about 27mph registers 10Hz. (I verified these readings by using a frequency generator to emulate the anemometer and seeing the result on the original base unit.) As you might imagine, I've tried counting these pulses on the Javelin. I tried using both the count() function and the pulseIn() function. However, because of the low frequency, the Javelin returns very course data. 8.68us units seem to be designed to read much faster pulses. Any suggestions?
PS- I have a BS2sx as well, so if anyone thinks that device would be better suited to this task, let me know.
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
Comments
small high(low) period + large low(high) period or is dutycycle about 50% ?
regards peter
Could you measure the frequency at the maximum wind velocity that you would read?
You might also write a subroutine that looks at an input to see if it's high or low, and match the data to a lookup table.
You could carefully add some more magnets to decrease trigger interval...
Also I would count the pulses and take the latest count and subtract the previous count to get a total count per time interval "60 seconds or RPM"..
Then use this value to calculate the mph wind speed..
If you look at a 1-wire weather station, they use 2 magnets with a counter chip to do this very thing...
Bob
And just in case it helps, I wired it up with a pullup resistor, so that when the circuit is closed, the input pin goes to 0v. I then used this code:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
regards peter
I've never heard of this class, and neither has my compiler. Do I need to load an external class?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/core/
regards peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs
With the values given, the time interval is 1 second.
So for your 10 Hz (windspeed 27 mph as you said) you
should get 20 displayed every time interval.
20 edges equals 10 pulses (your 10 Hz) because each pulse has two edges.
regards peter
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
~Jiggs