Comments (11)
It returns altitude so I am not sure why you are suggesting the change in name.
from bme280.
Maybe I understand that completely wrong, but the Altitude at SeaLevel is 0.
But we need a function to get a SeaLevel correlated Pressure. So far I read the code, you calculate this.
( https://de.wikipedia.org/wiki/Barometrische_H%C3%B6henformel#Internationale_H.C3.B6henformel )
(You need a SeaLevelAltitude while converting between different geodetic reference systems)
from bme280.
Hi, Tyler, it seems you have caught yourself in the trap of misleading name. The function sealevelAlitude really calculates the sea-level pressure which we know from meteorological reports.
To the formula itself:
- I recommend to check the formula because it is not exactly the same as in the common sources (Wikipedia, NOAA). The speech is about presence of (0.0065 * A) in the denominator of the calculation formula.
- The formula does not respect air humidity.
I recommend the comparison with http://drkfs.net/correctiontosealevel.htm.
from bme280.
Alright all, good data. I should have required more documentation on the pull request. Let me try to clean this up.
from bme280.
from bme280.
I believe some renaming is in order. The readme claims that altitude is returned, but the source paints a more confusing picture:
/// Convert current pressure to sea-level pressure, returns
/// Altitude (in meters), temperature in Celsius
/// return the equivalent pressure at sea level.
It says that it is converting pressures, then says it returns altitude in meters (and temperature), and then says it returns pressure at sea level. A simple test shows that it returns values that as much more in the range of pressure in Pa
than altitude in m
. It seems much more correct to say it accepts pressure (in Pa), Altitude (in meters) and Temperature (in Celsius), and returns pressure (in Pa). The returns
on the first line of the comment seems erroneous and if left out, the comment as written makes far more sense (name of the method notwithstanding)
For example, a current reading from my BMP280 has a pressure of 101425 Pa, and the sealevel calculation returns 102105 Pa. Note that this is using a known-good altitude, and not the altitude as derived from the Altitude()
method, which returns a significantly different value, but is computed with a default sealevel altitude of 101325 Pa as defined in the header
Given that this method seems to return a value in Pa, and that sealevel altitude should be pretty relatively constant, one might wonder what use this method has? For me, it seems to be for calibration of the Altitude()
. When using the 101325 sealevel pressure, my altitude is about 70m from reality, so instead, using my known-good altitude, and obtaining the 102105 Pa pressure from the method, it seems I can use this value in place of the default sea-level pressure in Altitude()
to get calibrated altitudes.
from bme280.
Here is the original pull request: #22
Looks like it was originally written to calculate equivalent sea level pressure in mb. When I refactored the code my analysis showed it was unit independent code. So, using Pa would not impact the calculation.
@guruathwal can you shed some light on the situation.
from bme280.
I'd have to give it a more careful read, but that sounds correct. There winds up being a ratio of sealevel pressure to atmospheric pressure, and since the conversions between various units of pressure are linear, you should be able to pass in pressure in any unit, and get the adjusted pressure back out in the same unit.
It will just be pressure that it converted though, the temperature/altitude are fixed and used to determine the sealevel pressure.
from bme280.
Alright, a change is in order:
- The function will be renamed
equivalentSeaLevelPressure
. - Documentation will be updated.
- New/more functions can be added as mentioned above.
from bme280.
Completed: #49
from bme280.
Hi.. there should not be any confusion..
You input your current altitude in "Meters", Current Pressure in "mb" and current temperature in "celcius"
The function will return equivalent Sea Level Pressure in "mb"
from bme280.
Related Issues (20)
- Station météo
- Station météo
- Filter is only applied to temperature and pressure HOT 3
- STM32F103C8 - bme.begin (); - program stops HOT 3
- BME280 v3.0 not work with u8g2 and display HX1230_SW_SPI HOT 3
- The question of the wind chill HOT 3
- non void function without return value HOT 1
- Propose License Change to LGPL/MIT HOT 28
- AbsoluteHumidity and HeatIndex environment calculations missing HOT 1
- Implement CI HOT 1
- Change Wire hard code over to passed in wire instance in I2C class
- BME280 no humidity :( HOT 1
- BME680 integration HOT 1
- SPI.h is inculed althought BME280Spi is not in use HOT 1
- non-void-return issue in 3.0.0 HOT 6
- ESP32 boot loop when calling bme.begin() HOT 3
- I2C to USB
- delete
- delete HOT 1
- Latest commits do not show on Platformio. Tries to revert to "some 3.0.0" version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bme280.