Go Down

### Topic: vortex wind speed sensor (Read 5841 times)previous topic - next topic

#### Deshan

#15
##### Aug 28, 2011, 04:34 pm
thanks for ur code but now it's mostly zero .gives an accurate value here and there

windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 9.72 m/s
windspeed : 8.28 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.89 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 0.00 m/s
windspeed : 1.89 m/s
windspeed : 0.00 m/s

#### Magician

#16
##### Aug 28, 2011, 05:03 pm
Most likely you have to fight second problem, as always one step at a time
The issue is bouncing contact from sensor ( anemometer ). There are a few ways to fix it, you can search on forum or google for it.
I'd recommend to set limits on reported duration, so it never goes less than physical capability of the sensor itself. Anemometer, according to web link you posted, works up to 125 mph.
Quote
Rugged wind sensor handles speeds from 5 to over 125 mph.

or 50 Hz, so minimum duration is 1 / 50 = 20 millisecond.
Code: [Select]
`void wspeed(){  duration = millis() - start;  start       = millis();if ( duration > 20 )   //  <<<<------     report only "trustful " results.       updated = 1;}`

BTW, you can improve accuracy, if instead of milliseconds you change your code to microseconds,

#### Deshan

#17
##### Aug 29, 2011, 01:09 pm
Hi Magician,

http://jeremyblum.com/2011/03/07/arduino-tutorial-10-interrupts-and-hardware-debouncing/

what do u think abt the above hardware debouncing thing. Thanks for your code again.but im getting zero's again most f the time

Go Up