I'm using a Wind Sensor Rev C and it's been working nicely. I'm using it with an Arduino Uno and a TFT Screen from Adafruit. I have it on a regulated supply (9volts) via a 7805 voltage regulator.
Here is my code:
Code: Select all
const float zeroWindAdjustment = .2; // negative numbers yield smaller wind speeds and vice versa. // was.2
int TMP_Therm_ADunits; //temp termistor value from wind sensor
float RV_Wind_ADunits; //RV output from wind sensor
float RV_Wind_Volts;
unsigned long lastMillis;
int TempCtimes100;
float zeroWind_ADunits;
float zeroWind_volts;
float WindSpeed_MPH;
float Wind_speed;
float wind;
//........
float checkWind() {
TMP_Therm_ADunits = analogRead(analogPinForTMP);
RV_Wind_ADunits = analogRead(analogPinForRV);
RV_Wind_Volts = (RV_Wind_ADunits * 0.0048828125);
TempCtimes100 = (0.005 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits)) - (16.862 * (float)TMP_Therm_ADunits) + 9075.4;
zeroWind_ADunits = -0.0006 * ((float)TMP_Therm_ADunits * (float)TMP_Therm_ADunits) + 1.0727 * (float)TMP_Therm_ADunits + 47.172; // 13.0C 553 482.39
zeroWind_volts = (zeroWind_ADunits * 0.0048828125) - zeroWindAdjustment;
WindSpeed_MPH = pow(((RV_Wind_Volts - zeroWind_volts) / .2300) , 2.7265);
WindSpeed_MPH = WindSpeed_MPH * 100.0;
return WindSpeed_MPH;
}
This is also the second time this has happened to me with a different sensor (but still a Rev C).
I'm wondering what can cause this, especially so I can build a stable project.
Also, if you have a tip for a tip of tool to calibrate the sensor, please let me know. I have a bazillion small screw drivers for a myriad of screw types. None of mine seem to fit the pot correctly.
Thanks in advance for your time,
ladyk