OK, so we have some understanding of how the atmosphere (in particular pressure) changes with altitude. And we've learned a bit about how pressure sensors work. So how can we use a pressure sensor to determine altitude?
Well, buried in that lovely U.S. Standard Atmosphere document, on page 12, is this sweet little equation 33a:
Bleh! That's a mess. But don't worry, we can simplify this greatly. This is a full form general purpose equation, so includes all the bells and whistles.
To make it a little clearer, here are the pressure (P) and altitude (H) that we are interested in:
Everything else in the equation is a constant - known values that we simply go look up. Here's a run down:
So, we simply plug in all those values and all that is left is pressure (P) and altitude (H).
But then, one more step. This equation computes pressure for a given altitude, but we want to go the other way - we want to compute altitude for a given pressure. So we need to rearrange the equation.
Here's the end result, after plugging in all those constants and rearranging:
Just plug in pressure P from our pressure sensor and out comes altitude H in meters. Neat!
Someone working at NWS/NOAA probably got tired of answering this one also and put together this little handy cheat sheet:
Yeah! Our answers agree.
Oops. We still got a variable named Pb in the equation. What is that? Lead? Peanut butter? Princess Bubblegum? Nope. It's another pressure. And that's the crux of the problem when it comes to pressure based altimeters. So let's go into some detail about what Pb is and how to deal with it...