A barometer in a smartphone is a MEMS sensor that measures atmospheric pressure for altitude determination and weather forecasting. Modern barometers record pressure in the range of 300 to 1100 hPa with an accuracy of 1 hPa, which corresponds to an altitude error of less than 1 meter. According to Bosch Sensortec BMP580, 2024, the absolute accuracy of modern pressure sensors is ±0.5 hPa, allowing altitude determination with an accuracy of 0.4 meters.
Key Takeaways
Barometer in a mobile phone is a miniature absolute pressure sensor based on MEMS technology (Micro-Electro-Mechanical Systems). It measures atmospheric pressure in hectopascals (hPa), equivalent to millibars. The first mass-market smartphone with a barometer — Samsung Galaxy Note 2 (2012) — started the trend of integrating the sensor into flagship devices.
Market leaders are Bosch Sensortec (BMP series) and STMicroelectronics (LPS series). A typical BMP580 sensor measures 2.0×2.0×0.7 mm, consumes 1.3 µA in low-power mode, and has a range of 300–1250 hPa. Relative accuracy is ±0.08 hPa, allowing altitude changes of 0.7 meters to be detected. According to the BMP580 Datasheet (2024), noise level does not exceed 0.2 Pa.
| Parameter | Value |
|---|---|
| Range | 300–1250 hPa |
| Absolute Accuracy | ±0.5 hPa |
| Relative Accuracy | ±0.08 hPa |
| Power Consumption | 1.3 µA (low power) |
| Size | 2.0×2.0×0.7 mm |
| Interface | I²C / SPI |
The main function is refining altitude in navigation. In the USA, the Federal Communications Commission (FCC) has recommended since 2015 that smartphones be equipped with barometers to improve location accuracy during emergency 911 calls — vertical accuracy saves lives in multi-story buildings.
At the heart of a MEMS barometer is a silicon diaphragm 1–3 microns thick that flexes under atmospheric pressure. The diaphragm is integrated with a vacuum cavity — a reference pressure. Capacitive or piezoresistive methods are used to measure the deflection.
In capacitive sensors (Bosch BMP), the diaphragm acts as a movable capacitor electrode. When pressure changes, the gap between the diaphragm and the fixed electrode changes by 0.1–1 nm, causing a capacitance change of 5–50 fF. A C/V conversion circuit (capacitance-to-voltage) amplifies the signal to a level sufficient for a 24-bit ADC.
MEMS barometers contain an integrated temperature sensor because gas pressure directly depends on temperature according to the law P = ρRT. Without compensation, a 1 °C temperature change causes an error of 0.1 hPa — equivalent to 0.8 meters of altitude. Modern sensors use calibration coefficients stored in OTP memory (One-Time Programmable) for digital correction in the range from -40 to +85 °C.
GPS determines altitude based on satellite signal trilateration — vertical error is 10–30 meters due to satellite geometry and ionospheric delays. Barometer provides altitude with an accuracy of 0.5–1 meter using the barometric formula. In scenarios with limited sky view (urban canyons, indoors), GPS may be unavailable — the barometer always works.
Altitude is calculated using the formula: h = (T₀ / L) × (1 − (P / P₀)^(R×L / g)), where T₀ is the temperature at sea level, L is the temperature gradient, P is the measured pressure, P₀ is the sea level pressure. Simplified: a pressure change of 1 hPa corresponds to approximately 8.4 meters at low altitudes. Accurate calculation requires weather station data for P₀.
Modern navigation systems (Google Maps, Yandex Maps) use a hybrid algorithm: GPS provides absolute altitude with an error of 15 meters, the barometer provides relative change with an accuracy of 0.5 meters. A Kalman filter combines both signals, outputting altitude with an accuracy of 1–3 meters in real time.
data class BaroReading(
val pressure: Float,
val altitude: Float
)
private val P0_SEA_LEVEL = 1013.25f
fun calculateAltitude(pressure: Float): Float {
return SensorManager.getAltitude(
P0_SEA_LEVEL, pressure
)
}
fun calibratePressure(
gpsAltitude: Float, baroPressure: Float
): Float {
// P0 calibration by GPS altitude
val expectedPressure = P0_SEA_LEVEL *
Math.pow(1f - (0.0065f * gpsAltitude) / 288.15f, 5.255f)
.toFloat()
return P0_SEA_LEVEL * baroPressure / expectedPressure
}
Android provides access to the barometer via Sensor.TYPE_PRESSURE. Data is returned in hectopascals (hPa), equivalent to millibars. A typical value at sea level is about 1013.25 hPa. The sensor belongs to the category of Environmental Sensors — it does not require user calibration and works immediately after initialization.
The barometer does not require a high polling rate — SENSOR_DELAY_UI (67 ms) or SENSOR_DELAY_NORMAL (200 ms) are perfectly sufficient. Atmospheric pressure changes slowly, at most 0.5–1 hPa per hour with weather changes or 1–2 hPa per minute when moving in an elevator. Excessive frequency only drains the battery.
class BarometerActivity : AppCompatActivity() {
private val sensorManager by lazy {
getSystemService(SENSOR_SERVICE) as SensorManager
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val barometer = sensorManager
.getDefaultSensor(Sensor.TYPE_PRESSURE)
barometer?.let { sensor ->
sensorManager.registerListener(
this, sensor,
SensorManager.SENSOR_DELAY_NORMAL
)
}
}
override fun onSensorChanged(event: SensorEvent) {
val pressure = event.values[0]
val altitude = SensorManager
.getAltitude(1013.25f, pressure)
updateUI(pressure, altitude)
}
}
Not all Android devices have a barometer — the sensor is absent in budget models and many mid-range devices. Before use, check availability via PackageManager.hasSystemFeature(PackageManager.FEATURE_SENSOR_BAROMETER) or through sensorManager.getDefaultSensor(Sensor.TYPE_PRESSURE) — returning null means the sensor is absent.
The barometer is used in a wide range of applications — from meteorology to sports trackers and indoor navigation. The WeatherPro app uses barometer data to build a 24-hour pressure chart, allowing weather changes to be forecast 6–12 hours ahead with up to 80% accuracy.
During weather changes, atmospheric pressure changes by 1–3 hPa over 6–12 hours. An anticyclone (high pressure area) gives readings of 1020–1040 hPa, a cyclone (low pressure) — 970–1010 hPa. These changes must be considered when calculating altitude: if yesterday the sea level pressure was 1013 hPa, and today it is 1025 hPa, the altitude determination error without P₀ correction will be about minus 100 meters. Modern navigation apps get reference pressure P₀ via the internet from the nearest weather station.
In shopping malls and airports, the barometer is used to determine which floor the user is on. The pressure difference between floors of a typical building (floor height 3–4 meters) is 0.35–0.5 hPa — enough for reliable detection. Combining the barometer with Wi-Fi trilateration, indoor navigation determines location with an accuracy of up to 5 meters.
A new generation of waterproof barometers (Infineon DPS368, 2024) withstands submersion up to 10 meters and has an accuracy of ±0.05 hPa. The development of MEMS technology is bringing barometers closer to the accuracy of quartz standards — it is expected that by 2027 the typical error will decrease to ±0.2 hPa.
Frequently Asked Questions
You can check using Sensor Test apps from Google Play. A barometer is present in all flagship Samsung Galaxy S and Note smartphones (starting from S3), Google Pixel (all models), iPhone 6 and newer. In budget models, the sensor is usually absent.
Using the barometric formula: atmospheric pressure decreases with altitude. At sea level, pressure is 1013.25 hPa, at an altitude of 500 meters — about 955 hPa. Every 8.4 meters of ascent reduces pressure by approximately 1 hPa. For accuracy, calibration against the nearest weather station is needed.
Yes, in weather station apps. A sharp pressure drop of 3–5 hPa in 3 hours indicates an approaching cyclone and worsening weather. Rising pressure is a sign of improvement. However, accurate forecasting requires meteorological service data.
No — calibration happens automatically. Manufacturers program calibration coefficients at the factory. However, if you live at an altitude of 1000+ meters above sea level, it is worth setting the reference pressure in the navigation app for better accuracy.
SENSOR_DELAY_NORMAL (200 ms) is optimal — atmospheric pressure changes slowly. For tracking elevator movement, 200 ms is sufficient. Excessive frequency (FASTEST) provides no advantage but increases power consumption by 20–30%.
Summary
We will develop a mobile application turnkey
IT Sectr creates iOS and Android applications for startups and businesses since 2017. We will advise you and propose the best solution.
Read also