You can use this sensor to measure your heartbeat,
You can also use this same logic for NodeMCU also.
This pulse sensor has 3 pins
1.S(Analog sensor pin)
2. VCC( You can use either 3.3V /5.0V
3.OLED(Connect SCL pin to A5, SDA to A4)
Coding of Pulse sensor https://github.com/PabitraKumarGhorai...
YouTube Link of OLED display • How to use OLED Display with NodeMCU?