Pulse sensor with arduino uno+blynk

hi guys i need your help please.
Ok so i am using pulse sensor like https://cdn.sparkfun.com//assets/parts/7/5/5/9/11574-02.jpg
i need to measure the heart rate beat per min to display on my Blynk terminal widget…
i keep on getting extreme value and the sensor doesn’t seems to be responding according to my finger placement… if i didn’t put my finger onto the sensor , it still showing beat per min … and the result seems to be weird… showing 1.xx beat per minute or 4.xx beat per minute…

i have my code reference through arduino uno - Getting BPM from the given code - Arduino Stack Exchange

i cant use the two- timer setting , it may cause my other sensors (not pulse sensor) to run too fast

i cant use serial printer because i am using USB connection for my blynk app…
and my baud rate are 9600 cannot be higher or lower since i have other sensor running with this pulse sensor at the same time…

P/S: i will add in anything that i missed out when i realised later on.

#include <BlynkSimpleStream.h>

char auth [] = "my token";
//Declare the variables
int UpperThreshold = 518;
int LowerThreshold = 490;
int reading = 0;
float BPM = 0.0;
bool IgnoreReading = false;
bool FirstPulseDetected = false;
unsigned long FirstPulseTime = 0;
unsigned long SecondPulseTime = 0;
unsigned long PulseInterval = 0;

void setup()
{
Serial.begin(9600); //BaudRate
  Blynk.begin(Serial, auth);
}

void loop()
{
reading = analogRead(0); 

      // Heart beat leading edge detected.
      if(reading > UpperThreshold && IgnoreReading == false){
        if(FirstPulseDetected == false){
          FirstPulseTime = millis();
          FirstPulseDetected = true;
        }
        else{
          SecondPulseTime = millis();
          PulseInterval = SecondPulseTime - FirstPulseTime;
          FirstPulseTime = SecondPulseTime;
        }
        IgnoreReading = true;
      }

      // Heart beat trailing edge detected.
      if(reading < LowerThreshold){
        IgnoreReading = false;
      }  

      BPM = (1.0/PulseInterval) * 60.0 * 1000 ;

     
      Blynk.virtualWrite(V7, "\n Heart Rate =", BPM);
      Blynk.virtualWrite(V7, " BPM");
    
}

Without the Blynk stuff, do you get good results?

PaulS:
Without the Blynk stuff, do you get good results?

nope...if i use the one without two timer, it show INF BPM

if i use two timer coding, it showing 2xx BPM up to 3000+ BPM ...

hmm..

It seems to me that the first thing you need to do is determine that you are reading from the sensor correctly. Get rid of everything in loop() except the analogRead() call. Serial.print() the value. Do the values make sense?

PaulS:
It seems to me that the first thing you need to do is determine that you are reading from the sensor correctly. Get rid of everything in loop() except the analogRead() call. Serial.print() the value. Do the values make sense?

ok so i deleted everything except analogRead and serialprint..

when i place my finger onto the sensor, i show 0 value reading whereas i lift my hand up (nothing on sensor) will show 995 value reading..

hmm?

SOSPleaseHelp:
hmm?

That's what I said when I looked at the link you posted, to the sensor you are using.

A picture is completely useless.