I wanted to use a pulse sensor that is small so I can attach it to my earlobe as an earring. But the reading was not stable and the pulse shape doesn't make sense.
So I changed to an analog ECG heart-rate monitor and it worked beautifully.
You have to attach the electros to three points on your body.
I used the same code from the pulse sensor and adjusted the target rate according to the output EKG displayed on the serial plotter.
Note, I used the Arduino Nano board on CrazyCircuits. It needs the Old ATmega328P Bootloader.