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 that "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 is questionable.

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


  • Single-lead ECG with two electrodes
  • On-board connectors for standard disposable electrodes (eliminates the risk of using custom pads).
  • On-board human body temperature sensor (touching the skin)
  • On-board 3-axis accelerometer for position assist and fall/movement detection
  • 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

All hardware, software, firmware and all other material will be made available open-source once we have some stable code and hardware platform.

Business Plan -HeartyPatch.pdf

HeartyPatch Business Plan for the Hackaday Best Product prize semifinals round

Adobe Portable Document Format - 4.31 MB - 07/24/2017 at 11:52



HeartyPatch Board (EAGLE)

brd - 745.99 kB - 06/21/2017 at 17:08



HeartyPatch schematic

Adobe Portable Document Format - 893.93 kB - 04/08/2017 at 18:26



HeartyPatch Schematic (EAGLE)

sch - 1.72 MB - 04/08/2017 at 18:26


View all 7 components

  • We have a new board

    Ashwin K Whitchurcha day ago 0 comments

    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

    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 (, 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 ( 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.

  • Code update

    Ashwin K Whitchurch06/12/2017 at 10:50 0 comments

    We've updated the latest code for the HeartyPatch on Github (

    It's also planned to explore the use of Initial State ( for the platform.

  • Check out our new entry

    Ashwin K Whitchurch06/11/2017 at 11:17 0 comments

    Check out our latest project on Hackaday, also for open medical applications:

  • A new enclosure

    Ashwin K Whitchurch05/25/2017 at 18:22 0 comments

    We now have a new enclosure, thanks to Thileepan (

    The new enclosure looks better and feels better. Shown below is the same enclosure, 3D printed on a Makerbot Replicator 2.

    There's also a circular cut-out for the temperature sensor contact. The same buttons used for the electrode connections are reversed and stuck on the temperature sensor using thermally conductive glue, that is also electrically insulating.

    The new enclosure fits snugly with the body and give great electrode contact.

    The Sketchup designs and the STL files will be put up on Thingiverse shortly and link will be posted to this page.

  • BOM is here

    Ashwin K Whitchurch05/25/2017 at 17:39 0 comments

    We have our entire BOM online at FindChips:, lots of cool features and great place to store BOMs.

  • We splunkified the data: internet of useful things

    Ashwin K Whitchurch05/18/2017 at 07:28 0 comments

    Once we took the HeartyPatch data to Amazon Web Services IoT (, we wanted to visualize the data and run some analytics on it to find the heartrate "trend" throughout the monitoring period (could be a day). AWS is a managed IoT platform hosted on the AWS cloud. This makes it easier to send "thing" data to the cloud for storage and processing. The reason for choosing AWS IoT now is mainly because of security and ease-of-use reasons.

    AWS IoT, however, does not store any data (not persistent). It just uses the received data to trigger actions or "rules". Internally, it uses the MQTT ( to transfer to and from a thing, in this case the HeartyPatch. MQTT is very light-weight compared to HTTP or HTTPS and still can use X.509 certificates for authentication.

    Enter Splunk; a "big data" platform, or in simple words, it just reads machine-generated data and stores over a long period of time. The reason we chose Splunk is actually from a suggestion from a customer of ours for another project, but we liked it so much that we decided to keep using it.

    We installed Splunk on an AWS EC2 instance and used AWS Lambda ( to pick-up the data from AWS IoT and post it to the Splunk instance as a HTTP request. Spunk's internal HTTP Collector modules then receives the HTTP request, classifies the data and stores it. However, all said, Splunk is NOT Open-source or even free for commercial application. It is free to use for individual use, with some restrictions, such as the data transfer limit of 500 MB/day.

    Now, it is possible to do all kinds of stuff with the data. In the screen-shot below, we have taken a small part of the data to analyse the heart-rate trend and calculate variability.

  • And we have lift off...

    Ashwin K Whitchurch05/14/2017 at 18:21 0 comments

    We have now hooked up the HeartyPatch to AWS IoT ( and able to send data securely with certificates issued by AWS.

    Next step: integrate this data going to AWS IoT to a persistent data store and possibly some basic data analytics. We're thinking to use Splunk ( Feel free to let us know your comments below.

View all 16 project logs

View all instructions

Enjoy this project?



dpreed wrote 4 days ago 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 4 days ago point

You are talking about this product.

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 :

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 ;

  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. . 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: 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:

  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