docwelch / Weather-Station

Weather station using Arduino and BeagleBone Black

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pressure reading error

golvellius opened this issue · comments

Hi ...
My system :

Arduino uno R3 ( +5 volts ) + Xbee (first version) + Weather Shield ( sparkfun ) + Weather Meters ( SParkfun)+ BBB ...
I have a problem when retrieving the pression from the arduino ...

To get a good values i need to remove this line in the code :

// myPressure.setModeActive(); // Go to active mode and start measuring!

Also i change this value (128) to (7) in this line :

myPressure.setOversampleRate(7); // Set Oversample to the recommended 128

But the error is that the values i get from the sensor is too high 255825.00 after conversion = example 75.72 inHg ..
Sometimes i get 0 from the arduino ...

I used this formula to get the pressure from pascals to inhg :

payload[23] = tdailyrainin & 0xFF;
// Calculo la presion en hpa para enviar a wunther

float pressure = baromin / 100; //pressure is now in millibars

float part1 = pressure - 0.3; //Part 1 of formula

const float part2 = 8.42288 / 100000.0;
float part3 = pow((pressure - 0.3), 0.190284);
float part4 = LOCAL_ALT_METERS / part3; // Local_Alt_Meters esta ya en coma flotante
float part5 = (1.0 + (part2 * part4));
float part6 = pow(part5, (1.0/0.190284));
float altimeter_setting_pressure_mb = part1 * part6; //Output is now in adjusted millibars
float baroin = altimeter_setting_pressure_mb * 0.02953;

unsigned int tpressure = (unsigned int)(baroin * 100);
payload[24] = tpressure >> 8 & 0xFF;
payload[25] = tpressure & 0xFF;

what could be the problem ... a faulty weathershield / arduino ?

Also , sometimes i get that i have rain , but there is no raining ... maybe daily rain =0.09 , 0,10 .. etc .. if i reset the arduino rain = 0 ... after 2 hours rain =0.3 ... etc ...

Thanks so much ...

HI .. I think it's a problem of the sensor installed in the weathershield ...
Now i am using external sensor from bosch BMP280 and works correctly ...

Also i have added to my code an uv sensor .. i have to check if works correctly ..

Thanks a lot ... And sorry for this issue ... ;)