Close
0%
0%

HeartyPatch: A single-lead ECG-HR patch with ESP32

HeartyPatch is a fully open-source, IoT connected, BLE enabled heart-rate variability & ECG patch with great accuracy

Similar projects worth following
ECG monitors are plenty, so how is this one different? We're glad you asked, read on to find out more. HeartyPatch is a completely open-source wireless single-lead ECG "patch" which can calculate heart-rate, R-R intervals and most importantly, Heart-rate variability (HRV). Connect this data to the web of things through WiFi/Bluetooth, or also connect to an app on your phone, and you've got your very own, smart, cloud-connected HRV monitor.

HRV is the trend at which the heart-rate, or more specifically, the time between two peaks on your ECG, changes. This change in R-R interval, and ultimately the heart-rate can mean a lot of things. For starters, it gives a good indicator of the health of your heart, one step further than just plain old heart-rate. The social implications of such a product would be enormous, think of a device that can predict heart attacks !!!

Once we laid eyes on the MAX30003 single-lead ECG monitoring chip from Maxim, we were excited to make heart-rate variability available at a much lower cost than the "Professional" patches. This led to development of the MAX30003 single-lead ECG monitor breakout board from ProtoCentral.

One thing led to another and here we are with HeartyPatch, a single-lead ECG and R-R intervals/heart-rate monitoring patch. ECG "patches" have long been a dream and a real need for cardiac risk assessment as well as for high-accuracy fitness and health monitoring.

Chest-based ECG has always been the standard for measurement of ECG, especially R-R intervals and HRV. Although optical sensors are available for HR measurement, their accuracy for the purposes of variability is questionable.

HeartyPatch is a completely open-source project with all schematics, layout, firmware and application software that are made available for download from the links given further down in this page.

Features:

  • Single-lead ECG with two electrodes
  • On-board connectors for standard disposable electrodes (eliminates the risk of using custom pads).
  • Uses ESP32 WiFi/BLE SoC
    • Use case for BLE: In a fitness application, data is continuously sent to a the user's smartphone and then optionally to a cloud
    • Use case for WiFi: In a home-based monitoring set-up, data is sent to a cloud using WiFi
  • Li-Ion battery and charging system on the board

Heartrate variability (HRV) also has numerous other uses apart from the cardiac function. Some of the notable ones include:

  • The most obvious - cardiac function and arrhythmia detection. Variation in heartrate and the amount of variance in the heartrate directly corresponds to the Heart rhythm and abnormal rhythms can be detected by algorithms. More information about our studies on this will be published in a future update.
  • Mental stress analysis: The two branches of the autonomic nervous system: the sympathetic and the parasympathetic, constantly interact with each other. When a stress event occurs, there is a temporary increase/decrease in blood pressure which leads to a temporary increase/decrease in heartrate, which is reflected in HRV. Check out the reference: for more details. Funcionality to quantify stress will be added to HeartyPatch soon.
  • Detection of emotional state: Studies have shown that a person’s emotional state (such happiness, fear, etc.) can be detected from studying HRV. This is specifically useful for evaluation of mental states in persons with intellectual disabilities such as autism, who does not express emotions in the way a normal person would. Read more about this at here.
  • Several more applications of heart-rate variability have been identified that range from analysis of ANS (Autonomic Nervous System) dysfunction to even diagnosis of the progression of diseases and conditions such as Alzheimer’s, diabetes, stroke and epilepsy. Once you understand the basics of how the ANS function is reflected in heartrate, there is no limit as to what applications can be built around this technology.

By making this project open-source and available, we intend to lower the barriers of entry in to heartrate variability studies without worrying about intellectual property or NDAs to sign. We have made some incredible progress that we hadn't expected ourselves, but now we intend to let the community build more interesting applications and projects around this.

What's left to be desired:

  • Improving the wearability and aesthetics of the enclosure. This would require some level of physical design.
  • Implementation of machine learning classifiers to detect even more types of Arrhythmia. 

pc_heartypatch_v2.1.pdf

PDF file for same v2.1 schematic

Adobe Portable Document Format - 125.06 kB - 10/21/2017 at 05:56

Preview
Download

HeartyPatch_case_v2.1.skp

3D model for the enclosure for v2.1

SSEYO Koan Play File - 10.77 MB - 10/21/2017 at 05:53

Download

HeartyPatch_ case_v2.1_top.stl

3D printable STL model for the enclosure for v2.1

Standard Tesselated Geometry - 1.34 MB - 10/21/2017 at 05:52

Download

HeartyPatch_ case_v2.1_bottom.stl

3D printable STL model for the enclosure for v2.1

Standard Tesselated Geometry - 328.97 kB - 10/21/2017 at 05:52

Download

pc_heartypatch_v2.1.sch

Latest version schematic in Eagle 6.6

sch - 1.94 MB - 10/21/2017 at 05:52

Download

View all 10 files

View all 7 components

  • HealthyPi 5 is coming !

    Ashwin K Whitchurch02/12/2023 at 03:51 0 comments

    This log is about the launch of a HealthyPi device, from the same time that made HeartyPatch.

    We released HealthyPi 4 on Crowd Supply in 2019-2020 and we have a great campaign. However, during the pandemic induced chaos that was going on, we faced major supply chain issues for critical components of our design. We started working on an alternate design with mostly discrete components for things such as power management ICs and specific TI chips that were in short supply. 

    We then decided to the change the entire design while we're at it and thus was born HealthyPi 5. Here is where it will be launched on Crowd Supply (sign up for updates if you wish to know when the campaign in live).  The new specs of the HealthyPi:

    • RP2040 main microcontroller
    • ESP32C3 RISC-V module with BLE and Wi-Fi support
    • MAX30001 analog front end for ECG and respiration measurement
    • AFE4400 analog front end for PPG
    • MAX30205 temperature sensor via onboard Qwiic/I²C connectors
    • 40-pin Raspberry Pi HAT connector (also used to connect our Display Add-On Module)
    • 1x USB Type-C connector for communication with a computer and programming the RP2040
    • 1x USB Type-C connector for programming and debugging the ESP32 module
    • Onboard MicroSD card slot
    • On-board Li-Ion battery management with charging through USB

    We also now have a TFT display for the first time to preview signals and to use the device as a standalone data acquisition system, no need for a Raspberry Pi. We still kept the name HealthyPi since it is still compatible as a Raspberry Pi HAT and plus now also it also runs on a Raspberry Pi chip !

    Here is a photo of our current prototype of our display addon board and our "pro" carrier board. 

    Follow more development on Crowd Supply, we will keep posting updates here as well.

  • Check out or HeartyBadge

    Ashwin K Whitchurch09/01/2018 at 19:29 0 comments

    It's been a while since we've posted an update!

    Check out our HeartyBadge badge project, an unofficial badge at DEFCON 26 in Vegas this year (2018)

  • An app for HeartyPatch

    Ashwin K Whitchurch01/09/2018 at 18:33 1 comment

    We just released the initial public Beta of our Android app to go along with the BLE capabilities of the HeartyPatch.

    The app displays the heart-rate as well as HRV data, can plot a trend of the R-R intervals and also log data to a file for analysis. 

     Check it out on the Google Play Store

    Most of the BLE framework and code is based on Adafruit's awesome Bluefruit app ! We will continue to add features to this app until we achieve all our project goals, including arrhythmia detection as well as stress calculation.

    Comments and suggestion welcome. 

  • HeartyPatch has started shipping out !

    Ashwin K Whitchurch01/06/2018 at 05:19 0 comments

    We've been busy working on the HeartyPatch for the last few months and we have started shipping out the devices to our crowdfunding backers on Crowd Supply. Check it out at https://www.crowdsupply.com/protocentral/heartypatch/updates/shipping-the-second-batch

    We also now have an Android app !

    Available at: https://play.google.com/store/apps/details?id=com.protocentral.heartypatch

    More to come for HeartyPatch soon. 

  • Check it out at the Supercon

    Ashwin K Whitchurch11/11/2017 at 14:38 2 comments

    I'm over at the Hackaday Superconference 2017 in Pasadena. If you'd like to see the HeartyPatch in action, i'll be somewhere walking around or listening to talks or giving a talk. It's also connected to the Supercon badge for badge hacking !

    The badge displays my heartrate in real-time, beat-to-beat. If you'd like to see in real-time the effect of coffee on my heart, stop by :)

  • HeartyPatch measures stress

    Ashwin K Whitchurch10/27/2017 at 17:22 0 comments

    Stress and its Relation to Heart-rate Variability (HRV)


    Stress is a physiological condition that can be caused by various external stimuli or by our own minds and is mostly considered to be bad (there are also forms of “good” stress). Stress could range from physical stress to mental stress because of excessive cognitive activity (a bad day at the office!). It has been found that stress is a major factor in the cause of several diseases including cardiac disease, and there are a lot of statistics on these issues.

    The autonomic nervous system

    The human body’s Autonomic Nervous System (or ANS), the part of the nervous system that controls the functions of the different organs, is divided into two: the sympathetic (SNS) and the parasympathetic nervous systems (PSNS).

    The SNS and PSNS regulate the autonomic functions of the body such as breathing, swallowing, cardiac function and several others. These two systems are complementary in nature - while the SNS functions as a “fight-or-flight” response, the PSNS takes care of the “rest-and-digest response”.

    Normally, there is a careful balance of the PSNS and SNS activity to ensure proper functioning of the bodily functions. However, during conditions of stress, there is more SNS activity in the mix, which leads to more of the “fight-of-flight” response, thus subjecting one to be “on edge” at all times. This imbalance is what causes us to sweat, the heart to beat faster and muscles to tense up. Because the body is more involved in these functions, it tends to lower activity in other functions which leads to bad things.

    So how’s HRV related to stress?

    The current way to measure stress levels and treat stress is usually by psychological questions and discussion during psycho-therapy or counselling sessions. Short of analysing physiological signals such as EEG and biochemical tests (that typically require blood samples), there is no other way to quantify stress. Recently, HRV has been proven to be a very useful and reliable tool for stress assessment.

    The “heart-rate” is sometimes recorded as single number such as 70 beats-per-minute (bpm), but it’s more accurate to treat heart-rate as a range (such as 60-70 bpm), as the rate will change over any given time-period. Conventional heart-rate monitors average this range over a period of time (usually 5 minutes) to arrive at a single number. In reality though, it always varies, there is always a constant acceleration and deceleration of heart-rate. If there is absolutely no variation at all then it is probably not a real ECG signal!

    Due to this, under normal conditions, there should be lower variability (because of the PSNS and the SNS balancing out each other). If the variability is too high, it could be due to cardiac disease (which is called Arrhythmia), but even if it is too low, it is a clear indicator of stress.So again, the more stressed you are, the lower the variability. Imbalance adds an unnecessary burden to the cardiac system, leading to cardiac disease.

    How does HeartyPatch measure stress?

    Conventional methods of heart rate computation from ECG are unable to pick up short-term changes in the heart rate due to their nature of averaging over a set period of time. The reason for this is also partly related to the accuracy of the R-R (peak-to-peak) detection algorithm. HeartyPatch, on the other hand measures “real-time” changes in heart-rate, which is to say that we measure beat-to-beat changes.

    There are several different ways detailed in numerous publications to assess stress from HRV. Some of them involve just using the R-R interval time to calculate some basic statistics, while some of them involve frequency-domain parameters to compare frequencies to assess the variability. Since we wanted to simplify this process, we decided to stick to only the time-domain...

    Read more »

  • Heart-rate vs. Heart-rate Variability (HRV)

    Ashwin K Whitchurch10/18/2017 at 02:49 0 comments

    We have posted a detailed write-up of how heartrate variability (HRV) is different from heartrate and the significance of HRV over HR. Check it out on our campaign page on Crowd Supply:

    https://www.crowdsupply.com/protocentral/heartypatch/updates/heart-rate-vs-heart-rate-variability-hrv

  • HeartyPatch works with ElitveHRV on Android

    Ashwin K Whitchurch10/15/2017 at 14:27 0 comments

    We tried out the HeartyPatch with several HRV apps via Bluetooth. We found Elite HRV to be quite accurate and easy to use. With the standard Bluetooth BLE profile for heartrate and R-R intervals, this should be compatible with any HRV or Heartrate app.

  • HeartyPatch was at Maker Faire

    Ashwin K Whitchurch10/01/2017 at 17:06 0 comments

    This year, for the first time, we (Protocentral) has a booth at Maker Faire New York 2017. Given the great feedback and support from the Hackaday community, we made the HeartyPatch and the HealthyPi(https://hackaday.io/project/25380-connected-health-open-source-iot-patient-monitor) the main products there. 


    We had an amazing time and a lot of feedback from the audience. "The heart that beats with your heart" attracted a number of people. 

  • Our Crowd Supply campaign is up !!

    Ashwin K Whitchurch09/30/2017 at 21:21 0 comments

    HeartyPatch is now available on Crowd Supply.  You can buy it and support us at: https://www.crowdsupply.com/protocentral/heartypatch

    Crowd Supply

View all 28 project logs

  • 1
    Wearing the HeartyPatch

    To wear the HeartyPatch:

    • Turn ON the HeartyPatch
    • Snap-in two disposable electrodes to the two snap connectors on the back
    • Peel off the sticker backing on the electrodes
    • stick it on the left upper side of the chest
    • In about 5-10 seconds, the device will adjust itself to the signal levels and start picking up beats

    The demo firmware which is pre-installed in the device contains the following functionality:

    1. Flashes the onboard RGB LED in perfect sync with your heart's beats. This is demonstrate heartrate variability.
    2. Provides a Bluetooth Low Energy (BLE) service compatible with any Heart-rate monitoring or HRV analysis software. Here is a recording of the popular EliteHRV app receiving data from the HeartyPatch. To connect to the device, you can install any BLE-compatible heart-rate monitor app on Android or iOS (just search for BLE heartrate on the Google Play store) or you can install EliteHRV for Android or for Apple iOS devices. In a BLE Scan, the device would appear as "heartyPatchXX" where XX stands for the serial number.

    3. Provides a serial data output over the USB port on the board. This data is sent in a format that is understood by our Open Source GUI (described below).

  • 2
    Simulating Arrhythmia detection functionality

    HeartyPatch needs to be connected to a cardiac simulator in order to test the Arrhythmia detection functionality. The following video shows how to connect the HeartyPatch to the simulator and start using it.

    The output of the Arrhythmia detection algorithm is sent over the USB port present on the HeartyPatch. Connect it to a computer's USB port and following the instructions in the "Installing the GUI" section.

  • 3
    Install and run the HeartyPatch GUI

    For demonstrating how the Arrhythmia detection algorithm works internally on the HeartyPatch, a GUI written in Processing for Java has been developed. 

    This software can be downloaded from our Github repo at: 

    https://github.com/Protocentral/protocentral_heartypatch/tree/master/gui_software/heartypatch_gui_hrv

    A few points about this software:

    • The software works on any platform that supports Java and Processing programs. 
    • The GUI is only for visualization, all the processing is carried out on the device itself.
    • The GUI shows the tachogram (R-R intervals), a Poincare plot (recurrence plot used to show self-similarity between successive samples) and a histogram that classifies the R-R intervals into buckets and the number of occurrences of each
    • Finally, the GUI shows the Arrhythmia detection status which is read from the Arrhythmia status bit set by the device

View all 4 instructions

Enjoy this project?

Share

Discussions

Le Thanh Hiep wrote 08/07/2022 at 15:46 point

Hi, how about if we put our 2 finger on 2 electrodes, it's still working fine?

  Are you sure? yes | no

C SARATH KUMAR wrote 08/18/2020 at 14:32 point

I have a question, could you confirm the part number used for USB Micro B Connector is 10118194-0001LF which is mentioned in BOM on find chips? Because it footprint does not match with the Board file. Looking forward for your reply

  Are you sure? yes | no

Thomas Rose wrote 01/08/2020 at 23:30 point

What a fascinating project. Do you think this could somehow adapted / made smaller to fit a cat?

Soo many people have cats with heart (like HCM) problems and would appreciate continued heart rate and HRV-monitoring

  Are you sure? yes | no

Jon wrote 11/08/2019 at 19:55 point

On a Windows machine:  After following the directions and flashing the heartypatch_2_3_tcp_only_bin binaries and loading and running the tcp app, pressing "connect" to connect to "heartypatch.local" is unable to connect.  I'm assuming there are steps missing from the directions.  My guess is there are some steps missing from the directions.

  Are you sure? yes | no

Jon wrote 11/08/2019 at 21:06 point

It's also possible I have received a defective board.  I also cannot connect via bluetooth with the ble binaries

  Are you sure? yes | no

David Held wrote 01/19/2019 at 22:15 point

I cannot update the firmware. I have all the correct versions. When I run the make menuconfig, I get "

No rule to make target `menuconfig'.  Stop."

Can anyone help?

  Are you sure? yes | no

ramrote wrote 11/24/2018 at 17:22 point

From heartypatch website (https://heartypatch.protocentral.com/)  and github code (https://github.com/Protocentral/heartyPatch_Android ) we understand that the heartypatch firmware has following inbuilt services which sends below BT packets with corresponding values.


i.  Heart Rate BLE service (UUID_HEART_RATE_MEASUREMENT) – Heart Rate and RR      Interval

ii. Custom HRV Service (UUID_CUSTOM_HRV) - Mean RR, PNN50, SDNN, RMSSD and ArrDetect

iii.  UUID_CUSTOM_POSITION – position

iv.  UUID_BATTERY_LEVEL – battery level              

We have observed that UUID_HEART_RATE_MEASUREMENT & UUID_CUSTOM_HRV comes regularly whereas other two packets comes randomly.   

Now, questions here are: 


a.  Please correct if there is any gap in our understanding ?
b.  What is the transmission frequency  of UUID_HEART_RATE_MEASUREMENT & UUID_CUSTOM_HRV, is it real time or has some fixed time interval ? 

c.   What is significance of UUID_CUSTOM_POSITION packet and when is this packet transmitted?

d.   We have observed that position value is always “0”, does this mean we are not putting device at proper place ?

e.  Does UUID_BATTERY_LEVEL packet transmitted only when there is battery level change ?

  Are you sure? yes | no

myogi2704 wrote 10/31/2018 at 06:28 point

Hi,

The latest build has RRI, Rhythm and Position.  My question are:

When we say Rhythm : Normal / Abnormal,  what values is considered Normal and what values are Abnormal.

What does "Position" field signifies?  What does Position: 0 mean?

Thanks,

  Are you sure? yes | no

myogi2704 wrote 09/28/2018 at 10:29 point

Hi,  

What is the sampling rate of HRV data in heartypatch? 

At what frequency should i read data from Bluetooth heartypatch Device?

  Are you sure? yes | no

Francis Styck wrote 07/20/2018 at 22:59 point

Request that pdf of schematic be added to pc_heartypatch_v2.3, I spent too much time trying to install the driver the for CP210X shown on the v2.1 pdf rather than the required FTDI driver, everything working now so I can update the firmware (got it building a few days ago).

UPDATE: I was able to download Adobe Eagle and load schematic and create PDF myself.

  Are you sure? yes | no

Domen wrote 07/10/2018 at 10:23 point

Hi, why are you not answering questions? I would like to buy this product but it seems that you are not offering any support. How long does the battery last with continuous monitoring? 

  Are you sure? yes | no

myogi2704 wrote 07/09/2018 at 07:33 point

I have heartypatch Android application receiving data from heartypatch device,  I see mqtt server configuration on the main screen, Will the application publishes all the data received from heartypatch, like SDNN, RMSSD....?  If I register clients on mqtt broker, can I subscribe to a topic to receive real time data from heartypatch?

  Are you sure? yes | no

Sanwal Yousaf wrote 03/14/2018 at 23:07 point

Hey guys i got my device and i am trying to set it up. I am trying to use the data collected and use it for a machine learning project. How would i go about trying to set it to import the data for ECG signals??

Any help is greatly appreciated.

  Are you sure? yes | no

Beer van Geer wrote 03/08/2018 at 08:28 point

Hello,
Can someone help me out?
I received the heartypatch.
I was able to make it connect to my phone and receive information.
But the data is very irregular and not accurate.
Also i dont see any light on the device react. 
There is no light for every pulse, and also i cant see any difference when the device is turned on (is there a indication light for this as well?).

Thanks!

  Are you sure? yes | no

Florian Lutz wrote 02/01/2018 at 16:47 point

Thank you for this great device. I have got my device and it works very well. I have three questions. 

1) Is it possible to get the raw ECG signals via Bluetooth? 
2) Is it possible that the data in the Wifi version have a variable sampling rate? I mostly get signals between 290Hz and 320Hz.
3) Do I have to select the cutoff Frequency between 50Hz and 60Hz? 

  Are you sure? yes | no

David Held wrote 01/17/2018 at 14:53 point

Very excited to just receive my HeartyPatch! What is the glue that was shipped? Is it for the case if it comes apart? Also, what firmware were the units shipped with?

  Are you sure? yes | no

Ashwin K Whitchurch wrote 01/17/2018 at 18:00 point

@David Held Thank you for buying HeartyPatch ! 

The glue was just in case the case snaps break (its a 3D printed case). It is just the regular cyanoacrylate glue. 

The default firmware shipped is with the BLE only, but can be programmed with WiFi also. We will post an update soon.

  Are you sure? yes | no

moses5407 wrote 12/21/2017 at 07:07 point

Is there a method to transmit data via wifi to a web-based dashboard?

  Are you sure? yes | no

georgekhut wrote 12/07/2017 at 02:59 point

Hi all, just a quick question re this device… will/is it possible to transmit the interbeat-interval in milliseconds, in realtime, as soon as that interval has been calculated? I make biofeedback displays and am always looking for reliable, affordable and opensource hardware and software to support my projects…  http://www.georgekhut.com/

  Are you sure? yes | no

sebastian.hilbert wrote 11/26/2017 at 12:20 point

Could you please make available a short ECG tracing from the Hearty Patch ? That way people without access to the hardware could work on software to handle the ECG data. Thx.

  Are you sure? yes | no

samsonalin wrote 11/09/2017 at 17:22 point

Hello, very nice product, is there any way to include also a form of feedback when for example the HRV is low? 

  Are you sure? yes | no

David P. Reed wrote 08/14/2017 at 20:50 point

Just FYI, there is a nice product with quite similar functionality called Kardia from a US company called Alivecor.

It costs $99. Apparently selling it rin the US as a product requires getting clearance from the US FDA, while avoiding being classified as a medical diagnostic device.

I now own one, but to get access to its software analytics, I had to first get a board certified cardiologist to read my first recorded "strip".

That said, the analytics they do appear to be quite clever pattern recognition.

Which only whets my appetite to "get access to the lower layers" of such a device.

  Are you sure? yes | no

dpkruse wrote 08/15/2017 at 02:43 point

You are talking about this product. https://www.alivecor.com/

Yes it's $99, but it's closed source and it's only good for 30 sec ECG's. 

A nice roundup of many similar devices is here : https://www.ndsu.edu/pubweb/~grier/Comparison-handheld-ECG-EKG.html

All appear to be closed source, all appear to be designed for short readings, not long term readings and all appears to be costing more than USD $100

Of course, if all you want is a 30 second snapshot, then why buy any device ? Just download this free app Photo Afib detector ; https://itunes.apple.com/au/app/photo-afib-detector-free/id1002024668?mt=8

  Are you sure? yes | no

Ashwin K Whitchurch wrote 08/20/2017 at 08:13 point

Thanks @dpkruse and @dpreed for your comments. 

Both seem to be great resources. I guess you need to keep it closed-source only if selling as a medical device as these guys have. Kardia I've seen. looks good, although I guess it just send the data to a cardiologist. 

@dpreed, since you say that you own one and have used it, what do you think of it? does it really help with whatever hert condition you have?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates