USD

Build a True Wireless Fitness Hearable—Part 1: Heart Rate and SpO2 Measurement

By Stephen Evanczuk

Contributed By Digi-Key's North American Editors

Editor’s Note: Although they have great potential, fitness hearables present significant design challenges in three key areas: biomeasurement, audio processing, and wireless charging. This series of three articles explores each of those challenges one by one and shows developers how they can take advantage of ultra-low-power devices to more effectively create fitness hearables. Here, Part 1 addresses biomeasurement. Part 2 will look at audio processing. Part 3 will discuss solutions for wireless charging and power management for fitness hearable designs.

In-ear smart wireless audio earbuds, also called true wireless hearables, have emerged as popular audio playback devices, particularly during fitness activities when wires can interfere with movement or equipment. By adding heart rate (HR) and oxygen saturation measurement to these designs, developers can create "fitness hearables" that deliver both audio playback and health data.

While adding biomeasurement has great potential, the size and power constraints for products intended for this application present formidable design challenges.

This article discusses health measurements before introducing and showing how to apply a biosensor from Maxim Integrated that provides measurement of heart rate and oxygen saturation through a battery-powered in-ear device.

Health measurements

Beyond its clinical role as a patient’s vital sign, HR has become an essential metric of performance for fitness enthusiasts and competitive athletes alike. Variations in HR reflect underlying physiological health and conditioning, and non-invasive measurement of those variations can be performed simply and effectively using photoplethysmography (PPG). PPG measures changes in transmission or reflection of light at a particular frequency, typically approximately 520 nanometers (nm) (green), caused by changes in tissue blood volume as the heart pumps blood through that tissue.

Besides providing basic data on heart rate, this relatively straightforward technique can even reveal conditions of clinical concern such as premature ventricular contraction (PVC) events more simply than blood pressure measurements or an electrocardiogram (ECG or EKG) (Figure 1).

Image of PPG can detect unusual cardiac events such as premature ventricular contractionFigure 1: Using simple optical methods, PPG can detect unusual cardiac events such as premature ventricular contraction (PVC) without the need for blood pressure (BP) measurements or use of an electrocardiogram (EKG). (Image source: Wikimedia Commons/CC BY-SA 3.0)

Although HR monitoring with PPG provides important information, many users are looking for deeper insight into their physical conditioning and the effectiveness of their training. Pulse oximetry measurements provide this deeper data by measuring the ratio of oxygenated hemoglobin (HbO2) to deoxygenated hemoglobin (Hb), where hemoglobin is the protein molecule in red blood cells that carries oxygen to the body's organs and tissues. Based on this ratio, a pulse oximeter provides a measurement of peripheral capillary oxygen saturation (SpO2), which offers a reliable non-invasive estimate of clinical arterial oxygen saturation (SaO2) measurements performed with blood gas analysis.

To provide this estimate, a pulse oximeter measures the difference in absorption of light by a patch of skin at two different frequencies, typically approximately 660 nm (red) and 880 nm (infrared). These two frequencies correspond to peaks in the absorption spectra of hemoglobin in its deoxygenated and oxygenated states, respectively, enabling rapid estimation of blood oxygen saturation (Figure 2).

Graph of non-invasive optical pulse oximetry methodsFigure 2: Non-invasive optical pulse oximetry methods use the ratio between oxygenated hemoglobin (HbO2, red curve) and deoxygenated hemoglobin (Hb, blue curve) typically measured at about 880 nm and 660 nm, respectively, to determine capillary oxygen saturation (SpO2). (Image source: Wikimedia Commons/CC BY-SA 3.0)

PPG and pulse oximetry techniques are straightforward in concept. In practice, however, implementation of these methods can face significant challenges, particularly in designs for wearables. Both PPG and pulse oximetry methods rely on a photodiode to accurately measure light from green, red, or infrared (IR) LEDs reflected from a patch of skin in fitness bands or smartwatches (or transmitted through an earlobe, for example).

Any external light source or disruption to the optical path comprising LED source, skin, and photodiode can erode accuracy of biomeasurements in these systems. For example, normal variations in ambient lighting can introduce measurement artifacts. Outright measurement errors can occur during extreme changes in ambient lighting such as when the user moves through an area with alternating bright sunlight and dark shadow (the so-called "picket fence" effect in optically-based measurements). Finally, sudden arm movements during high-intensity training or even some routine physical exercises can jostle a fitness band or smartwatch, resulting in similar artifacts or loss of signal entirely.

In-ear sensing systems

In contrast to wrist-worn health monitors, in-ear biosensing can help mitigate some sources of errors and provide accurate results even during the kind of wrist movements that erode measurements with fitness bands and smartwatches1. Although a number of biomeasurement devices have emerged, developers have had limited options for implementing in-ear fitness wearables due to their strict power and size requirements.

To maintain position in the ear, these wearables need to be small and light. These fundamental requirements obviate the use of large capacity batteries required to supply more conventional biomeasurement design solutions. Consequently, designs for in-ear fitness wearables typically need to operate with a more limited power source than that available in wrist-worn products.

At the same time, sufficient power needs to be available to support the multiple functional requirements of an application such as the fitness hearable that is the subject of this series of articles. To perform the optical measurements at the core of this particular article's focus, an effective design requires enough power to drive the green, IR, and red LEDs, as well as power the photodiode and associated analog front-end (AFE). In turn, these diverse optical and electronic components need to be contained within a compact package that meets tight size requirements while ensuring integrity of the optical signal path.

A low-power biosensor from Maxim Integrated addresses these diverse requirements.

Specialized biosensor

Designed specifically for in-ear health monitoring, the Maxim Integrated MAXM86161 provides a complete optical data acquisition subsystem able to perform continuous measurement of heart rate and SpO2 with minimal power consumption. Measuring only 2.9 millimeters (mm) x 4.3 mm x 1.4 mm, the 14-pin device integrates a three LED optical transmission subsystem and photodiode receiver subsystem with signal processing, 128-word first-in first-out (FIFO) buffer and Inter-Integrated Circuit (I2C) serial interface (Figure 3).

Diagram of Maxim Integrated MAXM86161Figure 3: The Maxim Integrated MAXM86161 integrates optical transmission and receiver subsystems with a 128-word FIFO, controller, and I2C serial interface to provide a complete biomeasurement solution. (Image source: Maxim Integrated)

Along with built-in green, IR, and red LEDs, the MAXM86161 optical transmission subsystem includes dedicated 8-bit LED current digital-to-analog converters (DACs) that allow developers to programmatically set each LED's drive current at 31, 62, 94, or 124 milliamps (mA), sourced from a single VLED supply voltage source ranging from 3.0 volts to 5.5 volts. In addition, developers can programmatically set LED drive pulse width to four different durations from about 15 microseconds (μs) to 117 μs. As noted below, this capability provides a key mechanism for meeting specific application performance requirements.

Within the receiver subsystem, a 19-bit sigma-delta analog-to-digital converter (ADC) digitizes the output from the integrated photodiode at rates ranging from 8 samples per second (sps) to 4,096 sps. In turn, a digital filter provides noise reduction using frequency division multiplexing (FDM) or the coefficient decimation method (CDM), as selected by the developer.

For applications that require sample measurements at different levels of resolution, the ADC can be dynamically reconfigured to operate at one of four full-scale dynamic ranges. By reducing dynamic range, developers can increase resolution when required. An additional feature provides an offset value that allows measurement of very low dark current levels without clipping the signal.

Automatic correction

During the sample conversion process, the MAXM86161's ambient light correction (ALC) circuit can be used to automatically cancel photodiode current caused by extraneous sources of illumination. Developers can also program the device to periodically measure the level of ambient light, allowing applications to use their own ALC algorithms to dynamically correct sampled data or to programmatically modify LED drive current to optimize LED output illumination levels against changing ambient levels.

Along with the built-in ALC capability, the MAXM86161 integrates a separate mechanism to deal with the picket fence effect mentioned earlier, where a series of rapid transitions between bright and dark ambient levels can cause sampling errors. When enabled, the MAXM86161's picket fence function automatically detects samples taken during picket fence events and replaces those samples with estimated values. When this feature is enabled, the MAXM86161 compares the output from the low-pass filter to an estimated range, replacing the value when it falls outside of it (Figure 4).

Graph of Maxim Integrated MAXM86161 picket fence mechanismFigure 4: The Maxim Integrated MAXM86161 picket fence mechanism monitors samples (red line) and automatically replaces samples, such as the transient (black line) identified in graph, that fall outside a programmable range (blue lines). (Image source: Maxim Integrated)

Autonomous sampling

During sampling, the MAXM86161's integrated controller orchestrates the transmitter and receiver subsystems to synchronize a sequence of LED output pulses and corresponding photodiode (PD) input readout. The program for this sequence is specified by the developer in settings loaded into six "slots" (LEDCn) contained in a set of three LED sequence control registers (Table 1). Each LEDCn slot specifies a particular sampling operation comprising illumination from a specified green, IR, or red LED followed by associated PD sampling.

ADDRESS REGISTER NAME DEFAULT VALUE B7 B6 B5 B4 B3 B2 B1 B0
0x20 LED Sequence Register 1 00 LEDC2[3:0] LEDC1[3:0]
0x21 LED Sequence Register 2 00 LEDC4[3:0] LEDC3[3:0]
0x22 LED Sequence Register 3 00 LEDC6[3:0] LEDC5[3:0]

Table 1: Maxim Integrated MAXM86161 LED output sequence pulses are loaded into a set of three LED sequence control registers. (Table source: Maxim Integrated)

The MAXM86161 recognizes different predefined values that correspond to different LED operating modes. For example, to specify sampling from LED1 (green), LED2 (IR), or LED3 (red), the developer sets the LEDCn[3:0] field for the desired slot to a binary value of 0001, 0010, 0011, respectively. Similarly, to sample ambient light, the developer sets the desired field to a binary value of 1001. Thus, to program a sequence designed to sample LED1, LED2, LED3, and ambient, the developer sets the following:

LEDC1[3:0] = 0001

LEDC2[3:0] = 0010

LEDC3[3:0] = 0011

LEDC4[3:0] = 1001

LEDC5[3:0] = 0000

The final slot set to binary “0000” indicates the end of the sequence.

The developer would also need to set multiple additional configuration parameters including sample rate, pulse width, drive current, and others. In practice, these various configuration parameters as well as LED sequence registers 0x21 and 0x22 (see Table again) would typically be set before register 0x20, because writing to register 0x20 starts the MAXM86161 measurement sequence. As illustrated later in this article, a software routine might first set these other registers before finally writing to register 0x20 to start the programmed sequence.

After sequence initialization, the controller automatically coordinates LED output pulses and PD input sampling, repeating the programmed sequence at the desired sampling rate (Figure 5).

Diagram of Maxim Integrated MAXM86161’s controller automatically executes sequences of sampling operationsFigure 5: The Maxim Integrated MAXM86161’s controller automatically executes sequences of sampling operations, each involving coordination of an LED output pulse and associated photodiode sample readout. (Image source: Maxim Integrated)

This programmable sequence control enables applications to easily modify measurement modes on the fly. For example, when the application does not require the highest update rates for SpO2 measurements, it can execute a simple change in the sequence control registers to maintain frequent updates to heart rate data using the green LED (LED1). Periodically, the application could reset the sequence to add the IR (LED2) and red (LED3) LEDs to perform SpO2 measurements for a short time before switching back to only heart rate updates.

Power optimization

Besides using this type of application-level approach for reducing power, developers can take advantage of the inherent low-power capabilities of the MAXM86161. In a typical application with a 25 sps sampling rate, the MAXM86161 consumes less than 10 microamps (μA) during normal operation. Beyond its normal low-power operation, the MAXM86161 provides a number of mechanisms for both system level and device level power optimization.

For system level optimization, the device can independently perform biomeasurements during idle periods when the rest of the system including the processor waits in a low-power sleep mode. Here, the MAXM86161 sequence controller can continue to place sample data in the next available slot in the internal FIFO buffer. When the buffer reaches a threshold capacity set by the developer, the MAXM86161 can issue an interrupt to the host processor. In response to this interrupt, the host can wake just long enough to empty the FIFO buffer through the supported I2C interface or remain awake for more extended processing.

Whether operating with this autonomous approach or in more direct control of the host processor, the MAXM86161 can be programmed to use other device-level optimization mechanisms.

One such mechanism allows developers to reduce current consumption to the minimum required to meet application requirements for measurement accuracy. Here, developers can adjust the programmable LED output pulse width capability mentioned earlier to deliver the level of signal integrity required for changing measurement conditions. If an increased signal-to-noise ratio (SNR) is required, developers can increase pulse width to the extent needed (Figure 6).

Graph of LED output pulse width at four different durationsFigure 6: Developers can set the LED output pulse width to four different durations to reduce current to the minimum required to achieve the SNR needed by the application. (Image source: Maxim Integrated)

Other mechanisms allow developers to reduce power during periods when sampling is not required or required only at reduced update rates.

If biomeasurements are not required during extended periods, the MAXM86161 can be placed in a shutdown mode that draws only 1.6 μA. In fact, developers can programmatically disable the device's internal low dropout (LDO) regulator to reduce shutdown current to only about 0.05 μA. That said, restarting an LDO has its own issues, such as delayed startup time or increased inrush current, both of which could be problematic for a specific battery-powered design.

The MAXM86161 also provides a mechanism to automatically switch to 1.6 μA shutdown mode between samples when sampling rates are 256 sps or less, providing significant power savings with no loss in application functionality.

This automatic device-level power reduction mechanism works with the MAXM86161’s proximity detection to conserve power when the in-ear wearable is no longer in contact with the skin. Rather than waste power when the user removes the wearable, for example, developers can set a few MAXM86161 registers to set the device in a lower power configuration provided with its proximity detection mode.

In proximity mode, the device monitors PD output for signals that indicate a reflecting object (such as skin) has drawn near. To reduce power in this mode, the MAXM86161 lowers drive current to the LED used as the illuminating light source and drops the sampling rate to 8 sps, which causes the device to invoke its shutdown mode between samples. When the PD output passes a programmer specified threshold, the MAXM86161 can automatically switch back to full active mode, performing sampling without host processor intervention or issuing an interrupt to wake the processor.

Development support

The extensive functionality integrated in the MAXM86161 results in a simple set of hardware interface requirements. In fact, developers need only a few additional external components to add MAXM86161 biomeasurement capabilities to a microprocessor or microcontroller-based design (Figure 7).

Diagram of Maxim Integrated MAXM86161Figure 7: Because it integrates all the functionality needed for optical biosensing, the Maxim Integrated MAXM86161 requires only a few additional hardware components to complete the hardware interface design. (Image source: Maxim Integrated)

Using the MAXM86161EVSYS evaluation board, developers can rapidly prototype use of the MAXM86161 in an existing design or use the associated MAXM86161EVSYS reference design as the basis for custom hardware implementations.

Perhaps the most challenging aspect of MAXM86161 development lies in determining the optimum configuration for a particular application. As indicated throughout this article, the MAXM86161 biomeasurement device provides a very rich set of configurable settings and performance characteristics.

To help developers arrive more expeditiously at a suitable device configuration, Maxim Integrated provides a MAXM86161 evaluation software application. This application lets developers use a graphical user interface (GUI) to explore the effects of different device settings. Designed for use with the Maxim Integrated MAXM86161EVSYS evaluation board, this application allows developers to easily modify device operational parameters and evaluate the results in terms of MAXM86161 sampling performance and power consumption (Figure 8).

Image of Maxim MAXM86161 evaluation software application (click to enlarge)Figure 8: Used in combination with the Maxim Integrated MAXM86161EVSYS evaluation board, the company's MAXM86161 evaluation software application lets developers explore different device configurations by changing device settings using a series of menus. (Image source: Maxim Integrated)

Whether they use this development platform to determine MAXM86161 configuration settings or arrive at them independently, developers will find that programming the MAXM86161 is largely a matter of writing routines to load those settings into the MAXM86161 during initialization or at runtime.

By way of example, the author was able to acquire from Maxim Integrated a simple MAXM86161 driver that demonstrates the basic design patterns required to operate this device. The driver will soon be available from Maxim Integrated.

The C-language drive module includes a number of sample routines that illustrate the various register updates required to execute various MAXM86161 capabilities such as SpO2 measurement (Listing 1).

Copy
/* Write LED and SPO2 settings */
if (data->agc_is_enable)
   err |= max86161_prox_led_init(data);
else
   err |= max86161_hrm_led_init(data);
 
err |= max86161_write_reg(data, MAX86161_INTERRUPT_ENABLE, DATA_RDY_MASK);
 
err |= max86161_write_reg(data, MAX86161_LED_RANGE_1,
      ( MAX86161_LED_RGE << LED_RGE2_OFFSET )
      | ( MAX86161_LED_RGE << LED_RGE3_OFFSET ));
 
err |= max86161_write_reg(data, MAX86161_PPG_CONFIGURATION_1,
      ( MAX86161_PPG_TINT << PPG_TINT_OFFSET )
      | ( MAX86161_ADC_RGE << PPG_ADC_RGE_OFFSET ));
 
err |= max86161_write_reg(data, MAX86161_PPG_CONFIGURATION_3,
      ( MAX86161_LED_SETLNG << LED_SETLNG_OFFSET ));
 
err |= max86161_write_reg(data, MAX86161_PD_BIAS,
      ( PD_BIAS_125_CS << PD_BIAS_OFFSET ));
 
err |= max86161_write_reg(data, MAX86161_FIFO_CONFIG_2, 
      FLUSH_FIFO_MASK | FIFO_STAT_CLR_MASK);
 
err |= max86161_write_reg(data, MAX86161_LED_SEQ_REG_1, 
      ( LED_RED << LEDC2_OFFSET ) 
      | ( LED_IR << LEDC1_OFFSET ));
 
if (!atomic_read(&data->irq_enable)) {
   enable_irq(data->irq);
   atomic_set(&data->irq_enable, 1);
}

Listing 1: This snippet from the MAXM86161 driver software demonstrates the basic approach for controlling the device by writing configuration data to various device registers. (Code source: Maxim Integrated)

As mentioned earlier, execution of SpO2 measurement follows a pattern common to MAXM86161 operations, largely involving writing settings to device registers to set parameters such as LED current, sampling rate, digital filter selection, ADC dynamic range, and many more.

After updating the appropriate MAXM86161 registers for those settings, the measurement sequence is defined and immediately initiated by setting the LEDC2 and LEDC3 fields in register 0x20 (MAX86161_LED_SEQ_REG_1) to binary 0010 (LED_IR) and binary 0011 (LED_RED), respectively, as demonstrated in Listing 1.

Conclusion

In-ear fitness wearables can offer sustained biomeasurement accuracy but present strict design requirements for small size and ultra-low power consumption. As shown, the Maxim Integrated MAXM86161 biomeasurement device provides a complete optical data acquisition system needed to monitor HR and SpO2 while staying within the size and power constraints of in-ear wearables.

Reference

  1. Bunn, J., Wells, E., Manor, J., & Webster, M. (2019). Evaluation of Earbud and Wristwatch Heart Rate Monitors during Aerobic and Resistance Training. International Journal of Exercise Science, 12(4), 374–384.

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

Stephen Evanczuk

Stephen Evanczuk has more than 20 years of experience writing for and about the electronics industry on a wide range of topics including hardware, software, systems, and applications including the IoT. He received his Ph.D. in neuroscience on neuronal networks and worked in the aerospace industry on massively distributed secure systems and algorithm acceleration methods. Currently, when he's not writing articles on technology and engineering, he's working on applications of deep learning to recognition and recommendation systems.

About this publisher

Digi-Key's North American Editors