Barometric Sensor Output, in the Unit Your Code Expects
The MEMS barometer inside a phone, a running watch or a flight controller reports raw pressure, and almost every driver hands it back in hectopascals — the same number as millibars. The moment that reading meets an altitude formula, a standard-atmosphere table or an SI physics library, it has to be a kilopascal figure instead. The two units differ by a factor of ten and nothing else, which is exactly why the mistake slips through code review: a value that is off by 10× still looks plausible.
Where the Reading Comes From
Phone and wearable APIs
MEMS barometer resolution
Flight-controller telemetry
Indoor floor detection
Checking a Sensor Value Before You Trust It
Most of the time you are not converting once — you are sanity-checking a stream of readings against a table, or against a colleague's units.
Paste the raw reading in
Drop the hPa/mbar figure from your log into the left field — 1004.7, or 898,6 with the comma a European-formatted log writes. The kilopascal value appears while you type, and stray spaces around a pasted number are ignored.
Compare it with the elevation table below
If the site is 700 m up and the sensor claims 101 kPa, something in the chain is calibrated to sea level rather than reporting station pressure. The table further down gives you the expected figure at a glance.
Take the plain number into your test
Each field has its own copy control that hands over the digits alone — no unit, no thousands spacing — which is what a test fixture or a JSON payload needs. Putting the cursor in a field and hitting Ctrl + C grabs the same string.
Go the other way for the driver side
Tap the swap control (↔) when a spec sheet quotes kPa and you need to know what the sensor should be reporting: the reverse step is a multiply by 10, so 70.11 kPa becomes 701.1 mbar.
Standard-Atmosphere Pressure by Elevation
These are International Standard Atmosphere figures — the model most altitude formulas are fitted against. Real weather shifts the whole curve up or down by a few tens of millibars, but the shape is what your code is working with.
| Elevation | Typical context | Pressure (mbar / hPa) | Pressure (kPa) |
|---|---|---|---|
| 0 m | Standard-atmosphere sea level | 1013.25 mbar | 101.325 kPa |
| 500 m | Low hills, top floors of a supertall tower | 954.6 mbar | 95.46 kPa |
| 1 000 m | Plateau town, upper end of a hobby drone climb | 898.7 mbar | 89.87 kPa |
| 1 609 m (5 280 ft) | Mile-high city | 834.3 mbar | 83.43 kPa |
| 2 000 m | Alpine hut, mountain-bike trail head | 795.0 mbar | 79.50 kPa |
| 3 000 m | High trekking pass | 701.1 mbar | 70.11 kPa |
| 5 000 m | Beyond the range most consumer parts are specified for | 540.2 mbar | 54.02 kPa |
| 8 848 m | Everest summit | 314.4 mbar | 31.44 kPa |
Notice the spacing. Near the ground one millibar costs about 8.3 m of height, but at 2 000 m the same millibar is worth roughly 10 m. A fixed metres-per-millibar constant in an app is an approximation that quietly gets worse as the user climbs.
What Helps When You Are Debugging a Sensor Feed
Both boxes stay editable
Enter a figure on either side and the opposite box follows, so you can walk a whole logged descent without resetting the direction each time.
Small deltas survive the trip
Output carries up to eight decimals, so a 0.03 mbar sensor step still shows as 0.003 kPa instead of collapsing to zero, and tiny values switch to exponent form.
Every pressure unit on either side
The searchable lists cover all 26 units across 8 groups, so the same page also handles a pascal figure from an SI library or an inHg value arriving from a US weather feed.
No round trip to a server
Once the page has loaded, the arithmetic happens in the browser — useful when you are picking through telemetry from a field laptop on a weak connection.
Questions Developers Ask About Barometric Readings
My sensor library returns hPa but the datasheet says mbar — do I need to scale anything?
No. The hectopascal and the millibar are the same size, 100 Pa each, so 1004.7 hPa and 1004.7 mbar are one identical measurement written two ways. Only the kilopascal form changes the digits, dividing by ten. Chip vendors tend to print hPa because it is SI-derived; outdoor software tends to print mbar because that is what hikers recognise.
How much height does one millibar of change represent?
About 8.3 m close to sea level, growing to roughly 10 m at 2 000 m and more above that, because the air thins as you climb. In kilopascals the same step is 0.1 kPa. If your app needs metre-level output over a large climb, evaluate the barometric formula rather than multiplying by a single constant.
Why does a watch report a different summit height on two consecutive days?
Because the whole pressure profile slides with the weather. A 10 mbar (1 kPa) difference between a settled high and an approaching low moves an uncalibrated barometric height by roughly 85 m without the watch leaving the shelf. That is why these devices offer a calibration step: you give them a known elevation and they back out the current reference.
If satellite positioning already reports altitude, what is the barometer adding?
Speed and fine resolution. Satellite height is absolute but noisy in the vertical axis and slow to settle, while a pressure sensor resolves fractions of a metre almost immediately — it simply drifts over hours. Fusing the two is the standard approach: the satellite fix anchors the absolute level, the pressure channel supplies fast relative changes such as a flight of stairs or a short hop.
Should altitude-hold code work in millibars or kilopascals?
Whichever the rest of the loop already uses — consistency matters far more than the choice itself. Firmware that is SI elsewhere reads most cleanly in pascals or kilopascals. The controller is really tracking a pressure difference from the hover set point, so the unit only has to be stable; convert once at the boundary, and log both channels if a ground station expects mbar.
No comments yet. Be the first to comment!