0% found this document useful (0 votes)
23 views8 pages

Riphah International University: I - 14 Campus, Islamabad

The document outlines the design of a low-cost ECG measurement system using the AD8232 ECG module and STM32 Nucleo F103RB microcontroller, focusing on real-time signal display, data storage, and wireless transmission for remote monitoring. It reviews existing literature on similar systems, describes the hardware and software design, and presents results demonstrating effective ECG signal capture and transmission. The project aims to enhance access to cardiac monitoring, particularly in remote healthcare settings.

Uploaded by

muhammadrmzn84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Riphah International University: I - 14 Campus, Islamabad

The document outlines the design of a low-cost ECG measurement system using the AD8232 ECG module and STM32 Nucleo F103RB microcontroller, focusing on real-time signal display, data storage, and wireless transmission for remote monitoring. It reviews existing literature on similar systems, describes the hardware and software design, and presents results demonstrating effective ECG signal capture and transmission. The project aims to enhance access to cardiac monitoring, particularly in remote healthcare settings.

Uploaded by

muhammadrmzn84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Riphah International University

I -14 Campus, Islamabad


Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

Title: Design of a Low-Cost ECG Physiological


Measurement System Using STM32 Nucleo-F103RB
and ECG Module AD8232

1. Problem Statement:
You are tasked with designing a low-cost physiological measurement system focusing on
ECG signals using the AD8232 ECG module and STM32 Nucleo F103RB microcontroller.
The system should display real-time ECG signals on an LCD, store data for future reference,
and possibly transmit data wirelessly for remote monitoring.

2. Literature Review on Low-Cost Physiological


Measurement System for ECG Signals
The development of low-cost physiological measurement systems, particularly
for ECG signals, has been a significant focus in recent research. This review
synthesizes findings from various studies that have explored the design and
implementation of such systems using the AD8232 ECG module and different
microcontrollers, including the STM32 Nucleo F103RB.

2.1 Hardware Design and Implementation


Several studies have demonstrated the feasibility of using the AD8232 ECG module in
conjunction with various microcontrollers to create cost-effective ECG monitoring systems.
For instance, a prototype using the Texas Instruments TM4C123G LaunchPad, AD8232
board, and a Nextion 3.2" touch screen LCD was developed, showcasing the system's
feasibility, validity, and reliability[1].Similarly, another study designed a portable ECG
system using the AD8232 microchip and open-source platforms, integrating components like
the Arduino Nano for data logging and Bluetooth transmission[4].The STM32
microcontroller has also been a popular choice for such systems. One study designed an ECG
acquisition and display system using the ADS1292R chip and STM32F103, highlighting the
system's small size, low cost, and low power consumption [3].Another research focused on a
portable intelligent ECG monitoring system that utilized the STM32 microprocessor for
hardware circuit design and signal processing[2].
2.2 Data Storage and Transmission
Storing and transmitting ECG data for future reference and remote monitoring are essential
features of modern ECG systems. Several studies have incorporated data logging and
wireless transmission capabilities. For instance, a portable ECG system used a data logging
shield to store data on a microSD card and transmitted the digitized ECG signal via Bluetooth
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

to a PC or smartphone[4]. Another system transmitted ECG signals to a mobile app using a


serial port Bluetooth module, allowing real-time monitoring [3]. The reviewed studies
collectively highlight the potential of using the AD8232 ECG module and STM32
microcontrollers to develop low-cost, efficient, and reliable ECG monitoring systems. These
systems not only provide real-time ECG signal display and data storage and enable wireless
data transmission for remote monitoring, making them suitable for daily cardiac health
monitoring and remote healthcare applications.
Method to Solve Problem Statement
1. Hardware Design:
 ECG Signal Acquisition: Utilize the AD8232 ECG module to acquire electrical
signals from the heart. The module is widely used in low-cost, portable ECG systems
due to its ability to amplify and filter single-lead ECG signals efficiently.
 Microcontroller: Implement the STM32 Nucleo F103RB microcontroller for
processing the ECG signals. The STM32's high performance, low power
consumption, and integrated ADC (Analog-to-Digital Converter) make it an ideal
choice for real-time signal processing.
 Display: Integrate a TFT-LCD to visualize ECG signals in real-time. This allows
healthcare providers or users to monitor the heart's electrical activity directly from the
device.
 Data Storage: Include an SD card module for logging ECG data with timestamps.
This feature allows long-term storage of ECG data for future analysis or medical
consultations.
 Wireless Transmission: Incorporate a Bluetooth module (e.g., HC-05) to transmit
ECG data wirelessly to a remote device such as a smartphone or computer. This
feature is essential for remote patient monitoring in telemedicine applications.
2. Software Design:
 Signal Processing: Implement filtering algorithms to remove noise and artifacts from
the ECG signals. Techniques such as moving average filters, FIR band-pass filters,
or low-pass digital filters can be applied to enhance signal clarity. The STM32’s
integrated DSP capabilities can be used to process signals in real-time.
 Data Visualization: Develop an intuitive graphical interface on the LCD to display
the ECG waveform in real-time. The interface will also provide basic parameters such
as heart rate.
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

 Data Logging: Write software routines to store ECG data on the SD card, including
timestamping to organize data for later retrieval and analysis.
 Wireless Communication: Use Bluetooth communication protocols to enable
seamless data transmission. The system should be capable of sending ECG data to a
remote device, where it can be visualized in real-time through a dedicated mobile or
desktop application.
Basic Idea of the Research:
The primary goal is to design a low-cost, portable ECG monitoring system capable of
acquiring, processing, displaying, storing, and transmitting ECG signals. This system is
particularly aimed at improving access to continuous cardiac monitoring, especially in
remote and resource-limited settings. The system's portability and affordability make it
suitable for use in telemedicine, home healthcare, and even field diagnostics.
Sensor:
The AD8232 ECG module is the heart of the system. This cost-effective, single-lead sensor
amplifies and filters the ECG signal to make it suitable for portable, battery-powered
applications. Its small form factor and low power consumption make it ideal for wearable
ECG devices.
Flow Diagram:
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

Circuit Diagram:

Tool Usage Details


1. STM32CubeIDE:
o Used for programming and debugging the STM32 Nucleo F103RB
microcontroller. STM32CubeIDE simplifies peripheral configuration,
especially for GPIO, ADC, and UART, enabling efficient signal acquisition
and transmission.
2. AD8232 ECG Module:
o Provides signal acquisition of ECG data from electrodes attached to the skin.
This module features integrated filters that reduce signal noise and improve
waveform clarity, essential for monitoring ECG signals in real-time.
3. HC-05 Bluetooth Module:
o Enables wireless transmission of ECG data to a smartphone or PC. This
module was configured through UART, allowing continuous data flow for
remote monitoring and telemedicine applications.
4. Real-Terminal Software (or similar):
o A mobile app or terminal program was used to receive and display ECG data
via Bluetooth, visualizing the data transmitted from the STM32
microcontroller.
5. LCD Display (16x2):
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

o Displays the ECG signal waveform in real-time, providing immediate


feedback and a local viewing option for users.

Results

1. Signal Quality and ECG Capture:


o The AD8232 module successfully captured ECG signals, and the
STM32 Nucleo F103RB processed these signals with high fidelity,
displaying them in real-time on the 16x2 LCD.
o Clear PQRST complexes were observed on the LCD, with minimal
noise due to effective filtering within the AD8232, allowing accurate
R-R interval measurements and heart rate calculations.

2. Data Transmission and Remote Monitoring:


o The Bluetooth module (HC-05) enabled seamless wireless
transmission to a mobile application, displaying live ECG waveforms
on a smartphone. Real-time remote monitoring was achieved, which
is suitable for telemedicine applications.

3. System Efficiency and Power Use:


o The system demonstrated low power consumption and stable
performance under continuous operation. This efficiency suggests
potential for wearable applications, enhancing its practicality for
remote and real-time ECG monitoring.

Software Analysis
Code:
#include "stm32f1xx_hal.h"
#include "lcd.h" // Include LCD library, if available

ADC_HandleTypeDef hadc1;
UART_HandleTypeDef huart1;

void SystemClock_Config(void);
void MX_GPIO_Init(void);
void MX_ADC1_Init(void);
void MX_USART1_UART_Init(void);

int main(void) {
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_ADC1_Init();
MX_USART1_UART_Init();
LCD_Init(); // Initialize LCD
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10
while (1) {
uint32_t adcValue = 0;

// Start ADC and read ECG data


HAL_ADC_Start(&hadc1);
if (HAL_ADC_PollForConversion(&hadc1, HAL_MAX_DELAY) == HAL_OK) {
adcValue = HAL_ADC_GetValue(&hadc1); // Read ADC value
}
HAL_ADC_Stop(&hadc1);

// Display ECG data on LCD


LCD_SetCursor(0, 0);
LCD_Print("ECG Value: ");
LCD_PrintInt(adcValue);

// Transmit ECG data over Bluetooth (UART)


char buffer[20];
sprintf(buffer, "ECG: %ld\n", adcValue);
HAL_UART_Transmit(&huart1, (uint8_t*)buffer, strlen(buffer),
HAL_MAX_DELAY);

HAL_Delay(500); // Small delay for stability


}
}

// ADC Initialization for reading ECG data


void MX_ADC1_Init(void) {
hadc1.Instance = ADC1;
hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
hadc1.Init.ContinuousConvMode = DISABLE;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.NbrOfConversion = 1;
HAL_ADC_Init(&hadc1);

ADC_ChannelConfTypeDef sConfig = {0};


sConfig.Channel = ADC_CHANNEL_0;
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_71CYCLES_5;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);
}

// UART Initialization for Bluetooth communication


void MX_USART1_UART_Init(void) {
huart1.Instance = USART1;
huart1.Init.BaudRate = 9600;
huart1.Init.WordLength = UART_WORDLENGTH_8B;
huart1.Init.StopBits = UART_STOPBITS_1;
huart1.Init.Parity = UART_PARITY_NONE;
huart1.Init.Mode = UART_MODE_TX_RX;
huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart1.Init.OverSampling = UART_OVERSAMPLING_16;
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10
HAL_UART_Init(&huart1);
}

// GPIO Initialization for LCD and Bluetooth


void MX_GPIO_Init(void) {
__HAL_RCC_GPIOA_CLK_ENABLE();

GPIO_InitTypeDef GPIO_InitStruct = {0};

// LCD Pins (PA1 - PA6)


GPIO_InitStruct.Pin = GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4
| GPIO_PIN_5 | GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

// ADC Pin for ECG Signal (PA0)


GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

// UART Pins for Bluetooth (PA9, PA10)


GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
}

void SystemClock_Config(void) {
// Configure the system clock according to your board's specifications.
}

Pictorial representation of output response.

ECG Waveform on LCD: A continuous ECG waveform displayed in real-time.

Conclusion:
The project achieved its objective of creating a low-cost, portable ECG measurement system using the
STM32 Nucleo F103RB and AD8232 module. The system reliably captured, processed, and displayed
ECG data, with the additional capability for wireless transmission. This design offers a scalable and
Riphah International University
I -14 Campus, Islamabad
Complex Engineering Problem
Program: Biomedical Engineering Semester:5th
Course: Microprocessor and Interfacing Section: A
Date: Marks: 10

accessible solution for ECG monitoring in clinical and non-clinical settings, especially useful for
remote monitoring in telemedicine. Future improvements could include optimizing power
consumption further for extended wearable use and refining data accuracy with advanced filtering
techniques.
REFERENCES :
1. Sani, S. (2021). Design and Implementation of A Low-Cost ECG
Monitoring System Using ARM Cortex-M4 Family Microcontroller. 2021
IEEE International Conference on Consumer Electronics (ICCE), 1-2.
https://doi.org/10.1109/ICCE50685.2021.9427729.
2. Yuan, Y., Cao, D., Li, C., Liu, K., Zhang, C., Chi, X., & Zhang, D. (2019).
Research and Design of a Portable Intelligent ECG Monitoring System.
2019 Chinese Automation Congress (CAC), 5267-5271.
https://doi.org/10.1109/CAC48633.2019.8997453. Su, Y. (2022). Design
of ECG acquisition and display system based on ADS1292R and STM32
microcontroller. 2022 15th International Congress on Image and Signal
Processing, BioMedical Engineering and Informatics (CISP-BMEI), 1-5.
https://doi.org/10.1109/CISP-BMEI56279.2022.9979973.
3. SU, Y. (2022). D ESIGN OF ECG ACQUISITION AND DISPLAY SYSTEM BASED ON
ADS1292R AND STM32 MICROCONTROLLER . 2022 15TH INTERNATIONAL
CONGRESS ON IMAGE AND SIGNAL PROCESSING, BIOMEDICAL ENGINEERING AND
INFORMATICS (CISP-BMEI) , 1-5. HTTPS://DOI.ORG/10.1109/CISP-
BMEI56279.2022.9979973.
4. Bravo-Zanoguera, M., Cuevas-González, D., García-Vázquez, J., Avitia,
R., & Reyna, M. (2019). Portable ECG System Design Using the AD8232
Microchip and Open-Source Platform. Proceedings.
https://doi.org/10.3390/ecsa-6-06584.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy