-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect altitude calculation. #5
Comments
You are right. I will include a parameter with default value 1013.25hPa. node-red-contrib-bme280/bme280.js Line 59 in 5b3199b
|
Updated in master branch the correction |
The correct solution is to query for the correct data from one of the many weather sites, using a geo location site to get the global coordinates then the actual sea level pressure for the given time and location. The 1013.25 value is a common estimate, but it is not truly accurate. When I wrote my python script to support BME280 sensors, I do get the longitude and altitude, and the valid sea level pressure for the actual location of the sensor, thus I get the most accurate altitude measurement. It is a bit of work, but to get the most accurate result, required. This is one of situations where a GPS reading is of benefit, versus having the user provide the location before sensor sampling. |
GPS or query to external service is beyond the scope of this custom node. Nodered have tons of tools to design your own flows with this logic point out. Now the nodes has a configuration option so you can tune this with your value. But make a modificaiton to allow dynamic change of the value using the trigger input. |
Yes, I just thought it should be noted what the real, true, methodology is to get the altitude correct. Given that you can inject the correct sea-level value, as noted above, into the node, that is reasonable and appropriate. |
Unfortunately, using 1013.25 as an estimated value of pressure at sea level is still not very accurate. I live about 40 m above sea level but the current code, works the elevation out to be over 90 m. |
Maybe it should be a parameter we can pass in so we can change that. |
It is, you can feed the correct value to the node module. The trick is how you get it, you need the GPS coordinates then query a weather site for the sea level pressure value base on the GPS coordinates, if you do this, this will significantly improve the resulting value from the bme280 chip. For example, using 1013.25 at my location, as the 'estimated' seal level pressure, the bme280 reports my location is about 93m elevation. If I use 1004, which for yesterday was the official sea level pressure at my location, bme280 reports the elevation at about 43m. As validation, the official reported elevation for the city I live in, is 41m. So, 43m is reasonable and comparable to the official value. Whereas, 93m, using the estimated sea level value, is just not even remotely accurate. |
In order to calculate the altitude the sea level pressure is needed.
your algorithm considers the pressure at sea level = 0 which is wrong.
Maybe it should be a parameter we can pass in so we can change that.
The text was updated successfully, but these errors were encountered: