check in
Completed

Portable ECG monitor based on STC15

PROPortable ECG monitor based on STC15

tag

113
0
0
0
Mode:Full

License

GPL 3.0

Creation time:2025-03-19 08:26:22Update time:2025-03-20 01:55:53

Description

//Uploaded a new version, it's time to do the graduation project, many people come to ask

Modification time: 2024.10.26

Requirements analysis

Heart disease is one of the main causes of human death. Timely and accurate electrocardiogram monitoring is crucial for preventing and diagnosing heart disease. However, due to the sudden and random nature of heart abnormalities, short-term monitoring often makes it difficult to capture abnormalities, leading to misdiagnosis. In addition, traditional electrocardiogram monitoring devices are usually expensive and not portable, which cannot meet people's daily monitoring needs.
Therefore, developing a small and portable ECG monitor that allows users to monitor ECG anytime and anywhere is of great practical significance.

Feature introduction

  • Display real-time electrocardiogram waveforms and calculate heart rate, and also measure blood oxygen saturation
  • Can switch the display of the lower computer screen or send waveform data to the upper computer via Bluetooth
  • Heart rate tachycardia, slow warning

Introduction to ECG signals

The spectral range of electrocardiogram signals is mainly concentrated in 0.05~ 100Hz, with a voltage of about a few millivolts. It has the characteristics of weak, low frequency, and easy interference. Common interferences include the following:
1. Power frequency interference . Interference caused by the power supply network (usually 50Hz) is the main source of interference in electrocardiogram signals
2. Base line drift . Due to the change of ECG base line caused by respiration and movement, the change in amplitude can reach 15%, and the frequency is low.
3. EMG interference . Muscle activity is accompanied by electrical activity. Its frequency range is 20~ 5000Hz.

Introduction to electrocardiogram processing circuit

  • The first stage preamplifier has a gain of 7 and includes a right leg driver circuit to eliminate common mode interference
  • The second stage 107Hz low-pass filtering eliminates high-frequency signals
  • The third-stage dual-T active 50Hz notch filter filters out power frequency interference
  • Fourth stage 0.1Hz high-pass filtering, improve base line drift, amplify 50x
  • The fifth stage amplifier amplifies the signal 5 times
  • The overall signal was amplified 1250 times

Master

  • P54 pin low-level single-chip microcomputer reset, used for burning software
  • Using 3V3 power supply

Power supply

  • USB and lithium battery power supply
  • The USB interface has chosen the widely used TYPE-C
  • The battery is an 850mAh 3.7V lithium battery
  • After inserting the USB cable, it can automatically switch to USB power supply
  • Charge lithium batteries at the same time
  • Battery charging management uses the TP4056 chip

Software design

Heart rate calculation

Heart Rate (bpm) = 60/Mean R-Wave Interval (sec)

R wave detection method - threshold method

1. Traverse the data: Traverse each Data Point in the ECG data array.

2. Peak condition: For each Data Point, check whether it is greater than the adjacent Data Points on the left and right, and whether it exceeds the preset threshold.

3. Record peak: If the Data Point meets the above conditions, record its position to indicate that an R-wave peak has been detected.

Advantages: simple, fast

Cons: Imprecise, and the threshold needs to be manually observed, such as base line drift or noise glitches, which will have a great impact.

Plotting waveform implementation
  • Scaling the voltage value calculation to the Y-axis coordinate value of the screen pixel, with the X-axis as the time axis.
  • One ADC value draws one pixel, and adjacent two points are connected by a straight line, resulting in real-time voltage waveform rolling refresh.

Blood oxygen saturation reading

Initialization: Initialize the MAX30102 sensor, including configuration mode, sampling rate, LED current and other parameters.

Data Acquisition: Read the intensity data of red and infrared light from the FIFO Data register of the sensor through I2C. Every three bytes of data needs to be merged and merged into a long integer.

3. Calculation: Use red light and infrared light data to calculate blood oxygen saturation through simplified formulas.

Simplified blood oxygen formula

  • R = red / ir

  • spO2 = 120 - 25 * R;

An accurate calculation method for blood oxygen saturation requires obtaining the DC and AC components of light intensity, which requires a large amount of calculation and storage of a large amount of data.

The results of simplifying the formula will not be very accurate.

Upper computer

Based on LabView production, only simple waveform drawing function.

Demo

Video link:

https://www.bilibili.com/video/BV1mJ8qeSEuj/?vd_source=51dc43e08b25c112cfd71690f421341d

Designed by olddogcai (from OSHWHub)

a:https://oshwhub.com/olddogcai/ecg-monitor-based-on-stc8

Design Drawing

Download File
The preview image was not generated, please save it again in the editor.

Attachments

OrderFile nameDownload times
1
Serial host computer.vi
228
2
LCD version .rar
324
3
IMG_0995_1.mp4
466
Add to Album
0
0
Share
Report

Comment

All Comments(1)
Sort by time|Sort by popularity
Followers0|Likes0
Related projects
Empty

Bottom Navigation