Altitude Comparison: barometer vs GPS


This might be a common knowledge, but in the last months I haven't seen a similar post. Maybe someone new to barometers might be interested in this data.

The GPS receivers return altitude data, but this is inaccurate. The error margin depends on the satellite constellation geometry and whether or not you have SBAS DGPS on. I was under the impression that the error was 5-10 meters, but as it turned out, I was wrong.

Recently, I embedded a BMP085 barometer in my autopilot board and operated it with this library:

Barometers can be and are effectively used to calculate altitude, once initialized and zeroed.

So the figure above displays a short manual flight whose altitude is measured both by a barometer and a GPS. The barometer is zeroed upon power-up. The GPS altitude is zeroed, based on the altitude returned before taxiing. It is the time between 20 and 30 seconds. The plane lands at 150 seconds in the exact same place it took off. However, the GPS altitude measurement has already drifted 16m away.

This goes to show that GPS should not be used for altitude measurement, unless a very coarse albeit offset-free measurement is required.

A barometer is a much more accurate and fast device to extract altitude, when operated correctly.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Could weather-data (using a cell-module and gps) and temperature-sensors perhaps be used to correct the barometric measurements?

  • You do realize that GPS outputs geometric altitude, and not mean sea level (MSL) altitude, right? They use different coordinate systems, which accounts for some of the discrepancy. Also, barometric altitude is a function of many parameters, including temperature. It is actually a pretty poor method of measuring height above the ground.


  • The platform is an ST Model Discovery. The one you can see here:


    I don't know what this dip was. You can see a similar one here:

    3692724532?profile=originalAnd also on at the end of the flight but inverted, where the plane crashed in the end of the flight, at about 126s.

    After you noticed it, I hypothesized that it had to do with the rise of cabin temperature, after I installed the wind, closing the cabin. However, my logs don't indicate a rise in temperature more than 1 degC. I don't know what to answer you there. I 'll allow more resolution for the temperature display and see if I have a noticeable rise when I put the wing on.

    For the second graph, when the crash occurred, I believe that as the wing was ripped from the plane, the cabin pressure suddenly dropped and the sensor thought that the altitude was increased.

    I 'll be sure to keep an eye out if that dip occurs again!

    As for the differentiation during descent between the two measurements, this is a very interesting and also consistent one. I 'll try to see what's going on there.

    Thanks for the remarks!

  • Can you explain the small dip to below zero at just over 50s in time?

    You don't see what kind of craft you used the Autopilot with, but it's interesting to see that when altitude increases there is not a big difference between the barometer and gps. However, when altitude decreases the gps seems to respond slower.

This reply was deleted.