Fall asleep alarm

An app that triggers an alarm when the heart rate falls below a freely adjustable value.
For example, if I do not want to fall asleep on the train, in the waiting room or while driving.