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

See BOM
Download

View all 10 files

View all 7 components

  • 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

  • HeartyPatch will be at Maker Faire NY !!

    Ashwin K Whitchurch09/03/2017 at 14:43 0 comments

    We're very happy  to be showing off HeartyPatch at the Maker Faire New York 2017 at the New York Hall of Science on September 23 and 24th, 2017. Come see us if you will be attending. 

    We will also be displaying HealthyPi for the first time. This is also ProtoCentral's first time exhibiting at Maker Faire and we're very excited !!

    See me at Maker Faire!

View all 27 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

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

dpreed 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

lihaibin811 wrote 08/06/2017 at 11:46 point

Hi,heartypatch is 4 layer board or 2 layer   board? if it is a 4 layer borad ,what is in route 2 and 5? 

  Are you sure? yes | no

Ashwin K Whitchurch wrote 08/06/2017 at 15:38 point

It is two layer only. If you are asking about the route 2 and route 15 in the Eagle files, they are not used. 

We intentionally limited it to 2 layers only for each for modification and re-use by the community.

  Are you sure? yes | no

lihaibin811 wrote 08/11/2017 at 00:23 point

thanks.In the Eagle circuites rules ,the layers is four.

  Are you sure? yes | no

jim wrote 07/13/2017 at 22:51 point

just a question... How does your project work with those with pacemakers?  Is the data valid and safe for the user?

  Are you sure? yes | no

robertncstrickland wrote 05/24/2017 at 10:30 point

imagine if we all had this, hooked to our smart phones and a 911 server, so when something bad happens, we know, and so does the EMTs! kinda like auto Life Alert, but for your heart!

  Are you sure? yes | no

jareklupinski wrote 05/18/2017 at 19:00 point

For one thing, the schematics and code running on those devices isn't available on those sites ;)

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/23/2017 at 17:38 point

Yes, I was going to say the same. None of those are open-source, which we believe also means that none of them can be made better with each comment :) Thanks @jarek319 for believing in open source !!

  Are you sure? yes | no

Deep-Thought wrote 05/15/2017 at 10:41 point

This is absolutely the product I need for my mom. She has some kind of heart arythimia, which is impossible to monitor for doctors because it happens so seldom. (I'm sure long term monitoring exists. But it isn't applied in such cases)

I always wanted to build something she can quickly apply to her chest to monitor the signal while such a episode is happening. But I never got anywhere with this idea.

And here it is. Exactly what I was looking for. And opensource. I have no clue on how to analyse heart signals or how a signal would need to be conditioned to be valuable to doctors. But I'm sure we will get there...

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/23/2017 at 17:42 point

Deep-Thought, thank you. We had those people in mind when we started with this project. We have made a good start I believe and we will get there soon. 

  Are you sure? yes | no

robertncstrickland wrote 05/14/2017 at 19:01 point

hook this up to a pair of smart glasses, and bingo, sniper heart rate monitor in the field!

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/23/2017 at 17:39 point

I don't know what that means, but sure sounds cool :)

  Are you sure? yes | no

robertncstrickland wrote 05/24/2017 at 10:29 point

basically, when sniping, you want to pull the trigger right after a heartbeat, and slowing your heart rate down will allow you to relax, thus pulling off more accurate shots, its a widely controversial topic,

but my own experience (in hunting, and target shooting) has me in the habit of monitoring my heartbeat when shooting, i'm able to instinctively know when my heart beats while not moving in a calm enviroment now. i used to use a stethoscope (not even kidding) and then a couple of rubber bands around my off hand's wrist, to slow circulation and better feel my pulse. i do not reccomend that as it can be harmful even if done right!

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/24/2017 at 14:44 point

Wow, that really is some awesome stuff. Heart rate control, so its like some kind of bio-feedback to get a better shot. I've always wondered how snipers get it so right.

  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