I am trying to write code for an anemometer (wind speed meter). The anemometer that I have will give 8 pulses per second in a 2.5 mph wind. Max wind speed is 100 mph. I tried to use interrupts on an Arduino but they don't play nice with the routine I was using to display to an I2C LCD.
The plan is to keep a count on tics and two moments in time (most likely about a second) and calculate the speed based on clicks per time. I don't think I need the PIO to calculate the speed, just keep track of the number of pulses. Am I over complicating this? Would a standard intercept work better and easier? I know the Pico is much faster and I have more control over interrupts (and possibly more complication).
I am guessing the pico is fast enough that I could calculate the speed based on time elapsed between tics, but standard wind speed is given as the average over 2 minutes. Keeping a 120 speeds to average would be easier and faster that potentially 20k speeds (at just over 50 mph).
Would love the thoughts from the group as to the best way to do this. I currently have an Arduino that gathers temp, humidity, pressure and battery voltage and transmits it through RF to another Arduino that gets inside temp and displays. Adding wind speed, would probably require it's own Arduino. I do plan to replace the inside unit with the pico to handle everything inducing saving info for a possible web page update.
Bob
The plan is to keep a count on tics and two moments in time (most likely about a second) and calculate the speed based on clicks per time. I don't think I need the PIO to calculate the speed, just keep track of the number of pulses. Am I over complicating this? Would a standard intercept work better and easier? I know the Pico is much faster and I have more control over interrupts (and possibly more complication).
I am guessing the pico is fast enough that I could calculate the speed based on time elapsed between tics, but standard wind speed is given as the average over 2 minutes. Keeping a 120 speeds to average would be easier and faster that potentially 20k speeds (at just over 50 mph).
Would love the thoughts from the group as to the best way to do this. I currently have an Arduino that gathers temp, humidity, pressure and battery voltage and transmits it through RF to another Arduino that gets inside temp and displays. Adding wind speed, would probably require it's own Arduino. I do plan to replace the inside unit with the pico to handle everything inducing saving info for a possible web page update.
Bob
Statistics: Posted by parrst — Sat Aug 17, 2024 4:20 pm — Replies 4 — Views 61