IoT-based Heart Monitoring with ESP32

Reporting from Shanghai, China
Sep 27, 2019

Alex Newton’s tutorial about IoT-based electrocardiographic (ECG) monitoring with ESP32 shows how heart monitoring can be conducted regardless of the distance between doctors and patients.

Heart diseases cannot be taken lightly. Monitoring and analyzing a patient’s electrocardiographic (ECG) signal at the initial stage of a disease can prevent a fully-developed heart condition later on. An ECG is the recording of a heart’s electrical signals. This provides crucial information which is used to determine the heart’s condition and diagnose any heart arrhythmias, pacemaker function, heart failure, etc.

Although the IoT-based ECG monitoring with an AD8232 sensor and ESP32 is not a medical device and is not intended to be used as such, the project aims to show how patients can improve their heart monitoring by using IoT technology. More importantly, this project also shows that the IoT technology can help eliminate the distance between doctors and patients in remote areas, since the ECG signal from a patient’s heart can be checked online from any part of the world.

The components required for this project are listed below:

  • AD8232 ECG sensor and electrodes
  • ESP32
  • 5V adapter power supply with Micro-USB port

Alex Newton’s tutorial demonstrates how to monitor the same ECG diagram online on any IoT cloud platform. To this end, an AD8232 ECG sensor is interfaced with ESP32. Then, an ECG signal is generated by connecting the ECG leads to a patient’s chest or hand. By using Ubidots parameters, such as the API key or token, the ECG graph is sent to the Cloud with the help of the MQTT broker.

The AD8232 ECG-sensor is a cost-effective board used to measure the electrical activity of the heart. It is designed to extract, amplify, and filter small biopotential signals in the presence of noisy conditions, such as those created by motion or remote electrode placement. The AD8232 Single Lead Heart Rate Monitor acts as an operational amplifier that assists in easily obtaining a clear heart signal.

ESP32 can interface with such systems to provide Wi-Fi and Bluetooth functionality through its SPI / SDIO or I2C / UART interfaces. The ESP32 module that is used in this specific project is ESP32-WROOM-32, which contains the ESP32 SoC, flash memory, high-precision discrete components, and a PCB antenna that provides outstanding RF performance in space-constrained applications.

To interface the AD8232 ECG Sensor with ESP32-WROOM-32, follow the circuit diagram above. Supply the AD8232 with 3.3V from the ESP32 module and connect GND to GND. The output pin of AD8232 has an analog signal and is connected to the VP pin of ESP32-WROOM-32. Similarly, LO+ and LO- on AD8232 should be connected to D2 and D3, respectively, on ESP32-WROOM-32.

To publish the data on the Cloud, we need an IoT platform, such as Ubidots, which enables developers to easily capture sensor data and turn them into useful information.

The source code/program and all the other details about this project can be found here.

Share this article
Reuse this content