ESP8266/NodeMCU WiFi ECG Monitor(Oximerer and Heart-Rate Diagram)

Other projects from this group

ESP8266/NodeMCU WiFi ECG Monitor(Oximerer and Heart-Rate Diagram)

This project is the arduino source code and schematic of an “ECG Monitor” With “ESP8266” WiFi Module and “MAX30100” pulse oximetry and heart-rate module

ESP8266/NodeMCU-MAX30100 WiFi ECG Monitor (HeartRate/Blood Pressure/Oximeter/Temperature Diagram) Arduino Source Code- Rev 1.1



Other projects from this group


WiFi ECG Monitor calculate and shows the blood’s oxygen saturation and the heartbeat-rate with the diagram.
“ESP8266” is a programmable WiFi module which is the main processor of the project and communicates with the oximeter module via I2C and the user interface via WiFi.

“MAX30100 Pulse Oximeter” is a module with two RED and Infrared LEDs and reads the reflection value of the LED’s from top of the finger.
The output data form MAX30100 is so many samples in a second which contains LEDs reflection ADC value.

esp32 wifi ecg oximeter

First open one of the files with Arduino program, then set the board on “Generic ESP8266 Module” (Tools-%26gt;board).
Then put the ESP8266 module on the “download mode” and upload the program.
After upload, run the program in “normal mode”.
Then in case you are using ESP12, the blue LED on the board would be turned on for 1 second then turns off. Then you’ll be able to see the module’s hot spot ssid via the WiFi networks in your PC or smart phone.
The default SSID is WiCardECG and the default password is 12345678. Connect and go to "" with a web browser.

MAX30100, Pulse Oximeter Module

The MAX30100 is an integrated pulse oximetry and heart-rate monitor sensor solution. It combines two LEDs, a photo-detector, optimized optics, and low-noise analog signal processing to detect pulse oximetry and heart-rate signals.

The MAX30100 communicates with ESP32 via two wire (I2C) interface.

esp wifi ecg oximeter max30100

ESP32 and MAX30100 WiFi ECG Schematic

In this project, GPIO4 works as the I2C SDA and the GPIO 5 works as the I2C SCL. Use the following schematic for the connections:

esp wifi ecg schematic

The schematic is simple, either you can place both of the ESP and MAX30100 module (e.g. including two 1.5V battery) in an enclosure or in two different enclosures and connect the MAX30100 to the ESP via a 4-wires cable.

  • If you are using a standard MAX30100 module, there’s no need to use pull up resistors.
  • It’s suggested use two 33 ohm load resistors in the transaction wires.

The Chain Network

The “Chain Network” is a local network which the devices one by one are connected to the each other (Series). In the chain network, the first device is the master of network. The starter (either the master or the last joined module) is directly connected to the WebApp. It sends the command to the next device, and the next device sends it to the next one till the last device. The last device response will be sent to the first device and finally the WebApp via the middle devices.

The WiFi ECG Monitor Web Application

The graphs update in every 6 seconds. That means the graphs show the values which has been captured 6 seconds ago.

The green value (HR) is the average heart-rate value of the last 6 seconds in “Beats Per Minute” (BPM) unit.

The purple value (BP) is the blood pressure “Systolic” (SYS) and Diastolic (DIA) values in the mmHg unit.

The blue value (SPO2) is the percent of saturated oxygen in the blood.

The yellow value (Temp) is the temperature of sensor (which should be equal with the finger’s top temperature) in the Celsius unit.

  • Try to wrap something around your finger and the MAX30100 module, because this module is very sensitive on the peripheral lights.
  • When the temperature of the top of the finger is between 32 and 35, the values are more accurate.
  • When you see red “E” sign, “NaN” values or incorrect values (too high/too low), that means the finger is not placed on the sensor correctly, the finger is not warm enough or the sensor/finger is shaking.
  • The blood pressure value depends on many things. Top of the finger is not a good point for measuring the blood pressure though, but if you set the regulation values correctly, you may receive more accurate value for the blood pressure.
  • When a value repeats for many times, that means the correct average value.
  • This is not medical equipment, even if the result value be accurate, because this project has not been tested on a huge number of patients. Please do not use for the patients.

There are 2 toggle buttons under the monitor screen:

  1. HOLD: Holds the capturing.
  2. MUTE: Toggles between playing and muting the hurt-rate beep sound.

And 2 push buttons:

  1. PRINT: Prints the first one minute heart-rate graph in a .png file.
    esp wifi cardio graph
  2. RESET: Clears the screen and heart-rate diagram.

The responsive WebApp

This web application is also compatible with cell phone and mobile device browsers

The menus

The Web Application is divided to 3 menus. The menus can be selected by click on the menu button

“ECG” refers to the WiFi ECG monitor page, “HR-SPO2” refers to the Network Pulse Oximeter and heart-rate page and “Settings” refers to the settings page.

The Network Pulse Oximeter and Heart-rate

In the “HR-SPO2” page, there are 16 channel rows of the volt meters result. That means you can add up to 16 devices to the chain network and see the values at the same time.

wifi oximeter esp32 esp8266 max30100

In the above picture, only three devices (CH0, CH1 and CH2) are connected to the network.

The “HR-SPO2 Network Channel” can be set in the settings menu.

  • The actual heart-rate and SPO2 value is the average of received values.
  • If you receive 0 or a value with two much difference, that means the finger has not well placed on the sensor or the finger (or sensor) is not warm enough.

The Settings menu

The web application’s settings menu has been divided to 5 parts:

  1. Modem Configuration
    In this section you can see the available access points, the connection status, the device MAC address and the DHCP IP.
    Also in this section you can set the SSID and password of the modem’s access point.
  2. Device Hotspot Configuration
    In this section you can set your module’s hotspot SSID and password.
    The secure link is a string which will be added at the end of your module’s IP address. For example if you set it “123”, the IP address of the WebApp of your module will be instead
    The even means the default IP is, the Odd means the default IP is
    Hidden HotSpot will set the HotSpot hidden.
    Temporary HotSpot will disable the HotSpot right after the module is connected to the modem or joined to the network (For the last device in the network).
  3. System Configuration
    In this section:
    You can set the device’s HR-SPO2 network channel. The channel must be a number between 0-15 and the devices can’t have the same channel.
    SPO2 offset, SYS offset and DIA offset is the off-set value according to the difference of the correct result (which has been measured with a standard device) to the project result. The middle value is 128 and you can decrease or increase it.
  4. Local Network Configuration
    In this section you can set the “Master” device and also set the userGlobal() function execution delay.
    The linked WiCard IP is the IP of linked device to the module’s access point.
    If you don’t turn on the “Join Required” switch, the module will be set as Master.
  5. Local Network Map
    In this section, the attached devices in the chain network will be shown.
    For the master, it starts with master’s SSID, then the second ESP device, until the last one, but for the last device, the sort is vice versa.
    With typing the target device SSID in the target text-box, the oscilloscope will show the target device signal.
  • Both of ESP32 and ESP8266 can transfer the oscilloscope data of the other modules in the network.
  • You can directly access to the settings menu with http://ip#settings link (e.g.

Error in logs

Click on the tools in Arduino and Open the “serial monitor” when the module is connected to the USB (or via USB2Serial). If you receive I2C error, that means the wiring/connection is not correct.

If you received “e2” error, that means finger is not on the MAX30100 sensor.

It is normal to receive “e3” rarely, but if the error is too much, that mean the finger is not completely on the sensor or the module is receiving peripheral lights.

- The Web Ui upgraded
- The heart-rate diagram upgraded
- blood pressure diagram and calculations added
- 4 Buttons and features added
- Network pulse oximeter added

- Calculating SPO2
- Calculating Heartbeat-Rate
-Designing the ECG page
-Printing the diagrams

Similar Projects: