Boost Fitness Tracker Accuracy Using High-Accuracy Pressure Sensors

By Richard A. Quinnell

Contributed By Digi-Key's North American Editors

Wearable devices with health and fitness tracking capabilities are growing in popularity. While accelerometers typically feature as a key motion sensor in such applications, they are limited in their ability to provide an accurate estimate of vertical motion, which is essential for accurately determining such parameters as calories expended when climbing an incline. The addition of a precision atmospheric pressure sensor can greatly improve accuracy in measuring this vertical movement, while also helping in the validation of information from other sensors.

Atmospheric pressure sensors are now available that are sensitive enough to detect as little as a 13 centimeter (cm) change in altitude, and come in compact, low-power, and ruggedized form factors suitable for wearable designs.

This article discusses the role of such devices in fitness trackers, introduces an example of an air pressure sensor from TE Connectivity Measurement Specialties that can be used for this application, and then shows how to apply it.

The role of altimeters in fitness trackers

A core element of fitness tracking products is inertial motion sensing using devices such as accelerometers, from which parameters such as steps taken, distance traveled, and calories expended can be calculated (Figure 1). However, the measurement of vertical motion is a challenge for such sensors. While an activity such as climbing stairs is sufficiently different from ordinary walking in its acceleration profile that reliable detection is straightforward, simply walking along an incline is difficult to distinguish from walking on level ground based on acceleration alone. Yet, the effort needed (and calories expended) can be significantly different.

Some consumer studies of fitness tracking accuracy have found that some early-generation devices could be as much as 30% off in their estimates. To more accurately determine fitness parameters, fitness trackers need a simple and reliable means of accurately measuring vertical movement.

Image of wearable devices with fitness tracking capabilityFigure 1: Wearable devices with fitness tracking capability are growing in popularity among consumers. (Image source: Digi-Key Electronics, from TE Connectivity source material)

An atmospheric pressure sensor, or barometer, can offer a solution. All other factors being equal, atmospheric pressure depends on altitude, following a relationship known as the "lapse rate," which is the rate at which an atmospheric variable changes with altitude. An atmospheric (or barometric) pressure sensor can thus function as a barometric altimeter by applying the barometric formula solved for height:

Equation 1 Equation 11


P is the current pressure

P0 is the pressure at sea level (h=0)

The height (h) is in meters (m)

This formula includes several assumptions, including atmospheric composition and an ambient temperature of 15°C, so an accurate calculation of absolute height would require additional information. The equation still applies even under different pressure conditions, however, and is only weakly dependent on temperature conditions. As such, Equation 1 can yield an accurate change in height simply by comparing the results of two successive pressure measurements.

Standard atmospheric pressure at sea level is approximately 1013 millibar (mbar), so a pressure difference of one millibar corresponds to a vertical change of about 8 m. This means that using Equation 1, a high degree of precision in pressure measurement is needed to detect vertical motion on a human scale. Fortunately, compact pressure sensors of sufficient accuracy are now available.

One such atmospheric pressure sensor is the MS5840-02BA microelectromechanical systems (MEMS) pressure sensor from TE Connectivity Measurement Specialties (Figure 2). This device provides 24-bit measurements of both atmospheric pressure and ambient temperature, achieving an effective height resolution of 13 cm in an altimeter application—a resolution fine enough to detect the altitude change from taking a single stair step.

Image of TE Connectivity MS5840-02BA air pressure sensorFigure 2: The compact MS5840-02BA air pressure sensor module offers high performance and precision in a footprint of 3.3 x 3.3 millimeters (mm) and a height of 1.7 mm. (Image source: TE Connectivity)

The MS5840 combines a MEMS pressure sensor with a custom ASIC that digitizes the analog sensor signal and provides a host device interface over the I2C bus, so no additional components are needed when adding it to a fitness tracker design. It is a compact, surface mount module with a footprint of 3.3 x 3.3 mm and a height of 1.7 mm, making it small enough for use in wearable devices. Enhanced ESD protection using a grounded, high endurance lid is available as an option to protect against human-generated static.

The modules support such high accuracy by allowing designers to perform first and second-order compensation of the raw sensor readings to account for device and temperature variations. Each device is factory calibrated at two temperatures and two pressures to yield calibration parameters for use in first-order calculations:

  • Reference temperature - TREF
  • Pressure sensitivity at reference temperature - SENST1
  • Temperature coefficient of pressure sensitivity - TCS
  • Pressure offset at reference temperature - OFFT1
  • Temperature coefficient of pressure offset - TCO
  • Temperature coefficient of the temperature - TEMPSENS

For first-order compensation, designers must retrieve the device's calibration parameters and read the sensor's uncompensated, 24-bit digital pressure (D1) and temperature (D2) values. Then, the difference between the actual and reference temperatures (dT = D2 - TREF) is calculated and used to scale the digital temperature reading (TEMP = 2000 + dT x TEMPSENS) to obtain degrees Centigrade (˚C) with 0.01°C accuracy (2000 = 20.00°C).

Using the corrected temperature, the designer must then correct the pressure reading by first calculating the pressure offset (OFF = OFFT1 + TCO x dT) and the pressure sensitivity (SENS = SENST1 + TCS x dT) at the current temperature. The temperature compensated pressure in millibars with 0.01 mbar accuracy (110002 = 1100.02 mbar) is then calculated as P = ((D1 x SENS/221) - OFF)/215.

First-order corrected readings are valid for warm air. However, at lower temperatures, the sensors need a second-order correction, as diagrammed in Figure 3. Using the results of the first-order correction, the temperature and pressure must be recalculated differently for low (middle box, >10˚C) or very-low temperatures (left-most box, less than or equal to 10˚C).

Diagram of first and second order temperature readings (click to enlarge)Figure 3: While first-order calculations are ok to use with warm air, as temperatures drop to under 20˚C and under 10˚C, second-order compensation of the sensor's readings may be required. (Image source: R. Quinnell, using TE Connectivity source material)

The result of performing both first and second-order corrections is a high degree of accuracy for both pressure and temperature readings across a wide range of temperatures, as shown in Figure 4.

Graph of TE Connectivity MS5840 pressure sensor accuracy (click to enlarge)Figure 4: By performing both first-and second-order compensation, designers are able to obtain high accuracy over a wide temperature range with the MS5840 pressure sensor. (Image source: TE Connectivity)

In addition to its small size and high accuracy, the MS5840 features several other attributes that make it particularly suitable to wearable applications. It is able to operate with a supply voltage from 1.5 volts to 3.6 volts, making it compatible with both 1.8 volt and 3.3 volt logic designs. It is also low power, with a standby current draw of less than 0.1 microamps (µA).

Operating current will depend on the frequency and resolution of sensor readings. The built-in analog-to-digital converter (ADC) uses a sigma-delta conversion approach with a selectable oversampling ratio (OSR). This gives developers the ability to optimize the trade-off between conversion speed and power consumed. The peak current draw during conversion is typically 1.25 milliamps (mA), but with the OSR set to maximum (8192), conversion only lasts 17 milliseconds (ms), for an average power of 20 µA when reading at one sample per second. The minimum OSR setting (256) takes only 0.54 ms for an average 0.63 µA draw.

Sensor resolution is also affected by OSR settings. This should factor into trade-off decisions. At full OSR the module’s resolution is 0.016 mbar, corresponding to a height difference just under 13 cm. At minimum OSR (25), the resolution is 0.11 mbar—about 90 cm.

Pressure sensor design considerations

There are some system design considerations that developers seeking to use a pressure sensor as a barometric altimeter need to bear in mind. A MEMS pressure sensor is essentially a thin plate of silicon mounted as the lid of a chamber containing gas at a reference pressure (or a vacuum). The plate's top surface is exposed to atmospheric pressure via an opening or port in the sensor package. A difference between the chamber pressure and ambient air pressure will flex the plate, creating a mechanical strain that generates a proportionate electrical signal. The ASIC built into the MS5840 detects and digitizes that signal.

This need to expose the sensor to ambient air pressure means that a wearable device design must provide a clear pathway from the sensor's port to outside air. Yet, such a pathway not only allows air to enter the device, it can admit water and dirt. Developers must therefore be careful in both sensor placement within the wearable device to avoid air path obstruction, and in the device's housing design to minimize the opportunity for water entry.

The MS5840 is designed to avoid such issues. The module uses a layered structure to protect the sensor (Figure 5). The bottom-most layer is an alumina substrate with SMT soldering pads that provides mechanical stability to the assembly. The substrate carries the MEMS sensor stacked on the ASIC that provides the signal conditioning, digital conversion, and the I2C interface. An opaque gel fills the space between the electronics assembly and the stainless steel cap that serves as the device's atmospheric port.

Image of TE Connectivity MS5840 pressure sensor module includes an opaque gel layerFigure 5: The MS5840 pressure sensor module includes an opaque gel layer—the black material shown between the port (top) and sensor assembly (below)—to protect the electronics from light, dirt, and moisture. (Image source: Digi-Key Electronics, from TE source material)

The gel serves several purposes. Its main function is to transfer the force of atmospheric pressure to the sensor surface. The gel mechanically couples the sensor to the air while preventing dirt and moisture from reaching the electronics. Because the gel is opaque, it also provides additional light protection to avoid photon-induced electronic noise. The cap contains the gel, provides the module with extra rigidity, and with the grounding option, improves the module's ESD immunity.

Developers can leverage this layered construction to make their wearable device more water resistant by attaching an O-ring to the sensor's lid and positioning the sensor within the wearable's housing so that the stainless steel port aligns with the housing's air opening. When the device is fully assembled, the O-ring between the housing and the sensor cap will seal the housing against dirt and water intrusion into the device, while the gel protects the sensor.

Another consideration to bear in mind when integrating a barometric altimeter into a fitness application is a potential source of measurement error: wind. Moving air exerts less pressure than still air, so an ill-timed gust of wind can cause a temporary drop in air pressure at the sensor just as a measurement is being made. This "noise" in the air pressure signal can cause what looks like an abrupt change in height. Fitness monitoring device developers can mitigate such errors, however, simply by validating the apparent height change against the accelerometer reading. If there is no corresponding acceleration, the altitude "jump" can reasonably be disregarded.

Such mitigation works both ways. A bicyclist riding over a bumpy surface might generate an acceleration profile that appears to be stair climbing. But if that apparent stair climb yields no altitude change, the system can also consider disregarding the accelerometer readings as environmental noise.


As wearable fitness trackers proliferate, their ability to accurately measure health data is increasingly a differentiating factor. The addition of a pressure-based barometric altimeter can improve the accuracy of wearable fitness devices in many ways, particularly with respect to calories spent. Such sensors can also help in the validation of information from other sensors. However, to be applicable in fitness monitoring wearables, the pressure sensor must not only be highly precise, it must also be able to operate at low power and have a very small footprint. As shown, the TE Connectivity MS5840-02BA provides the accuracy, low power, and small size required to fit right into next-generation wearable fitness trackers.


  1. A Sensor Fusion Method for Tracking Vertical Velocity and Height Based on Inertial and Barometric Altitude Measurements, Sabatina and Genovese. (Equation 27)

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Richard A. Quinnell

Richard Quinnell has been an engineer and writer for 45 years, covering topics such as microcontrollers, embedded systems, and communications for a variety of publications. Prior to becoming a technical journalist he spent more than a decade as an embedded systems designer and engineering project manager for companies such as the Johns Hopkins University’s Applied Physics Laboratory (JHU/APL). He has degrees in electrical engineering and applied physics, with additional graduate work in communications, computer design, and quantum electronics.

About this publisher

Digi-Key's North American Editors