HRV Sensor Iteration 2
HRV Sensor Iteration 2
Dominik Martynski 09-02-2024
Introduction
The second iteration of the HRV sensor microbit project had us begin working with and configuring a proper heart rate sensor.
For my specific microbit board, I first needed to update its firmware as I could not properly pair the device with my computer and see the data displayed on the microbit website. This required me to hold down the reset button while plugging in the power cable, at which point I then had access to a new drive on my pc labelled ''MAINTENANCE'', into which I dropped the corresponding firmware file (for me it was 2.0).
Breadboard
The microbit and heartbeat sensor need to communicate with eachother in an unobtrusive way, which is where a breadboard with a rechargable battery comes in. The breadboard is connected to all of the pins of the microbit, letting us use jumper wires consisting of a ground, power and the pin we want to use (for this instance P1 was used as I assume just like with the arduino, there exist limitations in using P0, such as constantly having to unplug the cables everytime you change the code).
Micro:Bit Code
To make this sensor work, we used a github repository we were shown in class (https://github.com/JanTadeuszEkiel/homelab) , modified it for our purposes, taking in the raw data of the heart sensor, parsing said data and giving us a visual indicator of our heart rate in the form of a physical indicator and a comprehensible data graph on the microbit website.
One of the main problems with the heartbeat sensor is that it has to be constantly tweaked to give us satisfying data, so I took care of that by adding an empty array to the code which adds the raw pulse data to an array, gives us the highest and lowest values present in the array over a five second period, before clearing said array, so that massive fluctuations don't occur and our microbit gives us an indicator for peaks and dips in our pulsedet value regardless of how high or low it is.
Lowest pulseout value indicator vs highest pulseout value indicator.









Comments
Post a Comment