robotics//sensor//barometer
A barometer is a sensor that measures atmospheric pressure, and on a drone or a phone its job is to give altitude, because pressure falls with height at a known rate. A MEMS barometer is a thin membrane over a sealed cavity whose deflection changes a resistance or a capacitance; it is read over I2C or SPI at 25 to 100 Hz and resolves height changes of a few tens of centimetres. Near sea level the conversion comes from the weight of the air column, \(\Delta p = -\rho g\,\Delta h\):
A barometer is a sensor that measures atmospheric pressure, and on a drone or a phone its job is to give altitude, because pressure falls with height at a known rate. A MEMS barometer is a thin membrane over a sealed cavity whose deflection changes a resistance or a capacitance; it is read over I2C or SPI at 25 to 100 Hz and resolves height changes of a few tens of centimetres. Near sea level the conversion comes from the weight of the air column, Δp=−ρg Δh\Delta p = -\rho g,\Delta hΔp=−ρgΔh:
Δh≈−Δpρg≈−100 Pa1.2×9.81≈−8.5 m per hPa.\Delta h \approx -\frac{\Delta p}{\rho g}\approx -\frac{100\ \text{Pa}}{1.2 \times 9.81}\approx -8.5\ \text{m per hPa}.Δh≈−ρgΔp≈−1.2×9.81100 Pa≈−8.5 m per hPa.
So every hectopascal is about 8 m of height, and the same factor turns every error in pressure into an error in altitude.
The weather moves the reference. Atmospheric pressure changes by several hectopascals over a few hours as fronts pass, which is tens of metres of apparent climb or descent for a drone that has not moved; a second barometer left on the ground shows the same drift, which is how the weather is told apart from a fault. The barometer is therefore good for relative height over minutes (holding altitude, detecting a climb) and poor as an absolute altimeter over a day.
The vehicle disturbs its own measurement. Propeller wash and the airflow of fast forward flight change the local pressure around the sensor, ground effect near landing does the same, and the chip warms with the electronics around it, so a reading drifts with temperature. Flight controllers cover the sensor with open-cell foam and estimate a slowly varying baro offset as a state (sensor bias).
It is fused because no altitude sensor is good alone: the accelerometer is smooth and drifts within seconds, the barometer is steady over minutes and wanders over hours, the GNSS receiver does not drift but its vertical error is worse than its horizontal (sensor fusion). The barometer also illustrates the general rule of the sensor family: what is measured is pressure, what is wanted is height, and everything between the two (the weather, the airflow, the temperature) is error.