Android Barometer Altitude Reading Is Wrong?

First: The barometers are very precise, but not accurate. If you place 10 Android phones next to each other on a table, you can find barometric pressure differences of up to 3 mb between devices. This is one source of error.

Second: Different groups will define 'altitude' differently, so make sure you're using the same definitions. For example, in the Location class, getAltitude is defined as

Get the altitude if available, in meters above the WGS 84 reference ellipsoid.

http://developer.android.com/reference/android/location/Location.html#getAltitude()

Third, the weather will affect the reading of the barometer by up to 40 mb. If you want to get a more accurate altitude reading from the barometer, you will have to offset from the current weather. The atmosphere can change the local pressure by up to 1-2 millibars per hour (in extreme cases)

Fourth: it is not yet possible to get a completely accurate altitude reading using the barometer in a smartphone. Nobody has solved this yet - the barometer alone is insufficient to achieve floor-level detection, for example.

I'm the developer of PressureNet, by the way - I have collected over 2 billion pressure readings from smartphones, and I see all these types of errors every day.

In closing: the reading that the barometer delivers to you requires significant interpretation before using, if you want to achieve a value for 'altitude'. Every value that is read from every barometer is 'wrong' by default; you'll have to do specific work to make it work for you, depending on what your exact needs are.

github.com/cbsoftware/pressurenet


The air-pressure sensor of a smartphone-type device has very poor absolute accuracy. I.e. when you are stationary the value read will probably not be equal to what you read from another source.

It is, however, rather good at measuring changes to the air-pressure. So if you read the air-pressure at one altitude and then quickly move to another altitude you will get a fairly accurate measure of the difference in altitude (provided you use the right altitude formula, ex. https://physics.stackexchange.com/questions/333475/how-to-calculate-altitude-from-current-temperature-and-pressure)

I.e. if you know the absolute altitude at one of your locations you can compute a rather accurate value for the other location.

It is also important to remember that air-pressure for any location is variable due to weather changes. In a windy environment you will generally find that values are less accurate unless you do some time-averaging or low-pass filtering of the values.

When it comes to altitude values served by Google, the GPS or other sources they generally refer an altitude for a location to an idealized shape of the earths surface. This shape is typically called a geoid (a spheroid shape that rather closesly resembles the actual shape of our globe). The actual surface of the globe, that be either land or ocean, do deviate in shape from the ideal geoid in most places. For areas that were covered by thick layers of ice during the last ice-age the land may still be 30-50 meters below the geoid reference. More details are found here: https://www.esri.com/news/arcuser/0703/geoid1of3.html.

For normal mapping purposes the altitude is referenced to some form of constant. When close to the sea altitude == 0 at LAT (Lowest Astronomical Tide) and local mapping references to altitude is thus traditionally referenced to this level. Other more 'modern' references are also used. Google, the satellite-based global positioning systems, etc. do not use this reference, hence the altitude you get from them and the altitude you calculate (or read off a map) locally do not generally match.