Monthly Archives: August 2018

Heart Rate Monitoring

Posted on by

Feel a need to catch up on writing about what I’ve been doing with Heart Rate monitoring.

Started with an Arduino board and a simple ear clip heart rate monitor and gsr sensor from Seedstudio (Grove). Made a simple biofeedback program out of it.  Set up some Python programs to read the data and save to a MySQL database. Worked with that for a while though the limitation of being tied by cables to the machine was a restriction that limited the amount of times that I would actually sit down and take measurements. Also an ear clip monitor is not the most accurate way to measure heart beats, though it was doing the job.

Last winter decided to move up to a bluetooth chest strap to measure heart rate. Decided on a Polar H10 chest strap. Polar is well rated for their accuracy as consumer devices and I thought because they are somewhat popular that it probably would be something I could access with Linux.

Found a blog post specifically about getting the H10 to connect.
https://nob.ro/post/polar_h10_ubuntu/

If it wasn’t for that blog I might have not gotten my device working under Linux but with those instructions was able to get a connection with gattool and start measuring heart beats. I was not able to get Python to connect with pygatt or pybluez but by using the one liner for gattool I could run it as a system command and capture back the data in Python.

So, I don’t have the gsr readings that I was getting with my Arduino solution but it is a more accurate heart rate monitor and I am not tied to my machine while recording. I have Python routines that activate the device, collect the data and save it to database. I have an interactive, biofeedback type, of program that shows not only my heart rate but a number of heart rate variability values. HRV can give you various ways to do biofeedback to achieve certain states that improve the values or can simply be an indication of over all heart health.

Besides being able to do live sessions displaying HRV values as I am recording heart rate I have some routines that give me statistics and create graphs of existing sessions that have been saved in the database.

It has been a nice project and there are plenty of tweaks to make it even more useful. One feature of the Polar H10 is that it can save a session of data in memory and then transfer the data back to your machine. However, I can find no information on the codes necessary to make it do that. There is an Android application Polar Beat, andofficial app for the Polar heart rate monitors, which will tell the strap to save a session in memory but still no documentation on how to do it yourself.

I’m hoping that by capturing bluetooth packets I might be able to figure out the codes myself. That is the current project. This is a high level overview of what I’ve done with heart rate over the past year.  I will intend to try and write up some more details of the projects I have accomplished with the Polar HRM to get to where I am currently and follow those to where I’m trying to go.