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.
Where the float items are defined add the items in Bold.
int ELEVATION = 65; //PUT HERE THE ELEVATION OF YOUR LOCATION IN METERS
float Temperature, Humidity, Pressure, SLpressure, lux, co2, tvoc
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
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, https://github.com/Securethingsuk or on my website http://Securethings.uk/downloads 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 surface.in 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 https://en.wikipedia.org/wiki/Atmospheric_pressure