This app was mentioned in 4 comments, with an average of 43.75 upvotes
Any smartphone with a flash near the camera can be used as a heartbeat sensor. There's an app for that.
https://play.google.com/store/apps/details?id=com.runtastic.android.heartrate.lite&hl=en
https://itunes.apple.com/us/app/instant-heart-rate-heart-rate/id409625068?mt=8
You actually can do that with just about all smartphones. For example on android, Runtastic has an app. You just hold your finger over the camera and the led at the same time.
It's not as convenient as an always on monitor, but I think I read they're pretty accurate. It's the same technology as any optical heart rate monitor.
It sounds fishy af, but this technique works alright. That's basically how the heart rate monitors on Samsung devices work, except they use a dedicated light and sensor. The camera detects the small differences in brightness when blood flows into your finger basically. On oneplus devices it's weird, because it uses the primary camera which is further from the flash, but it works. You just have to find the proper placement. I've compared it to samsung's heart rate monitor and blood pressure monitor which measures heart rate. Also if you can feel your heart beat you can see that it does show the beats in sync with your heart. I used a lot of apps.
I do not know how the heart rate sensor works on the S5, but there's already some apps that enable as a heart rate scanner I calculated it myself, then used the app and it was the same measure. It works great on my s4 and outshoot in many other less expensive device than a s5 https://play.google.com/store/apps/details?id=com.runtastic.android.heartrate.lite