Introduction: Online Heart Rate Monitor Using NodeMCU and Cayenne

The background of this project is to monitoring human body heart rate and send an alert to email when heart rate above normal condition (in this case I set 200, because it's very noisy).

Will try to add something like capasitor to decrease the noise and make it wearable.

Step 1: Bill of Materials

This the tools needed to do this project.

Hardware Required :

1. NodeMCU ESP-12E

2. Pulse Sensor

3. SSD1306 0.96 inch OLED Display

4. Jumper Cable

Software Required :

1. Arduino IDE

2. Cayenne for iOS/Android/Web Browser

3. Modified Pulse Sensor for ESP very big thanks to the creatore

4. Adafruit SSD1306 Library for Arduino

Step 2: Connecting NodeMCU to Pulse Sensor and OLED

NodeMCU_______Sensor__________OLED

3.3V____________ +_______________VCC

GND____________-_______________ GND

A0 _____________S_______________ Not Connected

D2_____________Not connected____SDA

D1_____________Not connected____ SCL

Note : If you use ESP8266 not NodeMCU don't try to direct connect signal from sensor to A0. You must add 2.2 KOhm beetwen Signal and A0, and 10KOhm beetwen A0 to GND.

Step 3: Upload Code to NodeMCU

In this step we will program the NodeMCU with Arduino IDE.

You need to import library from step two to make this code work.

Download two available file in this step

And then open ESP_OLED, edit your Cayenne token, SSID, password, and then connect your NodeMCU with USB Cable to your computer and upload the code to NodeMCU. Now your OLED should display something, this is the sign if your project worked. And now your NodeMCU is connected to Cayenne, but litlle step again to setting up Cayenne Dashboard that will display your BPM and give an alert if BPM to high.

Step 4: Setting Up Cayenne

Do this step on Cayenne :

  • Login to Cayenne Dashboard
  • Add graph custom widget from Cayenne Dashboard, and select Virtual Pin 13 that contain BPM value from NodeMCU.
  • Add triggers and set if widget value above the value as you need (in my case I set 200, but refer to many source on internet 160 is enough to give us alert) then Cayenne will send alert to email.