This is one of my rare not-strictly-Raspberry-Pi blog posts. Although using a Wemos, because the programming is in Micro Python, it wouldn’t be difficult to convert to using, say, an MCP3008 chip to read the analog values and then GPIO Zero to access the converted digital reading.
Martin Fitzpatrick has taken a Wemos D1 Mini and flashed Micro Python to it (you can find out how to do that from a Raspberry Pi or other Linux machine here). He’s then taken a Pulsesensor analog heart rate sensor and wired it up to the Wemos’ power pins and analog input. A bit of maths later and he has the heart rate detected and flashing the Wemos’ built-in LED. He’s then taken a small OLED display, displayed the pulse as a graph and worked out the average beats per minute. The cute little heart in the corner is a nice touch. You can find out how to do it yourself over on his blog.