Barometers, airspeed and rangefinders
UAT 205 Sensors and Instrumentation Systems
Lesson
By the end of this module you will be able to
- Compute altitude from pressure with the standard atmosphere and explain the effect of weather-driven pressure changes
- Compute airspeed from pitot differential pressure and convert IAS to TAS
- Compute range from wave travel time and compensate for temperature and tilt
- Calibrate an airspeed sensor following the ArduPilot or PX4 guide
Why this matters
GNSS gives altitude less well than horizontal position, so drones use a barometer to measure height from air pressure. A fixed-wing drone must know its airspeed so it does not stall by flying too slowly, and landing or flying low over crops needs a rangefinder to measure distance to the ground directly. All three sensors rely on the physics of air, so they are affected by temperature and weather in ways you must understand.
Barometers and the standard atmosphere
Air pressure falls with height. The U.S. Standard Atmosphere, 1976, which matches the ICAO standard atmosphere in the lower layers, sets sea-level values of Pa and K, with temperature falling 6.5 K per kilometre. These give the pressure-altitude formula in the formula box. Near sea level, a change of 1 hPa is about 8.3 m of height.
The flight controller uses relative altitude above the take-off point, not height above sea level. But air pressure changes with the weather by several hPa within a few hours, so barometric altitude drifts on long flights. A high-resolution sensor such as Bosch’s BMP390 specifies relative accuracy of ±3 Pa, about ±0.25 m, but that figure excludes weather changes, wind blowing into the sensor port and sunlight heating the board. Builders therefore usually cover the barometer with foam and shade it.
Example 1 Barometric altitude and weather drift
Take-off pressure is 1,008.0 hPa; during the mission the sensor reads 1,001.2 hPa. Assume air pressure falls by 1.5 hPa over one hour of flight.
P0, T0, LAPSE, EXPO = 101325.0, 288.15, 0.0065, 0.190263
def altitude(p_pa):
return T0 / LAPSE * (1 - (p_pa / P0) ** EXPO)
p_takeoff, p_flight = 100800.0, 100120.0 # Pa
rel = altitude(p_flight) - altitude(p_takeoff)
per_pa = altitude(p_takeoff - 1) - altitude(p_takeoff)
print(f"height above takeoff {rel:.1f} m")
print(f"sensitivity near takeoff {per_pa * 100:.2f} m per hPa")
print(f"weather drop of 1.5 hPa looks like a climb of {per_pa * 150:.1f} m")
print(f"BMP390 relative accuracy of 3 Pa is about {per_pa * 3:.2f} m")
height above takeoff 57.0 m
sensitivity near takeoff 8.36 m per hPa
weather drop of 1.5 hPa looks like a climb of 12.5 m
BMP390 relative accuracy of 3 Pa is about 0.25 m
A weather change of only 1.5 hPa shifts altitude by more than 12 m. Without another source, long missions need the barometer fused with GNSS, and the pressure at the landing site should always be checked before landing.
Airspeed from a pitot tube
A pitot-static tube has a forward-facing hole that measures total pressure and side holes that measure static pressure. Their difference is the dynamic pressure (FAA Pilot’s Handbook of Aeronautical Knowledge, flight instruments chapter). Computed with the standard density kg/m³, it gives indicated airspeed (IAS). True airspeed (TAS) needs the real density. On a hot Thai day, the air is thinner, so TAS is higher than IAS.
The ArduPilot guide says to cover the pitot tube at power-up, because the zero offset is measured then. The parameter ARSPD_RATIO sets the ratio between pressure and speed, and ARSPD_AUTOCAL calibrates it in flight. PX4 asks you to shield the sensor from wind, start calibration in QGroundControl, then blow into the tube tip to finish.
Rangefinders
A rangefinder measures distance from the round-trip time of a wave, . Laser types use the speed of light, which barely changes, while ultrasonic types use the speed of sound, which depends on temperature: (NASA Glenn). When the drone tilts, the measured range is longer than the true height and must be multiplied by over flat ground.
Example 2 Airspeed on a hot day, and range from waves
The sensor reads a differential pressure of 245 Pa with air pressure 1,008 hPa and temperature 35 °C.
import math
R, GAMMA, RHO0 = 287.05287, 1.4, 1.225
dp = 245.0 # Pa differential pressure from the pitot
p, t_c = 100800.0, 35.0 # Pa, °C hot-day conditions
ias = math.sqrt(2 * dp / RHO0)
rho = p / (R * (t_c + 273.15))
tas = ias * math.sqrt(RHO0 / rho)
print(f"IAS {ias:.2f} m/s, air density {rho:.4f} kg/m^3, TAS {tas:.2f} m/s")
echo = 0.00583 # s sound round-trip time
a20 = math.sqrt(GAMMA * R * 293.15)
a35 = math.sqrt(GAMMA * R * 308.15)
print(f"ultrasonic: assuming 20 C gives {a20 * echo / 2:.3f} m, at 35 C it is {a35 * echo / 2:.3f} m")
rng, roll = 12.0, 15 # m laser range, degrees of roll
print(f"laser range {rng} m at {roll} deg roll -> height {rng * math.cos(math.radians(roll)):.2f} m")
IAS 20.00 m/s, air density 1.1396 kg/m^3, TAS 20.74 m/s
ultrasonic: assuming 20 C gives 1.001 m, at 35 C it is 1.026 m
laser range 12.0 m at 15 deg roll -> height 11.59 m
On a hot day TAS is about 4% higher than IAS, which affects flight-time and energy calculations. An ultrasonic sensor assuming a temperature 15 °C too low is off by about 2.5%, and a laser that ignores a 15° tilt is off by nearly half a metre at 12 m.
Module lab
Lab: barometer, airspeed and rangefinder
- Leave the board still on a desk for two hours, record barometric altitude and compare with pressure from a nearby weather station.
- Blow a fan at an uncovered board and a foam-covered board and compare the altitude change.
- Calibrate airspeed following the ArduPilot or PX4 guide, then use Example 2 to convert the readings to TAS.
- Measure distance to a wall with an ultrasonic rangefinder at room temperature and in the sun, comparing with a tape measure.
- Tilt a board with a laser rangefinder at several angles and check the compensation.
Common mistakes
Watch out
- Using barometric altitude for long periods without allowing for weather-driven pressure changes.
- Letting wind or sun hit the barometer directly.
- Not covering the pitot tube at power-up.
- Confusing IAS with TAS.
- Not compensating ultrasonic sensors for temperature or lasers for tilt.
Summary
- A barometer converts pressure to altitude with the standard atmosphere; near sea level 1 hPa ≈ 8.3 m.
- Weather-driven pressure changes make altitude drift, so fusion with other sources is needed.
- A pitot tube measures dynamic pressure ½ρv², giving IAS; density correction gives TAS.
- Rangefinders use d = ct/2 and need compensation for temperature (ultrasonic) and tilt.
Check your understanding
- Pressure falls by 2 hPa near sea level. Roughly how much does altitude change?
- What is IAS for a dynamic pressure of 122.5 Pa at a density of 1.225 kg/m³?
- IAS is 20 m/s and the real density is 1.10 kg/m³. What is TAS?
- A laser pulse takes 100 ns for the round trip. What is the range?
- Why does ArduPilot say to cover the pitot tube at power-up?
Answers
- About m
- m/s
- m/s
- m
- The system measures the differential pressure zero at power-up; wind in the tube would make the zero wrong.
Key formulas
| Altitude from pressure (standard atmosphere, troposphere) | |
| Dynamic pressure and airspeed | |
| Range from round-trip time |
Key references
- COESA. (1976). U.S. standard atmosphere, 1976 (NOAA-S/T 76-1562). NOAA, NASA, & U.S. Air Force. link
- International Civil Aviation Organization. (1993). Manual of the ICAO standard atmosphere: Extended to 80 kilometres (262 500 feet) (Doc 7488, 3rd ed.). link
- Bosch Sensortec. (2021). BMP390 digital pressure sensor datasheet (BST-BMP390-DS002-07, Rev. 1.7). link
- Federal Aviation Administration. (2023). Pilot's handbook of aeronautical knowledge (FAA-H-8083-25C). link
- ArduPilot Dev Team. Calibrating an airspeed sensor. ArduPilot Plane documentation. link
- PX4 Autopilot. Airspeed calibration. PX4 user guide (main). link
- NASA Glenn Research Center. Speed of sound. Beginner's guide to aeronautics. link
Further reading
Study the assigned knowledge units in advance, review media and take the module quiz
In class / field
Lab or field practice from worksheets with a safety checklist
Learning evidence: Checked worksheets and quiz results