ECG Circuit Design and Analysis Algorithm
ECG Circuit Design and Analysis Algorithm
DOI: 10.54254/2755-2721/28/20230269
Yixin Yang
Carnegie Institute of Technology, Carnegie Mellon University, Pittsburgh, PA 15213,
United States of America
Abstract. Nowadays, many people have a sub-health lifestyle: poor diet, lack of exercise, high
pressure, inadequate sleep, long periods of sitting, etc. All the unhealthy behaviours will lead to
chronic disease, especially heart disease. People then use wearable devices like Apple Watch to
monitor their heartbeat and try to find out if anything goes wrong in advance. This paper is then
going to introduce how wearable devices detect the heartbeat from two perspectives. The
hardware part gives a detailed implementation of a complete design of circuits within the
wearable device used to detect heartbreak. The circuit is designed to be power-efficient, resistant
to noise, and capable of amplifying the input voltage by about 100 times. The circuit design
would contain three main parts: the human body circuit, the three-amplifier system, and the filter
system. For each part, detailed information about how to choose the value of components is
provided, and how the chosen value of components meets the requirement is also illustrated. On
the other hand, it will introduce three algorithms used to analyze the ECG signals output from
the circuit.
Keywords: ECG circuit design, pseudo resistors, right leg driven circuit, three-amplifier system.
1. Introduction
Even though the technology associated with medical treatment has much remarkable progress, heart
disease has still been the leading cause of death for men and women in the United States [1]. According
to the data, one person would die due to cardiovascular disease about every 34 seconds in the United
States [2]. Unlike other chronic diseases like cancer, where patients could receive proper therapy after
they are diagnosed, patients with heart diseases may suffer from heart attacks and strokes, which will
take the life of patients within several minutes, or even several seconds. In addition, although older
people are still the main part of the dead population, the number of young people who die from heart
disease is still considerable; in the current competitive society, young people would face challenges
from both work and study, which makes staying up late a common behavior of the young generation.
Moreover, covid has just passed less than one year. People who recover from covid may still suffer from
sequela such as inflammatory cardiomyopathy.
While once the patients face the outbreak of heart disease, other people and themselves should be
prepared to conduct first-aid, ensuring they can then be sent to the hospital for further treatment.
Otherwise, they may pass away before they arrive at the hospital. To prepare before the onset of a heart
attack, patients should first know their own conditions well. As some heart diseases like cardiac-
arrhythmias cannot be diagnosed within a short time, people need to monitor their heart condition
© 2023 The Authors. This is an open access article distributed under the terms of the Creative Commons Attribution License 4.0
(https://creativecommons.org/licenses/by/4.0/).
150
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
continuously. Meanwhile, monitoring heart conditions could also help people avoid a heart attack; when
they find strange behaviors of the heart, they could go to the doctors or stop their unhealthy behaviors
immediately before a heart attack occurs.
Wearable devices like a watch could be optimal types of equipment that meet the expectation. For
example, you can take a quick 30-second ECG test on your Apple Watch and get a brief summary about
if your heart is working well. This paper will then introduce how this technique is realized from both
hardware and software aspects.
R1 1000k
VRA
2k
C1
50n
R4
R8 R3 1000k
Vecg- Vecg+ VLA
200 2k
C2
R9 R7 50n
200 200
R6
R5 1000k
VRL
2k
C3
I1 C4 50n
200p
SINE(0 0.1u 60)
151
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
usage, unipolar tends to be more pervasive for its easier introduction and better position of the lead [4].
The graph above is our design for the human body circuit. The ecg+ and ecg- tags are the input potential
that is read from the ECG. To mimic the noise (always 60 Hz) in real life, a current source I1 is attached
to the input. VRA corresponds to the potential of the right arm, VLA corresponds to the potential of the
left arm, and VRL corresponds to the potential of the right leg.
V1 Vin+ VDD R3 R4
Vout
Vin- R R
R1
R
X3
R2
X2 R
V2 Vin+ VDD R3 R4
Vout
Vin- R R
152
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
V_in V_out
M1
M2
M3
M4
PMOS
PMOS
PMOS
PMOS
Figure 3. Construction of pseudo resistor.
Therefore, the new gain will be:
𝑅𝐶1 +𝑅𝐶2
𝐴𝑑1 = 1 + 𝑅𝐶𝑔𝑎𝑖𝑛
(3)
1 1
+
𝑗𝑤𝐶1 𝑗𝑤𝐶2
𝐴𝑑1 = 1 + 1 (4)
𝑗𝑤𝐶𝑔𝑎𝑖𝑛
𝐶𝑔𝑎𝑖𝑛(𝐶1+𝐶2)
𝐴𝑑1 = 1 + (5)
𝐶1𝐶2
𝑅
𝐴𝑑2 = 𝑅𝐶4 (6)
𝐶3
1
𝑗𝑤𝐶4
𝐴𝑑2 = 1 (7)
𝑗𝑤𝐶3
𝐶3
𝐴𝑑2 = 𝐶4 (8)
The revised three-amplifier system is shown in Figure 4. According to the data from the following
graph, the first-stage differential gain will be 20, and the second-stage differential gain will be 5.
Therefore, the overall gain will be 100, which equals 40 dB. The requirement for the amplifier system
is met.
VDD
X1
C1 V_in V_out
PR1
X4
10p X3
V_out
Vin+ VDD
C5 Vout Vout
1p Vin-
V_in
Cgain
PR2
V_out
100p
VDD
C6
1p
V_in
VDD
C2 V_out V_in
PR3
10p X5
V_out
X2
153
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
The filter system design is shown in Figure 5. For the circuit below, the 𝑅𝐿 is 𝑅1 , the 𝐶𝐿 is 𝐶9 , the
𝑅𝐻 is 𝑅4 , and the 𝐶𝐻 is 𝐶10. The 𝑅2 and 𝐶11 are connected to the reference voltage to cancel out the
noise.
C4
5p
V_out V_in R1
Vdd
Vdd
PR4 7.96e9 C10
X3
X6 200p
Vin+ VDD C8 C9
X7
Vout Vin+ VDD R3 R4
Vin- 200p 200p Vout Vin+ VDD
Vin- 3.18e6 3.18e6 Vout Vout
Vin-
R2 C11
7.96e9
200p
Vdd
Vref
Vref
V_out V_in R1
C1
PR5
PR1
Vdd
Vdd
10p X3
X6 200p
C12 Vin+ VDD C8 C9
X7
Vout Vin+ VDD R3 R4
C6 1p Vin- 200p 200p Vout Vin+ VDD
3.18e6 3.18e6
Vref Vin-
Vin-
Vout Vout
5p X4
R2
7.96e9
C11
200p
VLA
Vecg+
Vecg+ Vecg+
Vdd
VRA
Vecg- Vecg-
Vref
V_out
Vdd
VRL
Cgain C13
Vref
PR2
100p 1p
Vref
V_in
V1 V2 V3
C2
V_out
10p
PR3
V_out V_in
V_in
PR5
Vecg-
X2
Vin+ VDD C5 C6
Vout Vref
f Vin- 50p 5p
Vecg+
Vref
Vdd
V_out V_in
V1 V2 V3
PR6
100p
Vecg-
Vdd X9
154
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
Aside from the three main parts mentioned above, a right-leg-driven circuit is connected to the design.
After the first amplification stage, this part would sense the common-mode voltage, invert the voltage,
magnify it, and send it back to the right leg circuit. This feedback circuit would help cancel out the
common mode interference created during the amplification process, and it is incredibly efficient in
undermining the influence of the 60Hz noise in real life [7].
As mentioned above, the amplifying amount should be around 40 dB. According to the simulation
of Figure 7, between 1-250 Hz, the amplifying amount is stable at around 43 dB, which meets the
requirement.
While both the right leg feedback circuit, pseudo resistors, and the filter system contribute to noise
reduction, the noise of the system is optimal, which is 170.86 microvolts.
V(vout)
50dB 160°
40dB
80°
30dB
20dB 0°
10dB
-80°
0dB
-10dB -160°
-20dB
-240°
-30dB
-40dB -320°
-50dB
-400°
-60dB
-70dB -480°
-80dB
-560°
-90dB
-100dB -640°
1mHz 10mHz 100mHz 1Hz 10Hz 100Hz 1KHz 10KHz 100KHz 1MHz 10MHz 100MHz
3. ECG analysis
Before walking into the algorithm that analyzes the ECG, the characteristic of the output signal should
first be introduced.
155
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
and repolarization. There is an inverse connection between the length of the QT interval and the heart
rate. In other words, a longer QT interval means a slower heart rate, and vice versa.
4. Conclusion
In conclusion, the hardware part is an ECG circuit that could be implemented into the wearable device.
It could amplify the electrical signal to about 43dB, and the noise is only about 170 microvolts.
Additionally, to save more space, the total capacitor is minimized, and resistors with large impedance
are changed into pseudo resistors. While our circuit design could fit the basic requirements – high
amplifying amount and low noise – for the ECG circuit, the real-life condition is much more complicated.
Each component would be cautiously evaluated and then can be chosen as the built-up parts. For
example, producers should consider which amplifier model would occupy a smaller space, become more
energy-efficient, and cost less. While all the results are based on theories and online simulation, more
data about hands-on experiments should be recorded to provide further information. Although many
different algorithms solve the problem, there is no best algorithm for the software. People should
evaluate their needs and find the algorithms that best fit their requirements.
References
[1] CDC 2000 Facts about heart disease and stroke 2020 M2 Presswire
[2] CDC 2022 Heart Disease Facts
[3] Wu B, Li M, Yang Y, and Zhang W 2012 ECG acquisition circuit design based on C8051F330.
Proc. 2012 IEEE-EMBS Int. Conf. Biomed. Health Inf. pp 93-96 doi: 10.1109/BHI.2012.621
1515.
[4] Kersschot I 1994 Unipolar versus bipolar leads Cardiac Pacing and Electrophysiology ed Aubert
A E, Ector H, and Stroobandt R (Springer, Dordrecht) doi: 10.1007/978-94-011-0872-0_20.
[5] Emanuele G, Fabio T, Francesco Z, Giuseppe S, Alireza M, Marco S and Giorgio F 2020 High-
Value Tunable Pseudo-Resistors Design IEEE J. Solid-state Circuits 55(8) pp 2094-2105 doi:
156
Proceedings of the 2023 International Conference on Mechatronics and Smart Systems
DOI: 10.54254/2755-2721/28/20230269
10.1109/JSSC.2020.2973639.
[6] Gifari M W, Zakaria H, and Mengko R 2015 Design of ECG Homecare:12-lead ECG acquisition
using single channel ECG device developed on AD8232 analog front end. 2015 Int. Conf.
Electri. Eng. Inf. pp 371-376 doi: 10.1109/ICEEI.2015.7352529.
[7] Li Y 2021 Design of ECG Signal Detection Circuit Based on Pacing Pulse Suppression. 2021
IEEE Int. Conf. Electron. Tech. pp 664-669 doi: 10.1109/ICETCI53161.2021.9563387.
[8] Aziz S, Ahmed S and Alouini 2021 M S ECG-based machine-learning algorithms for heartbeat
classification. Sci. Rep. 11 pp 18738 doi: 10.1038/s41598-021-97118-5
[9] Xiang J, Dong Y, Xue X, and Xiong H 2019 Electronics of a Wearable ECG With Level Crossing
Sampling and Human Body Communication. IEEE Trans. Biomed. Circuits Sys. 13(1) pp 68-
79, doi: 10.1109/TBCAS.2018.2879818
[10] Pino E, Ohno-Machado L, Wiechmann E, and Curtis D 2005 Real-time ECG algorithms for
ambulatory patient monitoring AMIA Annu Symp. Proc. 604(8)
157