richrarobi wrote: (You also need to know the altitude of your airport, and that of the surrounding terrain. (!))
If you know your elevation from a GPS receiver you can use that to calibrate your BMP180. Here's a bit of python to help, beware it's got my elevation (112.2m) hard coded into it.
Code: Select all
#!/usr/bin/python
import math
import sys
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-a', '--altitude')
parser.add_argument('-p', '--pressure')
parser.add_argument('-m', '--msl')
args = parser.parse_args()
if args.altitude is None:
args.altitude = 112.2 # Value from my GPS for my house
if args.pressure is None:
print "Pressure value required"
sys.exit(40)
if args.msl is None:
args.msl = 1013.25
args.pressure = float(args.pressure)
args.altitude = float(args.altitude)
args.msl = float(args.msl)
print "Alt:", args.altitude, "Pressure:", args.pressure, "MSL:", args.msl
print "Sealevel:",args.pressure/pow(1-(args.altitude/44330.0),5.255)
print "Alt:",(44330.0*(1-pow(args.pressure/args.msl,1/5.255)))
Running that
pi@pi:~/bmp180$
./msl_pressure.py --altitude 112.2 --pressure 996.4
Alt: 112.2 Pressure: 996.4 MSL: 1013.25
Sealevel: 1009.75816444
Alt: 141.238109908
pi@pi:~/bmp180$
That's as at 16:03Z in my sitting room.
pi@pi:~/bmp180$
./msl_pressure.py --msl 1009.75 --pressure 996.4
Alt: 112.2 Pressure: 996.4 MSL: 1009.75
Sealevel: 1009.75816444
Alt: 112.13196452
pi@pi:~/bmp180$
That matches quite well with current observations from EGLL and EGVO translated using
https://www.aviationweather.gov/adds/metars/