I looked up previous uses of this sensor, including Dimitri’s “Heart-beats left“. I found a really nice project called Heart Chamber Orchestra. Also, I found out that Adidas is developing a line of clothing with polar heart rate sensors included, though I can only find an online retailer that carries this product in the UK.
Based on Tymm’s code, I got the arduino to work in the following way:
- the sensor starts up,
- after 60 seconds it tells me the beats since it started,
- it repeats this every 60 seconds.
My current concern is that i seem to “lose” a few milliseconds every time. i’m not sure if this affects the final outcome and if there’s a way to compensate for it.To explain this better I’m including the results of my serial printing. What you see here is the BPM, the count of each single beat since it started counting, reported and reset every 60 seconds. it also indicates the current amount of milliseconds elapsed and the time until the next reading.
60000
1st BPM =80
next read = 120009
BPM at 120009 = 82
120018milliseconds
next read =180029
BPM at 180029 = 79
180038milliseconds
next read =240048
BPM at 240048 = 78
240057milliseconds
next read =300067
BPM at 300067 = 79
300077milliseconds
next read =360087
BPM at 360087 = 79
360096milliseconds
next read =420107
BPM at 420107 = 78
420116milliseconds
next read =480126
BPM at 480126 = 77
480136milliseconds
next read =540146
BPM at 540146 = 79
540155milliseconds
next read =600166
BPM at 600166 = 78
600175milliseconds
next read =660185
BPM at 660185 = 77
660194milliseconds
next read =720204
BPM at 720204 = 78
720214milliseconds
next read =780224
BPM at 780224 = 76
780233milliseconds
next read =840243
BPM at 840243 = 77
840252milliseconds
next read =900262
BPM at 900262 = 78
900272milliseconds
next read =960282
BPM at 960282 = 78
960291milliseconds
next read =1020302
I’m wondering how often is it relevant to take a sample, since i probably don’t want to keep reading constantly. Or how often to average this out and take a sample in order to change the iPod. Also, will my adding the iPod code be too much for the program to handle? I guess I’ll find out soon enough.
Here’s a small video of my setup. Nothing too exciting but you can see the led flashing as the sensor finds the heartbeat. beats
