Heart rate Measurement using pressure sensor

Hello everybody,

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 ?

No idea, sorry.
It is only a few photos, no schematic, no sketch, no video, no nothing.

Mz409:
have someone an idea about this project ?

I think you have some programming ahead of you since they don't seem to provide the code :wink:

Are you asking for code, or what?

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

Do you consider a microphone a pressure sensor?

No I am talking about a an FSR force sensitive resistance

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.

Do some experiments!

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; 
 }
}

I think you did not post your code correctly. Edit your post to add code tags ("</>" button).

Sorry I corrected it

What is the result and why don't you think it is good?
This might be a good time to read "How to use this forum".

Have you displayed the value right after this line:
currentSensorValue = analogRead(sensorPin);

And is the value what you expect?

If not, there is your problem.
If it is, where else have you displayed the value and where does it fail?

Paul

The problem is that it shows a different value from a display to another and the values are not logical at all

Repeat: This might be a good time to read "How to use this forum".

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...

Surely the beating of your heart doesn't really stretch skin to an extent it would produce any reasonable signal over any noise?

Surely it does. That is exactly how pneumatic pressure cuffs work to measure blood pressure.

I can look at veins on my wrist and hand and count the pulses.