I am working on a project to do some heart rate monitoring. I've been doing some researches
and all i've found is heart rate mesurement based on photoresistance and a LED.
I've found in a forum someone who's done it using an FSR sensor and an arduino UNO. https://seelio.com/w/nfl/heart-rate-monitor
have someone an idea about this project ?
Actually i'm not looking for a ready code but at least a schamatic or an algorithm or somebody who did work on it to explain me in more details.
Thanks
Mz409:
Actually i'm not looking for a ready code but at least a schamatic or an algorithm or somebody who did work on it to explain me in more details.
Thanks
You simply need to find some arrangement of a suitable body part, the FSR and a pressure cuff, so that you get measurable changes in the sensor resistance when your heart beats.
I've been doing some code but i still didn't get a good result this is my code
what do you think
#include <FilterDerivative.h>
#include <FilterOnePole.h>
#include <Filters.h>
#include <FilterTwoPole.h>
#include <FloatDefine.h>
#include <RunningStatistics.h>
const int numReadings = 10;
long measurementStartTime = 0;
int beats = 0;
byte sensorPin = A0;
int currentSensorValue;
boolean counted = false;
float filteredSignal=0;
float filtered2Signal=0;
int readings[numReadings]; // the readings from the analog input
int readIndex = 0; // the index of the current reading
int total = 0; // the running total
int average = 0; // the average
void setup()
{
Serial.begin(9600);
pinMode(sensorPin, INPUT);
analogReference(INTERNAL);
for (int thisReading = 0; thisReading < numReadings; thisReading++)
readings[thisReading] = 0;
}
// filter out frequencies below 1 Hz.
float highFilterFrequency = 1;
// create a highpass filter that only keeps frequencies above highFilterFrequency
FilterOnePole filterOneHighpass( HIGHPASS, highFilterFrequency );
//filters out frequenceies greater than 3 Hz.
float lowFilterFrequency = 3;
// create a lowpass filter that only keeps frequencies below lowFilterFrequency
FilterOnePole filterOneLowpass(LOWPASS, lowFilterFrequency);
//filters out frequenceies greater than 500 Hz.
float lowFilter2Frequency = 5 ;
// create a lowpass filter that only keeps frequencies below lowFilterFrequency
FilterTwoPole filterTwoLowpass(LOWPASS_BUTTERWORTH, lowFilter2Frequency);
void loop()
{
if ((millis() - measurementStartTime > 10000) && (beats >= 0)) //time is up
{
Serial.print("Beats read in 10 seconds : ");
Serial.println(beats);
measurementStartTime = millis();
beats = 0;
}
currentSensorValue = analogRead(sensorPin);
filteredSignal = filterOneHighpass.input(filterOneLowpass.input(currentSensorValue));
// subtract the last reading:
total = total - readings[readIndex];
// read from the sensor:
readings[readIndex] = filteredSignal;
// add the reading to the total:
total = total + readings[readIndex] ;
// advance to the next position in the array:
readIndex = readIndex + 1;
// if we're at the end of the array...
if (readIndex >= numReadings)
// ...wrap around to the beginning:
readIndex = 0;
// calculate the average:
average = total / numReadings;
// filter second degré (butterworth)
filtered2Signal = filterTwoLowpass.input(average);
if (filtered2Signal > 5 && counted == false)
{
beats++;
counted = true;
}
else if (filtered2Signal <= 5)
{
counted = false;
}
}
Mz409:
The problem is that it shows a different value from a display to another and the values are not logical at all
Surely the beating of your heart doesn't really stretch skin to an extent it would produce any reasonable signal over any noise?
I am about 99% sure you actually want a microphone for this...just like the automatic BP pressure cuffs use a microphone to detect the flow of blood once the pressure from the cuff has decreased to an extent to allow arterial flow again...