SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 3(2); September (2022), pp. 73–76
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

Design of household ECG detector based on STM32 chip
Tianyi Zhang, Huating Liu

College of Electronic Information and Automation, Tianjin University of Science and Technology, 300222, China

ARTICLE INFO
Article History
Received 22 November 2021
Accepted 06 September 2022
Keywords
Signal acquisition
ECG
Digital signal process
STM32ABSTRACT

ECG monitoring instruments occupy an important position in the medical field of application.
According to its electrocardiogram, it can be judged whether the basic function of the heart isnormal, whether there is some kind of heart disease, etc. Traditional ECG monitoring devices
have the disadvantages of being large and not portable. In this paper, a portable home ECG
monitor is designed to overcome these disadvantages. In this paper, we designed a portableinfrared induction heart rate measurement device, using STM32C8T6 as the core chip, tocomplete the extraction and processing analysis of ECG signals. The complete set thus composed
can make basic diagnosis of the collected data and is successfully applied to daily life of family..

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

1. Introduction

portable ECG device, which collects ECG signals throughsensors, performs processing operations such as filteringand enhancement by STM32 chip, and finally is displayedby the display. It has the features of low price, small size,
easy to carry and easy to use.

With the progress of society, economic development andthe gradual improvement of people's living standards, theaging of the population is becoming more and more
serious. The incidence of heart disease is also on the rise[1].
However, due to the limited testing locations and methods,
it has become difficult for ordinary people to prevent,detect and seek medical treatment in a timely manner.
Timely detection and treatment is a key way to reduce theemergence of heart-related diseases. Effective andconvenient ECG monitoring instruments are a powerfultool to accomplish this task [1],[2].
Conventional ECG monitoring devices are bulky,expensive and not portable, and can only record ECG
activity while the patient is lying down for a short periodof time, obtaining very little information. In order that
ECG signal detection is not restricted by fixed occasions
and can be diagnosed more conveniently, a design of aportable ECG signal detection system is proposed.
Portable monitoring device can monitor and store data
anywhere and anytime. This paper mainly designs a2. General DesignIn this paper, we design a household ECG detector,
which combines embedded technology, digital signal
processing technology and signal acquisition technology
in one. It can complete the function of ECG signal
extraction and analysis.
The whole system consists of six modules: signal
acquisition module, signal process module, keypad
module, display circuit module, PC communication
module and MCU module. The system structure schematic
diagram is shown in Fig.1.
The heart rate signal of the subject is collected by thefront-end electrode, and then the heart rate signal istransmitted to the ECG acquisition circuit for a series ofCorresponding author’s E-mail: zhangtianyi085@163.com web: www.tust.edu.cn73

In the design, the processor is responsible is responsible
for five parts, including signal acquisition, signal filteringand processing, display of ECG waveforms, data storage,and communication. The processor is the core in the wholesystem.

operations such as pre-amplification, main amplification,high and low pass filtering, etc. A compliant set of ECG
signals will be obtained. The system then sends the ECG
signal to the STM32 ADC for AD conversion once it isobtained.

3.2. Human-machine interaction interface
Human-machine interface is a device for communication
between human and machine, which can transmit humancommands to MCU and also let the device display theinformation we want to know. Color, power consumption
and size are the factors to consider when choosing ahuman-computer interface display, and these factors must
be selected in combination with actual use.
According to the above points this design chose 3.2 inchtrue color TFT LCD touch screen, with 320 * 240 pixels,
260,000 colors, 16-bit parallel interface, it can be directly
driven by AVR, ARM7, STM32 and other MCUs. Thescreen-related parameters are as follows:• Resolution: QVGA 240 x 320• Size: 3.2 inches• Controller: IL9320• Touch screen: 4-wire resistive type
• Pins: 30PIN• Backlight: 4 LEDs in parallel
The touch screen is shown in Fig. 3.

Fig. 1. The system structure schematic diagram
The system control chip adopts STM32 and the displayadopts TFT-LCD. Its touch function plus a small numberof keys can establish a good human-computer interaction
environment, which can be displayed and played back inreal time by LCD. The acquired data can be transferred toa PC for signal analysis.
3. System Hardware Design
The hardware selected for the system includes thefollowing two aspects: choice of processor and the humanmachine interaction interface.
3.1. Choice of processor
Processing speed, complexity of the completed tasks,
complexity of peripheral circuits, production costs andhigh-power consumption are factors that cannot beignored when choosing a processor.
Considering the above aspects, we finally chose
STM32F103C8T6, a new 32-bit ARM core processor chipfrom STMicroelectronics, from the STM32 family. The
main control chip is shown in Fig. 2.

Fig. 3. The touch screen
4. System Circuit Design
In the circuit design, this design adopts Pre-amplifiercircuit, right leg driver circuit, filter circuit, trap circuit andpower supply circuit to form an overall system circuit.
These circuits are able to process signals efficiently andgreatly improve the functional effectiveness of the device.

Fig. 2. STM32C8T6 chip74

4.1. Pre-amplifier circuit

voltages, the output current, and the control state. TheECG acquisition circuit requires a ±5V power supply, theSTM32 operates at 3.3V and this design is powered by a
7.2V battery.

The pre-amplifier circuit has to perform the function ofdifferential signal amplification. This part of the circuit is
the first link in the entire acquisition circuit, and has agreater impact on the subsequent links, so it is very
important to choose a suitable differential operational
amplifier chip. The following points are generally
considered in the selection.
• Gain• Frequency Response• Common Mode Rejection Ratio• Input Impedance• Low noise, low drift

5. System Software DesignThe system software is divided into two broad parts. The
two parts are as follows:(1) Lower computer software, i.e. STM32 application. It
mainly completes the acquisition of ECG signals, signal
filtering, RTC module, LCD display and serial
communication, etc.; (2) the upper computer management
software. Its function is to complete the reception andprocessing of data, which mainly includes the reception,
display and storage of data [2].
Software Flow Diagram is shown in Fig. 4.

4.2. Right leg driver circuit
Due to the large amount of external interference tohumans, the capacitive coupling between the ECG
electrodes and the power lines generates displacement
currents[1].The right leg drive circuit is often used toremove the common mode signal from the input amplifier
and eliminate interference noise.
We use a right-leg drive circuit, which can have a
suppressive effect on 50Hz interference and does notcome at the expense of losing the frequency componentof the ECG signal.
4.3. Filter circuit and trap circuit
To filter out interference, we need to design a bandpass
filter that allows ECG signals with frequencies from 0.05
Hz to l00 Hz pass through. This causes signals outside
this range to be attenuated significantly.
The active bandpass filter is used in this design. The
bandpass filter is composed of a high and low pass filter
with a high pass filter as of f=0.03Hz and a low pass filter
as of f=110Hz.
Considering that the right leg drive circuit cannot
completely eliminate the interference signal, this design
adds a 50Hz trap circuit to further eliminate the industrial
frequency interference. The experimental results showthat the signal waveform is clear and distinctive by highand low pass filtering followed by trap circuit.

Fig.4. Software Flow Diagram
Fig. 4. Software Flow Diagram

6. Conclusion
The system designed in this paper is a portable andminiaturized ECG monitoring system, and the STM32
chip based on Cortex-M3 was chosen as themicroprocessor to maximize cost savings. Overall, we

4.4. Power circuit
The power supply circuit design mainly considers which
type of power supply device to use, the input and output
75

designed a portable ECG signal collector based on STM32
chip with easy operation, flexible mobility and low cost.
It is easy to carry the characteristics of storing data, cancomplete a long period of ECG monitoring, and real-time
ECG waveform display through TFT-LCD color LCD,through the key to make the system has a good humancomputer interaction interface. According to several
experiments and trials, the household ECG detector is able
to collect human signals and process and display them well,which is helpful for users to monitor the heart statusanytime and anywhere.
References
1. Zhou J . Elimination of Power-line Interference from ECG
Signals. Journal of Biomedical Engineering Research, 2003.
2. Wang D X , Wang G J . Development of a portableambulatory ECG monitor based on embedded
microprocessor unit. Space Medicine & Medical
Engineering, 2005, 18(3):196-200.

Authors Introduction
Ms. Tianyi Zhang

Ms. Huating Liu

She is a second-year mastercandidate in Tianjin University of
Science and Technology, majoring
inbrain-computerinterface,machine vision.

She is a second-year mastercandidate in Tianjin University of
Science and Technology, majoringin flashboarding.

76