Anemometor - inductor measurement

Status
Not open for further replies.

Hi again, I was doing some measurments and noticed a problem, on the attached photo is the output from the arduino, I have a big fan and was counting a good wind meter I have and according to that I was calibrating mine, but as you can see at the photo the 4.42 mph is the correct measurment but without moving it ( I have it steady and same distance, not moving it) every some time it goes to 2.94 mph. Attached the code as well. Do you know why?

Code:

#define mph_var 2.23
#define kph_var 3.6

double windRate, ms, Mph, Kph; //This is the value we intend to calculate.
volatile int count; //This integer needs to be set as volatile to ensure it updates correctly during the interrupt process.

void setup() {
attachInterrupt(0, Wind, RISING); //Configures interrupt 0 (pin 2 on the Arduino Uno) to run the function "Wind"
Serial.begin(9600); //Start Serial
}
void loop() {
count = 0; // Reset the counter so we start counting from 0 again
interrupts(); //Enables interrupts on the Arduino
delay (100); //Wait
noInterrupts(); //Disable the interrupts on the Arduino

//Start the math Calculate for mph or kph or both
windRate = (count * 11.00) * 60; //Take counted pulses in the last second and multiply by 5.0 and then convert it to minutes
windRate = windRate / 1000; //Convert windrate, giving you Velocity/ Hour

ms = windRate;
Mph = ms * mph_var;
Kph = ms * kph_var;

// Serial.println(count); //Print the variable windRate to Serial
Serial.print("m/s: ");
Serial.print(ms);
Serial.print("\t");
Serial.print("mph: ");
Serial.print(Mph);
Serial.print("\t");
Serial.print("km/h: ");
Serial.println(Kph);
}

void Wind()
{
count++; //Every time this function is called, increment "count" by 1
}
 

Attachments

  • Capture.JPG
    126.1 KB · Views: 76
Hi, something else as well, I blow on the fan and I have the measurements attached. So, when I blow on the fan I count the rising so the count is 1-2-3-4-5-6 etc. How can I make it measure more accurate on mph because the output I take for 1 pulse is 1.47 for 2 is 2.94 etc, how can I make it more precise ramp?
 

Attachments

  • Capture.JPG
    66.6 KB · Views: 88
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…