Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 36

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY

VIETNAM NATIONAL UNIVERSITY – HO CHI MINH




PROJECT REPORT
ECG SIMULATOR
Group’s members:
Nguyễn Ngọc Trúc Quỳnh 2252706
Nguyễn Bảo Ân 2252051
THE ABSTRACT
Cardiovascular Diseases account for about an estimated figure of 17.7 million deaths
each year according to the World Health Organization.
The underlying symptoms of cardiovascular diseases narrows down to the severity of
arrhythmias, cardiac stroke, heart attacks, poor blood supply, damage to heart values,
peripheral and congenital heart disease. The timely monitoring and treatment of these
diseases from the onset of these symptoms is the need of the hour so ECG monitoring
is highly critical as it intervenes in early diagnosis of cardiac conditions, thus saving
one’s life in emergency and as well as survival stages. ECG Simulator is a type of
electronic simulation tool that mimics the human heart’s electric signal waves to the
cardiac monitors. In general, an electronic tool that mimics the vital signs of a patient.
In addition, it also trains the clinicians to find out on how to perform diagnosis for a
few cardiovascular conditions. Similarly, the ECG rhythm simulator presents
information on heart status whether the heart beats are produced or not
Contents
I. INTRODUCTION.......................................................................................3
1) ECG THEORY SIMULATION..............................................................3
2) OUTPUT SIGNAL CONDITIONING...................................................8
3) ECG SIMULATOR ASSEMBLY INSTRUCTIONS AND TOOL
LISTS............................................................................................................19
II. ASSEMBLY STEPS..............................................................................21
III. EVALUATION......................................................................................29
IV. CONCLUSIONS AND FUTURE WORKS.........................................34
V. BIBLIOGRAPHY.....................................................................................35
I. INTRODUCTION
1) ECG THEORY SIMULATION
- The Electrocardiogram (ECG) Simulator is a device that generates an
electrical signal similar to the pattern of the human heart. This machine
allows a Biomedical Equipment Technician (BMET) to test the performance
of cardiac monitors and troubleshoot circuit or cable problems.
- Electrocardiography is the practice of measuring the small electrical signal
produced by the heart. An electrocardiograph allows the physician, BMET,
or other medical personnel to obtain the rate and regularity of heartbeats, as
well as the size and position of the chambers of the heart, the presence of
any damage, and the effect of cardiac drugs or devices.
- A basic ECG requires three connections, as shown in Figure 1a:

Figure 1 – (a) Einthoven's triangle. Signal II corresponds to the traditional


ECG waveform (Kychot via Wikimedia Commons). (b) The ECG circuit
uses a differential amplifier to subtract the voltages between the right and
left arm (BotMultichill via Wikimedia Commons).
- The ECG uses a differential amplifier as the primary electrical component.
It has a high gain to be able to amplify the low input currents from the heart
and differential blocks to be able to measure singles I, II and III directly
from the patient’s leads.
- A standard ECG wave is divided into five parts P-QRS-T. The P wave
represents atrial, the QRS represents ventricular depolarization, and the T
wave reflects the phase of rapid repolarization of the ventricles (Figure 2).

Figure 2 – Normal heartbeat electrocardiogram wave signal (Blausen


Medical Communications via Wikimedia Commons).

a) Oscillator and Frequency Divider


The first digital block in this figure corresponds to an oscillator and a 24
bits counter (IC1 - MC14521B).
This chip can generate its own clock in the inputs O2 and I2. The 4.1943
MHz crystal oscillating frequency is suggested by the manufacturer in
datasheet and can be used to generate sub-frequencies such as 1 Hz and
2Hz.
The MC14521B is able to divide the frequency through a chain of 24 toggle
(T) flip−flops. This kind of circuit can be built with a basic JK flip−flop
logic, connecting the “J” and “K” inputs in the “T” node and keeping the
voltage level in the high logic (9 V). In this case, the circuit will only
change the output state “Q” when the clock signal “CP” rises, as shown in
Figure 3

b) Reset Circuit
Between both ICs there is a differentiator block (Figure 4), formed by C56 and
R11. Although this circuit does not change the signal frequency, it converts the
square wave input into an impulse signal that will be used later to reset the
second stage (HCF4017B).
Figure 4 – Circuit that converts a square wave input signal into an
impulse that is used to reset the following IC.

- For the rising of the input signal, the diode D3 will conduct, and the
differentiator output voltage (Vout) can be calculated by the Equation 1:

- Since the input signal corresponds to a square wave and the time constant (τ
= C6.R11//R10 = 0.011 seconds) is much smaller than the inverse of the
maximum input frequency (0.5 seconds), one can apply Equation 2, which
calculates the charging voltage for a series RC circuit:
c) Ring Counter
- Although the IC2 (HCF4017B) in Figure 5 is also called a frequency
divider, this component works as a Johnson counter with 10 decoded
outputs that follow a ring counter pattern.

Figure 5 - Johnson Counter (HCF4017B) pins which are used to generate the
Electrocardiogram wave.

- The basic circuit that can be used to simulate the HCF4017B principle is
Data (D) flip−flop. This kind of logic forwards the level in the D input
whenever the clock signal CP rises, as shown in Figure 6.

Figure 6 – Data flip-flop Logic diagram (a), graphical symbol (b) and
transition table (c).
2) OUTPUT SIGNAL CONDITIONING
a) P Wave Circuit
Figure 7 shows the circuit responsible for the P wave

Figure 7 – P wave output circuit

- Since the resistor R13 is the same value as R12, and R15 is the same as
R14, one can simplify the circuit, as shown in Figure 8. Whenever the logic
level is “1”, there is 9 V applied to the circuit, while in logic “0”,the contact
is open.
Figure 8 – Simplified circuit for P wave signal.

- In order to calculate the signal in the outputs LL and LA, one needs first to
analyze the voltage in the capacitor C5. The Thevenin’s theorem4 can be
used during the capacitor charge, removing this component from the circuit
and calculation ETH and RTH for the connections in Figure 9 in Equation 3
and 4.

Figure 9 – Thevenin’s theorem analysis of the P wave circuit during the


logic “1”. One needs to remove the capacitor C5 (a) and calculate the
Thevenin’s Resistance (b) and voltage (c).
- Since the IC2 can be considered a step signal, one can approximate the
charging voltage in the capacitor in Figure 10 though Equation 5.

Figure 10– Thevenin’s analysis of C5 charging circuit for P wave signal.

- After finding the charging voltage in the capacitor C5, one can calculate the
signal in the outputs LL and LA as seen in Figure 11 and Equation 6.

Figure 11 – P wave output


circuit during the charge of the
capacitor C5 (while pin 3 is in logic “1”).
- Equation 6 shows the how to calculate the P waveform output whenever the
HCF4017B pin 3 is in logic “1”.

- Although the maximum voltage in the capacitor C5 should be 3.07 V


(Equation 5) and in the contacts LL and LA are 0.649 mV (Equation 6), the
HCF4017B pin 3 will open before the capacitor charges completely, which
corresponds to the instant 62.5 ms (1/16 Hz). Therefore, the resulting
maximal voltages in C5 is 1.73 V (Equation 7) and in pins VLL and VLA is
0.366 mV (Equation 8).

- When the HCF4017B output 0 (pin 3) opens (logic “0”), the capacitor C5
will discharge with the circuit in Figure 12 through the Equation 9.

Figure 12 – P wave output circuit during the discharge of the capacitor C5


(while pin 3 is in logic “0”).
- Equation 10 calculates the voltages in the pins VLA and VLL during the
discharge of the capacitor C5 (logic “0”).

- Figure 13 shows the signal created through this RC circuit to simulate the P
waveform. Notice that the time constant is different for the rise and fall of
the voltage, since the Thevenin’s Resistance is smaller than the value in the

discharge circuit.

Figure 13 – Multisim simulation of the input square wave (red) and


resulting P wave component (blue).
b) R and S Wave Circuit
Figure 14 shows the circuit that supplies the R and S wave segment.

- The resistor R5 and the LED X1 are placed parallel to the output 3 to allow
a visual control from the signal frequency and do not interfere in the R
waveform. As in the reset circuit, the diodes D1 and D2 are used to avoid
negative voltages. However, for a + 9 V step in the input, these parts are
opened and can be disregarded. Therefore, one can simplify the R wave
circuit as in Figure 15.

Figure 15 – Simplified circuit for R waveform (a) and equivalent


resistance for the charge of the capacitor C4 (b).
- Using the same principle of the differential circuit in the reset section, one
can calculate the voltage in the equivalent resistor (Vout) through equation
11. Equation 12 calculates the R signal curve, shaped when output 3 is in
logic “1” (9 V). One can observe that the maximum voltage in contacts LL
and LA is 6.57 mV, in the instant t= 0 seconds.

- Figure 16 shows the equivalent circuit for the moment the output 3 (pin 7)
from the HCF4017B opens. The configuration of two diodes in series (D1 +
D2 = 1.2 V) was chosen to generate a small negative voltage, this voltage
creates an S wave in the LL and LA pins, which can be calculated through
the circuits in Figure 16.

Figure 16 – S waveform circuit (a) and equivalent discharge resistance for


the capacitor C4 (b).
- However, in this case, an initial voltage of - 1.2 V is limited by D1 and D2
series, as seen in Equation 13.
Figure 17 shows the simulated wave for the R and S circuits.

Figure 17 – Multisim simulation of the input square wave (red) and


resulting R and S waves component (blue).

c) T Wave Circuit
- The last component of the ECG signal is the T wave. The circuit that shapes
this signal (Figure 18) is almost the same as the P wave, except that in pin 1,
the series resistance value decreases from 1 MΩ to 470 kΩ.
- This will also decrease the charging time and therefore, the amplitude of the
T signal should be higher than the P component.

Figure 18 – T wave output circuit.


- In this case one can repeat Thevenin’s theorem (Figure 19) and also use a
step signal to calculate thevoltage in the capacitor through the charge
Equation 14.

Figure 19 – C5 charging circuit for Thevenin’s analysis of the T wave circuit.

- After finding the charging voltage in the capacitor C5, one can calculate the
signal in the outputs LL and LA as seen in Figure 16 (P and T wave have
the same capacitor discharge circuit) and Equation 15.

- Although Equation 14 and Equation 15 shows that the maximum voltage in


the capacitor C5 is 4.73 V and in the contacts LL and LA is 1 mV, the input
signal will drop to zero before the capacitor charges completely, which
corresponds to the instant 62.5 ms (1/16 Hz). If one replaces this value in
Equations 14 and 15, the maximum capacitor charge is 3.23 V and the T
wave voltages VLL and VLA are both 0.68 mV. Equation 16 shows the
voltage during the discharge of the capacitor C5 for the T wave segment.

- The T wave discharge circuit is the same for the P wave (Figure 17).
Therefore the ECG simulator output in the logic “0” can be calculated
through the Equation 17.
Figure 20 shows the simulated wave for the T circuit.

Figure 20 – Multisim simulation of the input square wave (red) and resulting T
wave component (blue).
d) Final Waveform
- The simulation of the final waveform can be created by adding each circuit
output, as shown in Figure 21. The red curve corresponds to the P part; the
blue represents the R and S peaks, and the green shows the T segment. If
the rate selection switch is in the 120 rpm position, the signal will start to
raise again after 0.56 seconds. If this switch is set to 60 rpm, the signal will
remain in 0 V until 1.05 seconds and then restart the P peak.

Figure 21 – Multisim simulation of the of the final ECG signal. The red
curve corresponds to the P part; the blue represents the R and S peaks,
and the green shows the T segment.
3) ECG SIMULATOR ASSEMBLY INSTRUCTIONS AND
TOOL LISTS
a) ECG SIMULATOR ASSEMBLY INSTRUCTIONS
b) TOOL LISTS
- The tools needed for soldering are shown in this table.
II. ASSEMBLY STEPS
Step 1: Using a website named EasyEDA to draw a ECG circuit
Step 2: Connecting lines together and properly based on circuit diagram.

Step 3: Convert the ECG circuit to 3D view


Step 4: Export a file and print it.

Step 5: Using a copper plate and cutting it into a smaller rectangular plate, which is
larger than the printed circuit. Then we use the heat of electric iron to print the circuit
diagram on the copper rectangular plate.
Step 6: Take a plastic box and fill it up with some water. Dissolve 2-3 teaspoons of
cupric chloride power in the water. Dip the PCB into the etching solution (Cupric
chloride solution, CuCl2) for approximately 30 mins. The CuCl2 reacts with the
unmasked copper and removes the unwanted copper from the PCB.
Step 7: Using a pinch of cotton wool will remove completely the ink on the plate,
exposing the copper surface. Rinse carefully and dry with a clean cloth.
Step 8: Drill holes for the PCB circuit
Step 9: Insert component pins into corresponding holes on circuit board. Solder each
component leg to the board.
Step 10: Using the wire cutters, cut the excess length of resistor wires as close to the
board as possible.
III. EVALUATION
- After we finish our ECG circuit, we carry out a signal measurement on
Arduino IDE by using a sensor AD8232.
Frequency: 60Hz

Frequency: 120Hz

- Then we output the data to the excel to be able to compare with the standard
data easily.
 With frequency: 60Hz

a) P-R interval
tR – tP = 0.126 seconds

Standard Our ECG signal


P-R The PR interval is the time from the Our P-R interval is
interval onset of atrial depolarization to the onset about 0.126 seconds.
of ventricular depolarization. Typically,
this time is 0.10 to 0.20 seconds. When
PR > 0.2 seconds, it is called 1st degree
atrioventricular block.
→ P-R interval is normal

b) Q wave
Standard Our ECG signal
Q Normally, the width of Q wave is < 0.05 Our Q wave is about
wave seconds 0.01 seconds
→ Q wave is normal

c) Q-R-S wave
tS – tQ =0.11 seconds
Standard Our ECG signal
Q-R-S Normally, QRS time is 0.07 to 0.10 Our Q-R-S wave is
wave seconds about 0.11 seconds
→ Q-R-S wave is longer so it is considered complete bundle
branch conduction block or intraventricular conduction delay.
d) S-T segment

Standard Our ECG signal


S-T Normally, it is isoelectric line Our S-T segment is
segmen steep
t
→ Left bundle branch block: Produces high ST with vertical T
waves in a negative QRS lead.

e) T wave
Standard Our ECG signal
T It is usually in the same direction as Q-R- Our T wave is in the
wave S wave same direction as Q-R-
S wave
→ T wave is normal.

f) Q-T interval
Standard Our ECG signal
Q-T Normally, 0.35 – 0.45 seconds Our Q-T interval is 0.2
interva seconds
l
→ Q-T interval is shorter. Short QT interval syndrome (SQTS)
is a congenital or very rare congenital or very rarely acquired
disorder of cardiac ion channel function or regulation that
shortens the action potential duration of ventricular myocytes.
 In conclusion, our ECG signal gives information about
the diagnosis of cardiovascular diseases, and it is also shown
that our signal has some weaknesses such as Q-R-S wave , S-
T segment, Q-T interval and still not a perfect circuit to be
able to use for the measurement of the heart signal.

IV. CONCLUSIONS AND FUTURE WORKS


- Our ECG circuit has some limitations about the output of signals because
we use the resistors with large error and it affects to the accuracy of the data
as well as the signal. However, we can use this circuit to measure the small
signals of devices in teaching and experiments.
- Improvement:
+ Using resistors with low accuracy to reduce factors affecting the signal of
circuit.
+ Increasing frequency of a circuit
+ Arrange components in the most suitable way.
- If we can solve the problems by solutions that we mentioned above, our
circuit can be used in checking for:
+ Heartbeat rate
+ Heartbeat rhythm
+ Heart attack
+ Blood flow to the heart
+ Structure of the heart
- The electrocardiogram is indicated in symptomatic patients to diagnose the
following conditions:
+ Arrhythmia: fast, slow or irregular heartbeat
+ Hypertrophy of atrial and ventricular muscles
+ Conduction disorder
+ Heart attack
+ Ischemic heart disease
+ Injury to the myocardium, pericardium
+ Electrolyte disturbances
- An electrocardiogram is used to monitor treatment in patients with
cardiovascular disease or who are taking medications that can potentially
affect the heart.

V. BIBLIOGRAPHY
- ECG Simulator - Laboratory Activities - Instructor's Guide (Engineering
world health).
- ECG Simulator – Laboratory Activities – Student book (Engineering world
health).
- https://www.neodensmt.com/news/how-to-make-a-printed-circuit-board-at-
home-22434628.html
- https://bom.so/8UIT2A

You might also like