Pages: 1 [2]   Go Down
Author Topic: vortex wind speed sensor  (Read 2463 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Montreal
Online Online
Edison Member
*
Karma: 23
Posts: 2485
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most likely you have to fight second problem, as always one step at a time  smiley
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:
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,
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Pages: 1 [2]   Go Up
Jump to: