HealthyPi 5

An extensible, open-source sensor platform for biosignal acquisition

Mar 04, 2024

Project update 11 of 11

Respiration Rate and What It Means

by Ashwin W

We hope all of you have received your HealthyPi 5 by now and are enjoying the experience.

HealthyPi 5 is now in stock and available for purchase on Crowd Supply as well as on Mouser Electronics.

In this update, we will talk about the respiration signal and what it means. We will also go through some of the more common questions/complaints that we get from users about the HealthyPi 5 operation.

Respiration and Respiratory rate

Respiration is the process of breathing. It is the process of taking in oxygen from the air and expelling carbon dioxide. The respiration rate is the number of breaths a person takes per minute. It is an important vital sign and can be used to monitor the health of a person. The respiration rate can be measured using a variety of methods. The most common method is to count the number of breaths a person takes in a minute. This can be done by observing the rise and fall of the chest or by placing a hand on the chest and feeling the breaths. Respiratory rate is considered a vital sign that is sensitive to various pathological conditions including cardiac events, pneumonia and general health status and also a good indicator of stressors such as emotional stress, physical effort and exercise tolerance (Reference). A quick Google search will also show numerous other studies that have used respiration rate as a vital sign to monitor the health of a person.

Patient monitoring devices, however, use more advanced methods to measure the respiration rate. HealthyPi 5 uses a method called impedance pneumography to measure the respiration rate. Impedance pneumography is a method of measuring the respiration rate by measuring the changes in the electrical impedance of the chest as the person breathes, caused by the movement of air in and out of the lungs. The respiration rate is then calculated from the changes in the impedance.

Respiration measurement on HealthyPi 5

HealthyPi uses the same two electrodes that are used for ECG to measure the respiration rate. The respiration channels are connected in parallel to the ECG channels. The MAX30001 chip used in HealthyPi 5 has a dedicated respiration measurement circuitry that can measure the respiration rate. Unlike ECG though, respiration measurement - since it measures thoracic impedance - will work only if the electrodes are placed on the torso and NOT on the limbs.

HealthyPi 5
Electrode placement for respiration measurement

The Analog Devices MAX30001 nicely packages the bioimpedance (BioZ) measurement circuitry and the ECG measurement circuitry in a single chip. The respiration measurement circuitry uses a current source to inject a small current through the body and measures the voltage across the body. The impedance is then calculated from the current and voltage and the respiration rate is calculated from the impedance.

HealthyPi 5
Impedance measurement

Figure 1: Two-electrode impedance measurement model (Image Courtesy: Texas Instruments Application Report SBAA181 - Feb 2011, Respiration Rate Measurement Based on Impedance Pneumography)

To do this, the MAX30001 uses a push/pull current source to generate a square-wave module modulating differentially current (variable from 8 to 96 uA) with a modulated frequency (variable from 0.125 to 131.072 kHz) through the DRVP and DRVN pins that are injected into the body. The bioimpedance is then sensed as a voltage differentially from the BIP and BIN pins. The phase offset of this current can also be adjusted (between 0° to 168.75°) to optimize the signal quality.

HealthyPi 5
MAX30001 BioZ measurement circuitry

Figure 2. BioZ Channel Input Amplifier, Mixer, and PGA Excluding the ADC and Current Drive Output (Image Courtesy: Analog Devices, Inc ,2023, BioZ Channel Input Amplifier, Mixer, and PGA Excluding the ADC and Current Drive Output)

To convert the ADC readings to impedance values, the following formula is used:

BioZ (Ω) = ADC x VREF / (2^19 x BIOZ_CGMAG x BIOZ_GAIN) 

Where ADC is the ADC code (20-bit signed 2’s complement), VREF is usually 1 V, BIOZ_CGMAG is the current magnitude and BIOZ_GAIN is the gain of the bioimpedance amplifier

On the HealthyPi 5, the respiration circuitry is connected to the same electrodes as the ECG circuitry through the following circuit. The current drivers (pins DRVN/DRVP) are capacitively coupled to the ECG electrodes (thus injecting only AC current) and the voltage across the body is measured using the same ECG electrodes connected to the BIP and BIN pins of the MAX30001.

HealthyPi 5
HealthyPi 5 ECG and Respiration circuitry

Figure 3: Extract from the HealthyPi 5 schematic showing the ECG and Respiration circuitry

Respiratory rate calculation on HealthyPi 5

The output from the respiration channel is a waveform that resembles a sine wave with the peaks and troughs corresponding to the inhalation and exhalation of the person and the resulting change in thoracic impedance. The respiration rate is calculating by essentially counting the number of peaks in a minute.

HealthyPi 5
Respiration waveform

Figure 4: Sample respiration waveform recorded from HealthyPi 5

As a significant DC component can be seen from the above signal (which also causes the baseline to wander), the signal is high-pass filtered first to remove the DC component and then the peaks are detected. After DC removal, the peaks can be detected by finding the zero-crossings of the signal as shown in the figure below.

HealthyPi 5
Filtered Respiration waveform

Figure 5: Sample of a filtered respiration waveform with peaks detected

The respiration rate is then calculated by counting the number of peaks in a minute, which is displayed.

Frequently asked questions

In this section, we would also like to go through some of the more common questions/complaints that we get from users about the HealthyPi 5 operation.

Why is the SpO2 reading not stable? / Why is the PPG signal too small?

The SpO2 value, that is calculated from the PPG(Photoplethymogram), can be affected by a number of factors including the placement of the sensor and the skin tone of the person. The sensor should be placed on the finger (that has sufficient perfusion of blood) and should be secured in place. A lot of ambient light can also affect the SpO2 reading.

Some other factors that can affect the quality of the measured PPG include excessive movement, fingernail polish and extreme finger sizes. Also, please place the finger inside the clip so that it is aligned with the LED and the photodiode. Pushing the finger too much inside the clip can also affect the PPG signal. More information is in our sensor hookup guide.

We are also working on the SpO2 algorithm to make it more robust, less susceptible to movement artifacts and handle different skin tones. We will be releasing a firmware update soon that will address these issues.

Why is the ECG signal noisy?

The ECG signal can be affected by a number of factors including the placement of the electrodes, the quality of the electrodes and the skin condition of the person. The skin should be cleaned and dried before placing the electrodes and the electrodes should also be replaced regularly. The electrodes should be placed on the torso as given in the documentation (https://healthypi.protocentral.com/06-Hooking_up_the_Sensors/)

Why is the respiration rate not being displayed? / Why is the respiration rate not stable?

The respiration rate is also affected by the same conditions as the ECG signal. The electrodes, if measuring respiration rate, should be placed on the torso and not on the limbs.

Where’s the HealthyPi Mobile App for iOS?

Although we had an iOS app earlier for the HealthyPi series of board, it is currently not available on the app store, due to compatibility issues with the latest versions of iOS. We are working on a new version of the app that will be compatible with the latest versions of iOS and will be available soon. The Android app is available on the Google Play Store and can be used to interface with the HealthyPi 5.

Bug fixes and firmware updates

Some bug fixes have been made in the firmware and the latest firmware is available on the HealthyPi 5 GitHub repository. Please make sure to update your firmware to the latest version to get the best performance from your HealthyPi 5. We will also soon add this function to the HealthyPi mobile app so that you can update the firmware from the app itself.

More firmware updates are coming soon and we will continue to keep you updated.


Sign up to receive future updates for HealthyPi 5.

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects