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
- Explain how GNSS finds position from pseudoranges, list its error sources, and estimate position error from UERE and DOP
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.
GNSS: position from satellite signals
The barometer gives height above the take-off point, but the VTOL also needs its horizontal position to fly survey lines. That comes from GNSS (Global Navigation Satellite System), the general name for satellite navigation systems such as the US GPS, Europe’s Galileo, Russia’s GLONASS and China’s BeiDou. Most drone receivers now track several of them at once.
How it works. Each satellite broadcasts a radio signal carrying the time it was sent and data describing its orbit and clock; the GPS signals are defined in the interface specification IS-GPS-200 (the civil L1 signal is at 1575.42 MHz). The receiver measures how long each signal took to arrive and multiplies by the speed of light to get a range. Because the receiver’s own clock is cheap and not synchronised with the satellites’, every range contains the same clock error, so it is called a pseudorange. The receiver therefore has four unknowns, its three coordinates and its clock offset, and needs signals from at least four satellites to solve them (Groves, 2013).
Error sources. The range error of each satellite, the user equivalent range error (UERE), adds together several effects:
- Satellite clock and orbit errors in the broadcast data (the “signal in space”)
- Ionosphere: the signal slows in the charged upper atmosphere; single-frequency receivers correct only part of this with a model
- Troposphere: the lower atmosphere delays the signal slightly, most for satellites near the horizon
- Multipath: reflections from buildings, trees or the drone’s own body reach the antenna by a longer path. ESA’s Navipedia says the code multipath error is typically under 2 to 3 m and is reduced by better antennas and by keeping the antenna away from reflecting objects
- Receiver noise and interference
The geometry of the satellites in the sky then scales the range error into a position error. Navipedia gives , where the dilution of precision (DOP) comes only from satellite geometry: HDOP for horizontal and VDOP for vertical. Satellites spread across the sky give a small DOP; satellites bunched in one part of the sky, as beside a tree line or a building, give a large one. Because all satellites are above the receiver, VDOP is normally larger than HDOP, which is the real reason GNSS gives altitude less well than horizontal position and why the barometer is still needed.
What performance to expect? The US GPS Standard Positioning Service Performance Standard (5th edition, 2020) commits to a global average of ≤ 8 m horizontal and ≤ 13 m vertical error at 95%. Its Appendix B shows that with a modern single-frequency receiver in benign conditions the total UERE is about 3.6 m (1 sigma), giving about 6.4 m horizontal and 11.9 m vertical at 95%. Corrections from augmentation systems or RTK, which uses a nearby base station and the signal’s carrier phase, reduce errors to decimetres or centimetres (Groves, 2013), which is why many survey drones carry RTK receivers.
On the flight line, two checks apply. CAAT’s model operations manual (CAAT-GM-UAS-001, section 10.10.3) requires the aircraft to track at least 7 GPS satellites before flight, and ArduPilot’s pre-arm checks refuse to arm on a bad fix or a high HDOP. Neither the satellite count nor HDOP alone proves the position is right, because they say nothing about multipath or bias; module 5 shows how the LiDAR also uses the GNSS time pulse (PPS).
Example 3 Clock errors and the GNSS error budget
First, why the receiver must solve for its clock. Then the 1-sigma position error in open farmland and beside a tree line, using the SPS UERE and assumed DOP and multipath values.
import math
C = 299_792_458.0 # m/s, speed of light
for dt in (1e-9, 1e-6, 1e-3):
print(f"receiver clock off by {dt * 1e9:>9,.0f} ns -> range error {C * dt:>11,.1f} m")
UERE = 3.6 # m, 1 sigma, GPS SPS PS (2020) Appendix B
cases = (("open field", 0.9, 1.7, 0.0), ("beside a tree line", 2.0, 3.2, 3.0)) # HDOP, VDOP, multipath m (assumed)
for label, hdop, vdop, multipath in cases:
u = math.hypot(UERE, multipath)
print(f"{label:<19} UERE {u:.1f} m -> horizontal {hdop * u:.1f} m, vertical {vdop * u:.1f} m (1 sigma)")
receiver clock off by 1 ns -> range error 0.3 m
receiver clock off by 1,000 ns -> range error 299.8 m
receiver clock off by 1,000,000 ns -> range error 299,792.5 m
open field UERE 3.6 m -> horizontal 3.2 m, vertical 6.1 m (1 sigma)
beside a tree line UERE 4.7 m -> horizontal 9.4 m, vertical 15.0 m (1 sigma)
A clock error of only one microsecond shifts every range by about 300 m, so no receiver clock is good enough on its own; solving for the clock as a fourth unknown is what makes GNSS work. In the open field the horizontal error of about 3 m at 1 sigma is consistent with the 6.4 m at 95% in the performance standard, and the vertical error is about twice as large. Beside a tree line, poorer geometry and multipath make both errors two and a half to three times worse, and a vertical error of 15 m compares badly with the barometer’s 0.25 m short-term relative accuracy from Example 1. Take off and land in the open, and fuse GNSS with the barometer and IMU rather than trusting any one of them.
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.
- Trusting GNSS height, or judging GNSS quality by satellite count alone, especially near trees and buildings.
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.
- GNSS solves position and clock offset from pseudoranges to at least four satellites; its error is DOP × UERE, larger vertically than horizontally, and grows with multipath and poor geometry.
Check your understanding
- Pressure falls by 2 hPa near sea level. Roughly how much does altitude change?
- A receiver has a UERE of 4 m (1 sigma) with HDOP 1.5 and VDOP 2.5. What are the 1-sigma horizontal and vertical errors?
- 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
- Horizontal m and vertical m
- 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 | |
| GNSS position error from geometry |
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
- Space Systems Command. (2022). IS-GPS-200N: NAVSTAR GPS space segment/navigation user segment interfaces. link
- U.S. Department of Defense. (2020). Global Positioning System standard positioning service performance standard (5th ed.). link
- Groves, P. D. (2013). Principles of GNSS, inertial, and multisensor integrated navigation systems (2nd ed.). Artech House. link
- Sanz Subirana, J., Juan Zornoza, J. M., & Hernández-Pajares, M. (2011). Positioning error. Navipedia, European Space Agency. link
- Sanz Subirana, J., Juan Zornoza, J. M., & Hernández-Pajares, M. (2011). Multipath. Navipedia, European Space Agency. link
- สำนักงานการบินพลเรือนแห่งประเทศไทย. (2565). รูปแบบคู่มือปฏิบัติการบินของอากาศยานซึ่งไม่มีนักบิน (CAAT-GM-UAS-001, Issue 01 Rev 00). link
- ArduPilot Dev Team. Pre-arm safety checks. ArduPilot Copter documentation. 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