Week 3 HRV Iteration

Iteration 3:

For this week we went about improving the HRV sensor by making it easier to take readings of our heartrate. A large problem with the previous design was the constant changing of the range between the peaks of our values; one person's peaks and lows could be 800 and 500 on a certain spot on their finger while being 900 and 600 between another, making a change in the code necessary for the HRV to work. We were supplied with code which let us scale the peak values at will with the press of the A button, partially fixing the issue of the hassle involved in getting proper readings off of the HRV sensor.

New Code:

On start the HRV declares all of its variables and connects to the pulse sensor via pin P2 on our breadboards.


 

The forever loop turns a light on and off at the 2,2 coordinate at every heartbeat recorded, giving us a visual indication of if the HRV is properly calibrated with its peaks and valleys and remains unlit if uncalibrated.


 

The code for pressing button A is responsible for the calibration, setting the values for peaks and valleys of our pulse to ones recorded by the HRV sensor in the moment of pressing the button, in the common cases of the HRV not being calibrated properly during testing.


 

The main code responsible for the entire application working properly. It calculates the time between peaks (delta t), visualizes the heart rate on the microbit in the fashion of a bar chart and detects the peaks/valleys using if statements which compare their values to the observed maximum and minimum ones (the ones we can tweak using button A).



And finally, code below is responsible for data gathering and visualizing said data on graphs, giving us proper feedback during testing.


 

Reflection on HRV tests:

A good sign of the HRV working is it not flatlining while connected to us. From the testing done and in the video below, a stable heartrate is one which forms a sinewave, regardless of if you're doing breathing exercises holding your breath etc, a stable heartrate should always be moving up and down slightly.

Youtube Recording of Text

 Issues Pertaining to Taking Measurements:

A persisting issue and one which we are working on now that we have manual calibration working with the help of the new code, is that of actually using the sensor with ease without having to constantly find good spots to attach it to your finger and doing your best not to move. A 3d printed clip for your finger was proposed, and I myself tried to work on attaching a small layer transluscent material between the sensor and your finger, so that the tightness of the HRV would become a non issue, as from my understanding the sensor works using light, but I couldn't get it to work properly and I think the clip will work much better as that seems to be the standard for devices like this in hospitals.

Comments

Popular posts from this blog

Iteration 2 | Jack | HRV Micro:bit Research

Iteration 5.2 | Lock In | Jack

Week 1: HRV Review