weather station
I am using a basic reed switch anemometer connected to a BS2px.· Wind speed for this anemometer is 2.5 MPH for one rotation in one second.· http://www.inspeed.com/anemometers/Vortex_Wind_Sensor.asp.· It would seem pretty straight forward to program but I am most definitely doing something wrong.·
·
The anemometer is connected like an active low switch to Pin 2.
·
I am using the COUNT command to read the number of times the reed switch closes and opens.· Since I am using the PX version the duration range for COUNT is .000287 second and if I divide that number into 2 seconds I get 6968 for my timing.
·
· COUNT 2, 6968, Counts ' Count number of full rotations on pin 2 for 2 seconds
· Counts = Counts / 2···· ‘ Divide that by 2 to get number of counts per second
· ································· ···' Scale of vortex is 2.5 mph per revolution per second
·
· wSpeed = Counts * 25 / 10 ‘ Multiple counts by scale of 2.5
·
I have been trying to figure out why I am not getting the proper windspeed readout. ··The readings all over the place while testing at different speeds.
·
Perhaps someone can tell me what I am doing wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
·
The anemometer is connected like an active low switch to Pin 2.
·
I am using the COUNT command to read the number of times the reed switch closes and opens.· Since I am using the PX version the duration range for COUNT is .000287 second and if I divide that number into 2 seconds I get 6968 for my timing.
·
· COUNT 2, 6968, Counts ' Count number of full rotations on pin 2 for 2 seconds
· Counts = Counts / 2···· ‘ Divide that by 2 to get number of counts per second
· ································· ···' Scale of vortex is 2.5 mph per revolution per second
·
· wSpeed = Counts * 25 / 10 ‘ Multiple counts by scale of 2.5
·
I have been trying to figure out why I am not getting the proper windspeed readout. ··The readings all over the place while testing at different speeds.
·
Perhaps someone can tell me what I am doing wrong.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
bpx
![](/plugins/FileUpload/images/file.png)
4K
Comments
I believe the problem is contact bounce. Try using a square wave frequency generator to test Your code, If it works ,then You'll need a debounce subroutine.
Take a look at Experiment #14 in the StampWorks Manuel.
______________$WMc%________________
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there·········································· E=$WMc%2
Post Edited ($WMc%) : 1/7/2009 12:05:07 AM GMT
"If you use COUNT on slowly changing analog waveforms like sine waves, you may find that the value returned is higher than expected. This is because the waveform may pass through the BASIC Stamp’s 1.4-volt logic threshold slowly enough that noise causes false counts. You can fix this by passing the signal through a Schmitt Trigger, like one of the inverters of a 74HCT14. Or, you may use the BS2px’s built-in Schmitt-Trigger pin property; see·CONFIGPIN for details.”
Now, you're not dealing with a sine wave, but you're not spinning that device like mad either and use of the Schmitt-trigger may prove advantageous.
I'm looking forward to seeing your weather station in the Completed Projects Forum. I've been pushing my version of the WS project to the back burner for too long.
Good luck with yours!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The more I look for common sense in the world...
the more·I·find how un-common it is.
·
That is part of an article on intefacing the Stamp to an anemometer.
The conversion formula is
mph = 2.5 * counts / seconds
If you count for 2.5 seconds instead of 2 seconds, then the counts result will equal mph without any further math:
COUNT 2, 8711, counts ' scaled for the BS2px
mph = counts
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Thanks again.
Final code posted
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
What type of weather vain do you have the compass module mounted on?
Thanks,
MikeS
I am planning to attach the weather station to my balloon projects to measure winds speeds at 100,000+ feet. This will allow me to monitor actual wind speeds verses projected wind speeds and make tracking course correction during recovery operations.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
I am working on a new algorithm that will provide real-time update on predicted flight paths and landing sites based on information gathered before(which I currently use) and during the flight. These calculations will be performed by the Prop and sent back to my mobile tracking station during flight operations.
Since my flights have been postponed due to winter winds in Texas I have decided to add an additional experiment to what I am already working on. I will have a complete write-up available on my website in the next couple of weeks if you are interested.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET
"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman