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.

Views: 21754

Comment by CrashingDutchman on May 24, 2013 at 4:25am

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.

Comment by Georacer on May 24, 2013 at 7:49am

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:

And 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!

Comment by Tom Yochum on May 24, 2013 at 9:59am

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.


Comment by Göran Sandström on May 24, 2013 at 10:04am

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

Comment by Georacer on May 24, 2013 at 10:08am

I was not aware of the discrepancy between the two measurement systems. I googled a few links and I 'll take a read.

About the extraction of altitude from barometric measurements, all the work is done by the library that I linked to. It does temperature compensation. Unfortunately, the BMP085 seems to heat up by at about 5 degC a few minutes after power-up. That means that for the best results, you have to zero its altitude measurement a few minutes after its power up, not necessarily a feasible option.

How would you suggest measuring AGL or MSL altitude for navigation reasons, given that GPS receivers aren't adequately accurate?

Comment by Georacer on May 24, 2013 at 10:09am

In case it is not known, the BMP085 barometer has an embedded temperature sensor, withing the same die. This is the temperature measurement I was referring to in the post above.

Comment by Tom Yochum on May 24, 2013 at 1:51pm

Different altitude sources are best used for different things. For example, barometric altimetry (MSL) is great for keeping relative distance within an airmass, since everyone's sensors are affected by the local conditions by the same amount. For situations that require knowing your height above the ground (AGL), such as landing, the best source is something like radar, sonar, or laser altimetry. These usually only work over short ranges and some have poor accuracy.

GPS uses ECEF coordinates, which are not affected by the current conditions (temperature, etc.), but are also not correlated in any way to the terrain. If you need to operate relative to the ground, you can survey the geometric height of the terrain using a GPS receiver and then use your GPS to navigate relative to that geometric height.

You can also use tabulated geoidal separation data to try to convert between geometric and MSL altitudes, and then blend the two sources together. This has its own set of complications.


Comment by Georacer on May 24, 2013 at 2:13pm

I see where you are getting at.

In the way I want to go about my project, here is a typical flight mission:

  • Take off in a pre-set location
  • Navigate around a set of waypoints that include height, relative to the take-off location
  • Return to the take-off location and land

Now, since my flight mission will be localized over a short area, I assume that using barometric altitude is the way to go. Besides, AGL is the measure most countries limit the maximum allows flight height.

For the landing procedure, I am well aware that neither a barometer or a GPS give adequate resolution. Laser range finders are still quite heavy and expensive, so sonar is the way to go for now. Even though they 're notoriously noisy. This part will come after the summer, though.

Comment by Georacer on May 25, 2013 at 7:48am


After further inspection, I believe that what you describe, measurement matching during climb, GPS lag during descent, isn't happening.

Instead, this is what happens: The GPS has a time lag of a few seconds while resolving the altitude. You can notice that by the time mis-match of the two peaks in the graph. That means that the GPS curve is offset horizontally by a few seconds to the right, exaggerating the difference during descent.

Comment by Georacer on May 25, 2013 at 7:56am

@Tom Yotchum

I found these two helpful articles:

Both claim that in days where temperature at sea level is more than 15oC, barometric altitude will be lower than GPS altitude. However, airspace limits are defined and recorded in barometric altitude, so this number is the most relevant one.


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service