BMP180 / 280, BME280 / 680 Sensors Pressure readings practical notes – Sea Level reporting in sketchess

								S Collins April 2020


The Bosch Range are an excellent range of sensor to be used in Applications like Weather stations, Drones or High-Altitude Balloons HABs but often the use requires the pressure referenced to Sea Level. In classic barometer the needle is adjusted so that the units reading matches an existing location with known pressure nearby.
In our use of these sensor such as in the Heltec CubeCell Capsule, or Board, the software for basic or multiple sensor examples do not take account of the effect on height of the location of the sensor. Pressure rapidly alter as the height is raised or lowered and the formula is below.
p0 = The pressure at sea-level
p = The absolute pressure as measured by the sensor
altitude = m above sea-level of the sensor location

Basic information on Air Pressure is given in appendix 1 of this document.

How to use in Sketches

This mean that in the Arduino sketches uses the following needs to be added to them.

  1. Where the float items are defined add the items in Bold.

    float Temperature, Humidity, Pressure, SLpressure, lux, co2, tvoc

  2. Add the following line in Bold after the get items and will create a measurement of Sea-Level
    Temperature = bme280.getTemperature();
    Pressure = bme280.getPressure() / 100.0;
    Humidity = bme280.getHumidity();
    SLpressure = (((Pressure * 100.0)/pow((1-((float)(ELEVATION))/44330), 5.255))/100.0); // hPa

  3. The output to be sent, can then be altered to send “SLpressure” as opposed to” Pressure” as in bold below.

appData[appDataSize++] = (uint8_t)((int)(SLpressure * 10.0) >> 8);
appData[appDataSize++] = (uint8_t)((int)(SLpressure * 10.0));

I have found this to give accurate Sea Level pressure readings that match that used by the Metrological office for my area.

I hope the above helps, in getting sketches that report accurate sea-level (within sensors ability) values and show that the sensor out of the Box (or Cube!) need to be treated to get representative results.

I can add suitable sketch to my Github, or on my website if people require. Let me know.
I have also written a Set of notes for the BH1750 Light sensor and the calibration of the light reading if interested.

Appendix 1 Typical air pressure levels and effects
High- and low-pressure systems cause day-to-day changes in our weather, and are reported in the weather information but referenced to seal level.

The Earth’s atmosphere exerts pressure on the surface. Pressure is measured in hector Pascals (hPa), also called millibars. Standard pressure at sea level is defined as 1013.25 hPa.

Air pressure is not uniform across the planet, however. The normal range of the Earth’s air pressure is from 970 hPa to 1,050 hPa. These differences are the result of low and high air pressure systems, which are caused by unequal heating across the Earth’s surface and the pressure gradient force.

The highest barometric pressure on record was 1,083.8 hPa (adjusted to sea level), measured in Agata, Siberia, on December 31, 1968.2

The lowest pressure ever measured was 870 hPa, recorded as Typhoon Tip struck the western Pacific Ocean on October 12, 1979.

Areas of high and low pressure are caused by ascending and descending air. As air warms it ascends, leading to low pressure at the surface. As air cools it descends, leading to high pressure at the general, low pressure leads to unsettled weather conditions and high pressure leads to settled weather conditions.

In an anticyclone (high pressure) the winds tend to be light and blow in a clockwise direction (in the northern hemisphere). Also, the air is descending, which reduces the formation of cloud and leads to light winds and settled weather conditions.

In a depression (low pressure), air is rising and blows in an anticlockwise direction around the low (in the northern hemisphere). As it rises and cools, water vapour condenses to form clouds and perhaps precipitation. This is why the weather in a depression is often unsettled, there are usually weather fronts associated with depressions.

For more information see

1 Like

great topic.

in the next source code release of the LoRaWAN Multisensor these calculation will be made when a gps is connected and has a fix