BME280 pressure output.

Hi there,

I have a couple of queries regarding the output of the BME280.

Previously I used the BMP180 and there was a function in the library that allowed you to get relative pressure by supplying the altitude of your location and it did the compensation for you, snippet from the BMP180 example below. ALTITUDE is defined at the beginning of the code.

          #define ALTITUDE (90)
          // The pressure sensor returns abolute pressure, which varies with altitude.
          // To remove the effects of altitude, use the sealevel function and your current altitude.
          // This number is commonly used in weather reports.
          // Parameters: P = absolute pressure in mb, ALTITUDE = current altitude in m.
          // Result: p0 = sea-level compensated pressure in mb

          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, ");

With the BME280, the code for reading the pressure is a lot simpler :smiley: but in the example code there was nothing about getting relative pressure or a sealevel function? Have I missed something or do I just need to do the small bit of maths myself? relative pressure = absolute pressure + h / 8.3 where h is height in metres.

See datasheet for profiles: https://cdn.sparkfun.com/assets/e/7/3/b … asheet.pdf

See Google for pressure altitude equation: https://www.google.com/search?&q=pressu … e+equation

We specifically omitted that feature from the library. It was becoming overly cumbersome to address certain concerns (polite way of saying, it only takes one person to ruin it for the rest of us). We figured most users who were interested, could still use the pressure readings and atmospheric models to perform their own calculations.