KY039 Arduino Heart rate code

luis_xxl:
Simply leave the center pin (+) unpluged

you only need to conect 2 pins:

pin - to GND
pin S to A0

central pin (+) leave unconnected

That does not make sense. The LED needs power. If I do that the reading will be 0.