I have been using arduino uno board for a year. And I got pulse sensor. I followed the same codes and same procedure as given in code as below.
Unfortunatelly, there was a big problem. When I put my finger on the sensor, led13 on the board blinking like crazy! (three or four times faster than my real heartbeat.)
Processing app screen is not stable too. It always going to 200 BPM in 2 seconds and remain 200 BPM.
I am not pushing my finger too soft or too hard.
Also, when I tried to change
BPM = min(BPM,200): in the Processing to
BPM = min(BPM,400);
, heartrate goes upto 400 BPM out of the borders of the Processing screen in seconds!
I think my arduino code is the reason.
I tried to change delay in Arduino code, and I tried both 32 and 64 bit versions of Processing but still
problem occurs.
Please help me why the sensor output is not correct.
I just want to make it work.
Codes and schematics I followed are attached as below:
Please provide a link to the pulse sensor that you have integrated with the Uno together with a link to any tutorial you may have been following. A heart beat of 400 BPM is unusually high and may be due to a possible defective measurement.
Have you already tried with the starter project for this pulse sensor. If not, try that to ensure that the sensor is OK. There is surprisingly little code because the sensor appears to have some analog filtering built in.
The analog signal it produces is not the heart beat itself, it is simply a voltage which you see on a time line, which rises and falls according to the heartbeat.
The code you have, which apparently analyses this voltage and determines a numerical heart beat in beats per minute appears at first glance to be overly complex.
In principle, you have to smooth the incoming signal and count the transitions between 'below threshold' and 'above threshold' and divide by 2 to get the number of beats. This count divided by the sample period is beats per unit time, which you can scale up to beats per minute.