=== Measuring Air Pressure ===
Introduction to Pressure
Think of air as a pile of loose molecules stacked kilometers high, with only gravity holding it all down. The molecules at the bottom of the stack are being crushed by the weight of the molecules above it, compressing those air molecules together creating what is called 'air pressure'. The molecules at the bottom are more compressed than those at the top. The higher you go, the less air there is weighing everything down, resulting in less pressure air overall.
By measuring the air pressure, one can determine the altitude of a balloon.
note: that's a bit of an oversimplification as weather and temperature affect air pressure, too.
How did I measure air pressure?
The pressure sensor I used was the BMP085 by Bosch, conveniently sold as the BMP085 Breakout by Sparkfun for $20. It also has a temperature sensor, both of which are pressure/temperature calibrated for higher accuracy. It outputs data by I2C.
I wired it up to my Axon Mote microcontroller. Although WebbotLib does have BMP085 pressure code, as of this writing WebbotLib doesn't offer the BMP085 code necessary for reading temperature. I recommend you instead using my own pressure_bmp085.h which can be found in my source code. The BMP085 datasheet also has code you can use (if you don't like mine).
You can find further information on temperature measurements at the space balloon temperature measurement tutorial.
How accurate is a pressure sensor for altitude?
But what I didn't know before is that these sensors can fail at the extremes, too.
To determine how accurate the pressure sensor was as an altitude sensor, I plotted the flight pressure data against altitude as determined by GPS. Click to enlarge:
As you can see in the data, it was relatively accurate until around 40k feet, and then it became significantly inaccurate after 70k feet. The pressure sensor reported a max altitude of 92,168k feet, but GPS reported it at 118,533 feet!
It was the only pressure sensor we launched so I have no comparison with other sensors. It's possible the conversion equation as provided by the manufacturer is wrong. Or that this specific sensor does not operate very well in very low pressures. The sensor claimed a max altitude pressure of 0.52% of sea level, and that's a reasonable estimate for that altitude. Or perhaps on that particular day, given the weather and temperature, the pressure was much higher than normal at those higher altitudes.
Another flight would be needed with an additional different pressure sensor to see what's up, pun not intended. If the error is consistent, an additional calibration equation can be applied to compensate for this error. I'll write one before the next flight and update it here then. important My GPS unit didn't work for most of the flight, so I am using Nick's GPS data for this tutorial series. But his data didn't line up with mine as our readings were taken at different intervals. So whenever I report altitude (labeled P-Altitude) in this and later tutorials, I am referencing altitude as determined by the pressure sensor. Refer back to the above chart here to get the actual GPS-determined altitude.
note: If you have access to a vacuum chamber, test your sensor in it before your flight.
Although GPS can give you altitude, it's still good to have a pressure sensor as a backup altitude indicator. Not only does it give you interesting weather data, but you can write software to detect when something is amiss if there is a big discrepancy between the two sensor types, or if you don't have a GPS lock for whatever reason.
It might also help with anti-GPS spoofing, if for some reason you're operating in military conditions . . .
How does pressure vary with altitude?
How does pressure change over the course of a flight?
For further reading on pressure sensor applications, see how I measured the pressure drop of Hurricane Sandy in 2012.
Has this site helped you with your robot? Give us credit -
link back, and help others in the forums!
Society of Robots copyright 2005-2014