his project is an ESP32 and ESP8266 WiFi ECG Monitor and “Pulse Oximeter” firmware with Chain Network feature. The “Chain Network” is a local network which the devices one by one are connected to the each other.
This project is based on the “ESP32 WebApp Builder” and “ESP8266 WebApp Builder” projects which are the base source codes with the chain network feature.
The projects are available in the following links:
The following video shows the web UI (Web Application) of this project:
ESP8266/ESP32 WiFi ECG Monitor IntroductionThere are the following files in this project:
- ESP32ECGMonitor.ino/ESP32ECGMonitor.ino (Main handler file)
- AC.h (Configuration header file)
- AC.ino (Configuration handler file)
- functions.ino (System functions)
- rootPage (UI handler file)
- user_global.h – Project global variables and definitions file.
- user_init.ino – Project initial script file.
- user_loop.ino – This file has a “userLoop()” function which calls repeatedly (like arduino “loop()” function).
- user_settings.ino – Project settings file.
- user_main.ino – ECG monitor handler script.
- user_sub.ino – Network pulse oximeter handler script.
- user_global.ino – This file has a “userGlobal()” function which calls at the same time in all of the devices in the network. This function will be called when the app sends a command to the network (after userMain and userSub).
- Webapp.h – This file contains the WiFi ECG WebApp’s script.
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.
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:
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” 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 ApplicationFirst of all place your top of your finger on the MAX30100 sensor’s eye and then open the root page.
The WiFi ECG project has a nice and responsive web application which is placed in the root page address (192.168.4.1 by default and can be set to 192.168.5.1 or you can use the router’s DHCP IP).
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:
- HOLD: Holds the capturing.
- MUTE: Toggles between playing and muting the hurt-rate beep sound.
And 2 push buttons:
- PRINT: Prints the first one minute heart-rate graph in a.png file.📷
- RESET: Clears the screen and heart-rate diagram.
This web application is also compatible with cell phone and mobile device browsers
The menusThe 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-rateIn 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.
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 web application’s settings menu has been divided to 5 parts:
- Modem ConfigurationIn 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.
- Device Hotspot ConfigurationIn 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 192.168.4.1/123 instead 192.168.4.1The even means the default IP is 192.168.4.1, the Odd means the default IP is 192.168.5.1Hidden 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).
- System ConfigurationIn 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.
- Local Network ConfigurationIn 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.
- Local Network MapIn 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. 192.168.4.1#settings).
Comments