Iteration 3 | Jack | HRV
Iteration 3 - HRV Relative to Breathing
To kick off the third iteration of this project, we spent Monday's class implementing the new auto-calibration code block into our existing Micro:bit design.The Setup
- A Micro:Bit v2
- A Micro:Bit extension breakout board, housing the Micro:Bit
- A heart rate sensor, connected to the breakout board
- Our MakeCode codebase
The Use of Local Display
- Indicate the Micro: bit is on, and the project loaded onto it correctly,
- Measure and feedback the quality of the user's finger placement on the heartbeat sensor,
- Indicate peak/trough detection after auto calibration, so the user can determine if the calibration was successful.
The Code
Findings & Analysis
- I have the heartrate sensor pressed lightly against my index finger. We've found the placement of the sensor to be quite important, and it's very easy for it to move slightly which can significantly throw off the readings. As such, I'm trying my hardest in the video to keep my finger as still as possible, and to keep the sensor firmly positioned in place.
- The LED screen on the Micro: Bit is utilized effectively, with a bar graph indicating both my heart rate, and the quality of my finger placement on the sensor. Once adequate, I click the 'A' button on the Micro: bit, which calibrates the reading to my individual case.
- There's a block in my code that takes this calibrated heart rate and converts it to HRV, which is then outputted in graph form to the device data output screen. In the video below, this is the blue line.
- Simultaneously, a simple breathing pacer is being overlapped against this graph. I then begin inhaling/exhaling in a 4 second/6 second manner, in accordance with the pacer.
- You can see how my HRV naturally peaks and troughs, in a sin wave-like manner, and as I continue the breathing exercises, this wave begins to move into phase with the pacer.
Next Iteration Brainstorm
'In Phase' HRV
Pulse Sensor Robustness
One of the biggest problems we all encountered in this iteration was in relation to the pulse sensor. We found that it's incredibly tedious getting your finger to make the right connection on the sensor, and then keeping it there long enough to get a good reading. In fact, sometimes I found I'd be concentrating so hard on keeping my finger still, that I would forget about my breathing exercises.Improvements were made to help mitigate these problems, such as the local LED display gauging the finger placement, and the auto-calibration helping with the readings, but even still the problem persisted.
We brainstormed the idea of some kind of finger mount for the sensor. Something that reduces the chance of ill-connection, making the reading more robust.
DFRobot, the company our sensors are from, showcase putting the sensor on one's wrist. It's very possible this image is just for show, but in theory it should work, and might provide a more robust reading than the finger.

In the final iteration, they showcase their finger in the housing, and a heart rate value being returned
Other things we discussed included the rework of the current 'manual' auto-calibration to be automatic, and to try and figure out how to calculate the phase difference between the pacer and the HRV, getting the number of degrees the HRV is out of phase and using it as a future resonance measurement.
Unfortunately, when I went to work on these ideas, I could not get my HRV reading to work, which was incredibly frustrating - looking back now, perhaps this was because I had literally every port of my already underpowered laptop connected to something external, including a 24" monitor. I hope somebody else on the team was more successful with this than I.
Output Sonification
The last discussion topic was how we could sonify the output. The idea of resonance frequency was mentioned, which took me back to my secondary school physics days, using tuning forks to calculate resonant frequencies.
I immediately thought of that almost melodic sound that the tuning fork creates when struck. We could recreate that sound or similar and use it as an audio-feedback.
MQTT
In a future iteration we'll be taking what we've got and adding cloud functionality. We'll look to take the HRV value and beam it up to the cloud using the Beebotte MQTT server.
Comments
Post a Comment