Weathershield Metrics

Started by peckcj, January 16, 2016, 03:16:09 AM

Kilo95


Kilo95

one more question, if i want the pressure calculated for my elevation/altitude instead of the constant that is set, where do i locate that in the sketch? i'm at 667 feet. i've noticed both of my WS are off from the National Weather Service office here by 0.4-0.4 inches

Felix

Quote from: Kilo95 on February 16, 2016, 06:50:17 PM
if i want the pressure calculated for my elevation/altitude instead of the constant that is set, where do i locate that in the sketch? i'm at 667 feet. i've noticed both of my WS are off from the National Weather Service office here by 0.4-0.4 inches
I guess I don't really understand that question.
The metric value comes directly from the sketch running on the Moteino. If you need that converted to something else, I think that's where you would do it. Also if the sensor absolute value is off compared to something else, that I cannot comment on.

jra

If you are using the stock sketch, just change the #define for ALTITUDE from 218.3 (meters) to 203.3 meters (equivalent to 667 feet).

Kilo95


Kilo95

I'm using the weathershield node sketch. Not the plain WS one. The plain one doesn't have all of the radio code in it. The one I'm using does but doesn't have a #define altitude. I'll have to play with it more later

Kilo95

ok, so i looked at the WS sketch (https://github.com/LowPowerLab/WeatherShield) and i see where to change the altitude. I'm using the WeatherNode.ino sketch to transmit to my gateway. I couldn't locate where to change the altitude in the WN sketch (https://github.com/LowPowerLab/RFM69/blob/master/Examples/WeatherNode/WeatherNode.ino). I see all the comments about changing it but there's nothing to change that I saw. I compared my readings to the NWS today and my nodes are showing 0.8inHg lower than the NWS office. I'd just like to get them close :)

Felix

If you follow the trail, it leads to these lines:

#define ALTITUDE 218.3 // Altitude in meters
...
          p0 = pressure.sealevel(P,ALTITUDE); // we're at 1655 meters (Boulder, CO)
          Serial.print("relative (sea-level) pressure: ");
          Serial.print(p0,2);
          Serial.print(" mb, ");
          Serial.print(p0*0.0295333727,2);
          Serial.println(" inHg");

          // On the other hand, if you want to determine your altitude from the pressure reading,
          // use the altitude function along with a baseline pressure (sea-level or other).
          // Parameters: P = absolute pressure in mb, p0 = baseline pressure in mb.
          // Result: a = altitude in m.

          a = pressure.altitude(P,p0);


I removed these in the WShield wireless sketch. I guess you'd have to call pressure.sealevel(P,ALTITUDE); to set the sea level or relative to your altitude.

Kilo95

So I can just add those lines back into the WS sketch where you took them out? I thought I'd tried that. I can give it a shot again though

Felix

I'm just guessing :)

If you look at the library:

double sealevel(double P, double A);
			// convert absolute pressure to sea-level pressure (as used in weather data)
			// P: absolute pressure (mbar)
			// A: current altitude (meters)
			// returns sealevel pressure in mbar

Kilo95

i'm going to have to play with it a bit. i'm looking through the link to the bmp180 library

Kilo95

I've gotten the correction factor (-0.7229). I still can't figure out where to put that. Maybe where the pressure reading gets returned from the BMP180? I thought that was return P but i tried return P-0.7229 but that didn't work. any suggestions? my inexperience is showing

Felix

I think this is being addressed in this topic.