HealthyPi 5

An extensible, open-source sensor platform for biosignal acquisition

May 10, 2023

Project update 3 of 12

Heart-rate Variability (HRV) and more on HealthyPi 5 - Part 1

by Ashwin Whitchurch

The HealthyPi 5 has considerable onboard computational capabilities, afforded by its dual-core RP2040 microcontroller. An interesting application of this ability is heart rate variability (HRV) analysis on the device itself. This could be useful for research studies that find correlations between HRV and several other parameters (these parameters being other physiological processes or even environmental factors). A quick search for citations will reveal a number of wide-ranging studies that people have conducted this way. Traditional methods use a long-term ECG recording device (such as a Holter monitor) to record an ECG during the study and then process the ECG data after it is returned to the researcher. With the HealthyPi 5, you get only the processed data, which gives you the capability to do data reduction on the device itself. This could lead to newer and longer term or even real-time studies.

Heart-rate variability is a measure of the variations in time between two consecutive heartbeats. It is an indirect measure of autonomic nervous system (ANS) activity and is used as a measure of stress, fatigue, and other conditions. The ANS is a part of the nervous system that controls the involuntary functions of the body.

Image Source: WikiMedia

The ANS is divided into two parts, the sympathetic nervous system (SNS) and the parasympathetic nervous system (PNS). The SNS is responsible for fight-or-flight responses and the PNS is responsible for rest-and-digest responses. The SNS and PNS are antagonistic to each other and the balance between the two is important for the proper functioning of the body. The HRV is a measure of the balance between the SNS and PNS and can this be a measure of the mental state of the subject. We won’t go into more detail about HRV, but you can read more about it Wikipedia.

What makes the HealthyPi 5 suitable for HRV studies?

Since HRV’s basic concept depends upon the timing between the R peaks, accurate R-R interval measurement is a basic requirement. On the HealthtyPi 5, we used an Analog Devices MAX30001G AFE which, in addition to measuring the ECG and respiration, also contains a hardware R-R detection algorithm. This means we are able to get accurate R-R intervals from the analog front-end without adding any significant computational load on the main microcontroller.

In addition to this, we have the dual-core processor on the RP2040. Since the second core is unused in regular Arduino programs, it can be looped in to do mathematical or statistical calculations in the background while doing continuous data acquisition on the primary core.

The above image shows the current version of the HRV module screen under development connected to an ECG simulator with 15% variability enabled. The plot in red is the real-time ECG, the green is a plot of the realtime R-R intervals, and the one in yellow is called a Poincaré Plot that shows the distribution of the intervals. When completed, we will also have full time and frequency domain analysis capabilities in this module including:

Data Logging and Storage on the HealthyPi 5

The HealthyPi 5 comes with a 16 MB (128 M-bit) NOR flash chip connected to the QSPI pins on the RP2040 which can store both programs and data, as opposed to the 2 MB available on a Raspberry Pi Pico. Assuming the basic program/sketch is a maximum of 1 MB, you can use upto 15 MB of flash memory to store data. For most applications that require short term data logging, this should be sufficient. If you need more than that, there is a microSD card slot connected to one of the SPIs on the RP2040. MicroSD will be slower and more power intensive than the built-in NOR memory, but can add tons of storage for long-term recording applications.

Some quick back of the envelope calculations for a few feasible use cases using only the internal storage could be:

We have more progress and information to report about the HRV module coming soon, so watch out for our next project update. If you have any thoughts about what more you expect from a HRV recording device or something that your application could benefit from, please let us know!


Sign up to receive future updates for HealthyPi 5.

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