close-circle
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
close
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

eye
Preview
download-circle
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-circle
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-circle
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-circle
Download

pc_heartypatch_v2.1.sch

Latest version schematic in Eagle 6.6

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

blank
See BOM
download-circle
Download

View all 10 files

View all 7 components

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

    Ashwin K Whitchurch6 days ago 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!

  • New HeartyPatch v2 files uploaded

    Ashwin K Whitchurch08/20/2017 at 08:15 0 comments

    The board and schematic files for the new design have been updated on our Github repo: https://github.com/Protocentral/protocentral_heartypatch

  • We have a new board

    Ashwin K Whitchurch08/18/2017 at 06:10 1 comment

    We've been exploring different kinds of designs which are more wearable and smaller. Towards this end, we have a new PCB design. It’s not drastically different from the original design, but we’ve made some design optimizations here and there. Some of the major changes are:

    • Got rid of the body temperature sensor, since this didn’t seem to add value to this application, although it is a great chip.
    • Made the board smaller, optimizing the placement of the ECG electrode buttons.
    • Added an RGB LED for providing more information than just on and off.
    • We changed the color to white, just because it looked better.

  • Code Changes

    Ashwin K Whitchurch07/22/2017 at 18:28 0 comments

    We have added the latest code for the HeartyPatch on Github. Check it out at https://github.com/Protocentral/protocentral_heartypatch.

    Major changes:

    • MAX30003 interrupt driven code for R-R detection, more accurate interval measurement
    • Bluetooth Low Energy (BLE) support added for HeartyPatch. It now works with generic heart rate monitor apps also.

    We have also added the source and the STL files for the HeartyPatch enclosure. Now, everything is open source !

    And the enclosure files are available under in the "hardware" folder on our GitHub repo.

  • Analyzing HRV for Arrhythmia

    Ashwin K Whitchurch07/20/2017 at 18:42 4 comments

    So now that we had a good way to measure the heart rate and the R-R interval variance, we wanted to put it to test and see if we can actually differentiate between normal rhythms and some common forms of Arrhythmias using the R-R intervals. What we found was quite promising. 

    For HRV analysis, we used Kubios (http://www.kubios.com/), a great piece of software to study heart-rate variability. This is commercial software, not open source, but they do have a version for "Personal use". Since this is an open source project, I'm assuming this would be fine. Please correct me if I'm wrong. 

    The Hookup

    We connected the left-arm and right-arm electrodes of the HeartyPatch to two pins on an ECG simulator that can also do Arrhythmia simulation. Using Kubios, we looked at the Poincare plot (the actual variance between the current sample and the immediate preceding sample) and some spectral analysis (the result of an FFT). These are the results.

    Here are the Poincare plots:


    Results of the spectral analysis:


    As you can see, there are noticeable patterns in both the poincare time-domain data as well as the frequency-domain data to differentiate between these 3 forms of Arrhythmia and a normal sinus rhythm. 

    Now, armed with this data, we can go into recognizing patterns when things go wrong, and even better, BEFORE things can go wrong. We are looking at using Tensorflow (https://www.tensorflow.org/) for creating a machine learning interface for predictive analysis. Of course, large amounts of data would be required to "train" this ML Network, and we're yet to figure out how. 

    Please let us know if you have any comments.

  • We've posted a video with some results

    Ashwin K Whitchurch07/08/2017 at 14:44 0 comments

    Check out a video that we made with some initial data collection using the HeartyPatch device.


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

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

jarek319 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

Rasit Eskicioglu wrote 05/12/2017 at 15:07 point

Ashwin, I liked this project and want to use it as a tool in my research and teaching. How soon can I get hold of a kit or two?

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/14/2017 at 18:13 point

Thank you Rasit, for your interest. We will get in touch with you as soon as we are ready with the tested devices, we do not have a date as of now.

  Are you sure? yes | no

Alex Gibson wrote 05/10/2017 at 10:20 point

Hi, this is amazing work guys.  

My dad just had a 'mild' heart attack, he's out of hospital but I am not confident he is being properly monitored on leaving hospital as he has other risk factors but there is a lot of hand-waving, and I would love to have this in my hands right now.

Ashwin & team, if I pay direct, would you be able to send me a kit of parts I could solder up? I also have electronics experience so I can give testing feedback, I also have a LOT of 3D printers (that's my business) and could potentially help you distribute in the UK.   I am on twitter @alexgibson3d

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/10/2017 at 16:57 point

Thanks Alex. We will work together as discussed over messaging.

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/10/2017 at 04:37 point

Thank you everyone for all the likes/skulls, it helps us keep going

  Are you sure? yes | no

Tim Meyer wrote 05/09/2017 at 20:33 point

As for the electrode connector, it would be nice to have them 46mm apart so they fit 'standard' polar chest belts or shirts with built in electrodes. Also, these typically have the male push-button part on the sensor and the female on the electrodes (see e.g. https://www.decathlon.de/laufshirt-kiprun-cardio-herren-id_8367680.html?searchedText=cardio+shirt) . Can't wait to get the kit! 

  Are you sure? yes | no

Ashwin K Whitchurch wrote 05/10/2017 at 16:56 point

Hi Tim: Thanks for the info. We designed this with the objective to use regular gel-based disposable sticker electrodes (that you find in hospitals) for ease of re-use and their low cost, without requiring any maintenance.

  Are you sure? yes | no

Diego Galue wrote 04/23/2017 at 10:24 point

Quick question, where did you buy the electrode snap terminals? its been impossible for me to get them. thank you in advance

  Are you sure? yes | no

Ashwin K Whitchurch wrote 04/23/2017 at 15:40 point

Hi Diego, right now we've pulled out the button out of a standard ECG lead and soldered it onto a pad. However, we've placed and order with these guys: http://www.setolink.com/ for getting the buttons alone, will know the quality only once we  receive them

  Are you sure? yes | no

fest wrote 04/21/2017 at 10:37 point

I do realize that it's probably too early for this but do you have a potential price in mind?

Any preliminary specs on battery life?

  Are you sure? yes | no

Ashwin K Whitchurch wrote 04/21/2017 at 15:04 point

Thanks for following. Yes, we haven't priced it as of now, but our plan is to do a crowdfunding campaign for this project and thus bring the cost of the device under $50 

  Are you sure? yes | no

Ashwin K Whitchurch wrote 04/21/2017 at 15:06 point

As for battery life, we have a target run-time of at least a week on a single charge, with a 250 mAH Li-Poly battery. We will have more detailed information on power characteristics soon as we continue testing

  Are you sure? yes | no

Steven Merrifield wrote 04/20/2017 at 03:27 point

I don't see any under-voltage lock out protection to prevent damage to the battery.

  Are you sure? yes | no

Ashwin K Whitchurch wrote 04/20/2017 at 03:34 point

Thank you, comments do help us improve. UVLO protection is built into the battery packs itself, this causes the battery to not discharge itself below about 2.5 volts. 

  Are you sure? yes | no

Rodrigo wrote 04/18/2017 at 05:57 point

Hi. Loved the project. Recently I started developing a ECG viewer and I loved this project. Are you selling the kits ready made? I would like to purchase and try integrating it with my viewer. Thanks.

  Are you sure? yes | no

Ashwin K Whitchurch wrote 04/18/2017 at 06:39 point

Thanks. This product is still under development and will be available for sale on protocentral by the middle of May 2017, you can follow the progress right here. However, if you need only an ECG interface, you can check out our breakout board: https://www.protocentral.com/open-medical-devices/1149-protocentral-max30003-single-lead-ecg-breakout-board.html

  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