Ecg Project Report

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

FACULTY OF ENGINEERING

DEPARTMENT OF BIOMEDICAL ENGINEERING

BIOMEDICAL SYSTEMS PROJECT DEVELOPMENT


BME19392E

DIGITAL ECG PROJECT REPORT

Dr. Orhan ÖZHAN


Lecturers:
Ress. Asst. Mahmud Esad ARAR

SEREN AYVAZ - 1521231054


Group Members: FATİH ALACA - 1521231046
SERKAN KAMİL - 1521231047

Report Date: 23.05.2020


CONTENTS
SUMMARY 3

PROJECT GANTT CHART 4

PURPOSE OF PROJECT 5

2.1 Goal of Project 5

PROCESS AND REALIZATION OF THE PROJECT 5

WHAT IS ECG 6

ELECTRODES, EINTHOVEN TRIANGLE and DERIVATIONS 7

4.1. Electrodes 7

4.2. Einthoven Triangle 8

4.3. Derivations 8

4.3.1. Bipolar Derivations 8

4.3.2. Augmented Unipolar Derivations 8

4.3.3. Wilson’s Central Terminal 9

LTSPİCE 9

MULTIPLEXER 9

DC TEST CIRCUIT 14

OSCILLATOR(CLOCK) CIRCUIT 15

COUNTER CIRCUIT 16

10.1 Asynchronous Circuits 17

10.2 Synchronous Circuit 17

DEMULTIPLEXER 19

VIRTUAL GROUND 22

ECG GENERATOR CIRCUIT 23

INSTRUMENTATION AMPLIFIER CIRCUIT 24

CALIBRATION OSCILLATOR CIRCUIT 26

BUFFER CIRCUIT 28

ECG SIMULATOR MEASUREMENTS AND OUTPUTS 29


SUMMARY

The ECG device is the tool that measures the electrical activity of the heart, which is
used to diagnose heart rhythm and heart disease. The biological signals received are the
voltage value of activity of the hearth against time in ECG. We designed it to analyze the
input and output signals of the ECG signals in the ECG circuit. We have seen the internal
structure and properties of the components of the ECG circuit. We worked step by step on the
development of the ECG Project and how the design processes were designed. We completed
the ECG circuit and observed the heartbeat in seconds to analog simulation.
1. PROJECT GANTT CHART

Figure 1. ​Project Gantt Chart


2. PURPOSE OF PROJECT

Our aim is to analyze the electrical activity produced by the heart cells and how hearth to
work and see the information of the output of the ECG data in Ltspice by analog it on the
simulation.

2.1 Goal of Project

Our goals are designing ECG circuit on the Ltspice analog simulation. Seeing and
examining the properties of ECG circuits elements and formation of internal structures.Also,
we will understand the function of the outputs of the ECG circuit ;Calibration, Lead I, Lead II
and Lead III outputs.

3. PROCESS AND REALIZATION OF THE PROJECT


● Circuit draft was prepared for the project
● Integrated research done
● Theoretical lessons about Labview and Myrio
● The project, which could not be realized physically due to the virus outbreak,
was decided to be carried out on the simulator.
● Ltspice installed
● Dvre stages are run and tested sequentially
● An ECG Simulator was obtained by combining the entire circuit
4. WHAT IS ECG
ECG occurs when the signals received by sensors or electrodes connected to the body are
processed in the device and drawn in the form of a wave.

ECG is a graphical recording of the rhythm, spread, frequency, and reaction disappearance of
the heart through electrodes attached to the body. The name of the method is
Electrocardiography. The recordings of the device are Electrocardiograms.

It is the electrical activity that occurs during the contraction and relaxation of the auricles and
ventricles of the heart. It is a picture of the electrical map of the heart.

The ECG has a waveform in response to each heartbeat. These are a complex of P, Q, R, S, T
waves.

Figure 2.​ ECG waveform

In this figure, there are several waveforms and intervals.Let’s explain them.

● P Wave: Indicates the electrical forces created by atrial activation(atrial repolarization)


and measures the interval from the beginning to the end of the P wave.
● PR Interval: It shows the transmission time from the beginning of atrial depolarization
to the beginning of ventricular depolarization. The longest PR is measured in the range
from the start of the P wave to the first deflection of the QRS complex.
● QRS Complex: Indicates the duration of ventricular activation(ventricular
depolarization).
● QT Interval: Indicates the total duration of the ventricular systole.
● ST Segment: Indicates the interval between the end of ventricular depolarization and
the start of repolarization (T wave).
● T Wave: Indicates the electric forces created by ventricular repolarization.

5. ELECTRODES, EINTHOVEN TRIANGLE and DERIVATIONS

4.1. Electrodes
Electrodes are connected to three limbs in total, two arms and one leg. These are the right
arm(RA), left arm(LA), and left leg(LL). (The right leg(RL) is used as a reference, because
this is the farthest point to the heart.)

Figure 3.​ Limbs and Leads on Einthoven Triangle


Figure 4. ​Einthoven Triangle

4.2. Einthoven Triangle


Relation between derivation of limbs and electrodes is called as Einthoven Triangle(figure 2).

4.3. Derivations
For measure ECG signals there are three types of derivation:

4.3.1. Bipolar Derivations


They are called as I,II and III.

● First derivation (Lead I) is LA - RA


● Second derivation (Lead II) is LL - RA
● Third derivation (Lead III) is LL - LA

4.3.2. Augmented Unipolar Derivations


They are called as aVL, aVF and aVR.(figure 2)

When the recording of potentials between individual limb leads and this central terminal is
made, an alternative triangle similar to the original Einthoven’s triangle but rotated by 30
degrees is obtained.
Since the measurement is with respect to a reference point that has zero potential all the time,
the new configuration is called the unipolar limb leads abbreviated as VR, VL and VF for
right arm, left arm and left foot respectively. Three new configurations thus obtained as aVR,
aVL and aVF. “a” stands for “augmented”.

4.3.3. Wilson’s Central Terminal


Wilson’s central terminal is the average value of measurements taken from the RA, LA and
LL limbs to get the average potential value of the body.

It is calculating with; ​Vw = ⅓(RA+LA+LL)

In this project, when we taking measurements, we will use bipolar derivations.

6. LTSPİCE
LTspice is an analog electronic circuit simulator. It is a simulator that draws circuit diagrams,
feeds them as ac and dc, simulates and displays the output waveforms and eliminates the
noise that occurs in the real.

https://www.analog.com/en/design-center/design-tools-and-calculators/ltspice-simulator.html

We used this site to download LTspice XVII version.

With this simulator, we can draw and run all our circuits and add and use the necessary
libraries from the outside.

7. MULTIPLEXER

Multiplexer literally means multiplexer. In other words, it is used to reduce more than one
input to the system to a single output. For example, we want to get 1 output from the system
where we give 4 inputs. In order to do this, we need the selective ends of the system. We need
a 2-bit selective bit to convert 4 inputs into one output. So, 2 selective tips are required. In
order to convert 8 inputs into a single output, we need 3 bits, that is, 3 selective bits.
Figure 5.​ Multiplexer Structure

S1 S2 OUT

0 0 a

0 1 b

1 0 c

1 1 d

Table 1.​ 4x1 Multiplexer Truth Table

Figure 6​. 4x1 Multiplexer Logic Diagram


Multiplexer circuits determine the output with selective ends due to their structure. The
structure shown in the logic diagram ensures that only one of the inputs reach the output with
the sign that the selective ends will receive at any time.

In this project, our aim is to use the multiplexer structure to make 4 different signals (RA, LA,
LL and calibration signal) that we receive from the body with electrodes selectable with the
multiplexer. In other words, we want to obtain the signal of the limb or derivation by selecting
it from the multiplexer.

As a multiplexer, we used the CD4052 integration. However, this is not among the integrated
LTspice libraries. We used this component by adding it to our project file that prepared by Dr
Orhan Özhan and shared with us.

This integration is 2*(4x1) mux. We have 2 types input as XX(X0,X1,X2,X3) and


YY(Y0,Y1,Y2,Y3). So, we have 2 types output as X and Y and 2 selective ends as A and B.
The reason for this is that it can receive both positive and negative outputs of the signals from
the same inputs.

The purpose of the capacitors C1 and C2 that connected to the outputs is to prevent
fluctuations at the output.

Figure 7.​ Multiplexer Circuit with CD4052


Figure 8.​ ​8x2 MUX inputs

We chose X channels positive and Y channels negative in the 8x2 Multiplexer. Values of the
starting and ending parts of the leads are shown on the Eindhoven triangle. We edited the
Mux inputs according to this chart.

MUXP and MUXN outputs give us leads. The positive side of the calibration mark is
connected to X3 because the negative side goes to Y3 and the negative side goes to Virtual
Ground. The outputs of MUXP and MUXN give us all leads.

Figure 9. ​Multiplexer Output’s Signals of X and Y(positive and negative output)

We tested this mux circuit with a DC test circuit.

After connecting the electrodes to operate the multiplexer, we designed a 1000 Hz oscillator
for the selective tips. We also connected a counter circuit to the output of the oscillator. This
counter circuit allows the selective tips to be changed with a different combination at each
pulse. At the output of this circuit, we obtained MUXP and MUXN outputs from the
multiplexer.
Figure 10.​ V(muxp) signal

Figure 11.​ V(muxn) signal

Figure 12​. V(muxp)-V(muxn )signal

For all these measurements we designed the following circuit. This circuit includes dc test
circuit, ecg generator, mux, counter and oscillator circuits. The necessary steps will be
explained in the following sections.
Figure 13. ​Mux Circuit and Its Necessary Connections

8. DC TEST CIRCUIT
We fed this test circuit with a 10V DC voltage. By placing 2k resistors after each limb, we
achieved 2V voltage drop. So we divided the voltage.

Figure 14.​ DC Test Circuit


Figure 15.​ DC Test Circuit Output Signals from Electrodes

Figure 9 shows us that the voltage measured from RA, LA, LL and CAL electrodes,
respectively is 8V, 6V, 4V and 2V. That means the dc test circuit is working successfully.

A B MUXP A B MUXN

0 0 8V 0 0 2V

1 0 6V 1 0 4V

0 1 4V 0 1 6V

1 1 2V 1 1 8V

Table 2.​ MUX Outputs with DC Test Circuit Supply

9. OSCILLATOR(CLOCK) CIRCUIT
The system that we use to produce square, sine, triangle or sawtooth waves required for
electronic circuits is called oscillator. Oscillators take back the output that they produce as
input with the help of an amplifier. In this way, positive feedback is provided.
Figure 16.​ Oscillator Circuit

Figure 17.​ Oscillator Frequency

10. COUNTER CIRCUIT

Counter circuits are circuits formed by the proper connection of flip flops. Depending on the
input pulse, they are logic circuits that repeat certain states at the output. Counter circuits are
separated into 2 groups according to the way the connection of flip flops. These are
synchronous and asynchronous circuits. And we need a 2-bit counter, so we will use 2 flip
flops.
10.1 Asynchronous Circuits
If the signal that used counting is applied to only input of the first flip flop, and other flip
flops use the output (Q or Q’) of the previous flip flop as the clock input, this circuit is an
asynchronous counter circuit.

Figure 18.​ 3-Bit Asynchronous Counter Logic Diagram

10.2 Synchronous Circuit


If the signal that used counting is applied to all input of the flip flops at the same time this
circuit is an synchronous counter circuit.

Figure 19.​ 3-Bit Synchronous Counter Logic Diagram

In this project, we will used a synchronous ​counter circuit. Because, in asynchronous meters,
only the first flip flops are given to the first flip flops, the subsequent flip flops being
connected to the output of the previous flip flops cause time delay. To avoid this time delay,
we will use a synchronous circuit with a clock signal to all inputs simultaneously.
Figure 20. ​D -type Flip Flop, Logic Diagram and Truth Table

Figure 21.​ 2-Bit Counter Circuit with D Flip Flops

So, with this counter circuit we feed the selective tips of multiplexer circuit. And counter
circuit receiver the clock signal from the oscillator circuit. It is an 1kHz square signal.
11. DEMULTIPLEXER

Demultiplexer has an input and multiple outputs. Demultiplexer’s works principle is


exactly opposite of Multiplexer’s. 1x4 demultiplexer distribute 1 data line to 4 data
lines. Our Demultiplexer consists 1 input line, 4 output channels and 2 select lines.

​ ​ Figure 22.​ 1x4 Demultiplexer Truth Table

CD4052 used in simulation can be used both as multiplexer and demultiplexer because
it is analog integrated. If we built the circuit ourselves, different integrations would be
required for multiplexer and demultiplexer. Ltspice being an analog simulator helped
us with this. For instance, when S0=0 and S1=0, the data input is connected to output
X0. X0 output shows Lead I.

Figure 23. ​Demultiplexer Structure


Figure 24.​ Demultiplexer Logic Diagram

Figure 25 .​Lead I Signal

Figure 26. ​Lead II


Figure 27. ​Lead III

Figure 28. ​All Derivations and Calibration Signal

Figure 29. ​Demux Circuit and Lead Outputs


Figure 30.​ Mux and Demux Logic Design

12. VIRTUAL GROUND

The CD4052 integration we use in real life has a Vdd, Vss, Vee terminal. Vss goes to ground
(0V), Vdd value is -5V and Vee value is + 5V. However, our Mux design in the simulation
does not have Vee and instead has Virtual Ground and its value is 5V. When looking at the
Right / Left arm output graphs, it is seen that the values revolve around the Virtual Ground
value. When the difference of the two is taken, it is seen that the signal is low voltage and is
around 0 V.


Figure 31.​ VGND
13. ECG GENERATOR CIRCUIT

The purpose of the ecg generator circuit is to generate real signals for our circuit. It generates
real ecg waves by reading the signal values of RA, LA, LL and CAL written in a text file.
Using the waves from these limbs, we can also measure for the leads we need.

Figure 32. ​ECG Generator - Lead Circuit

The circuit that shown at Figure 32, our electrot thats mean ecg generator circuit. The limb
values given from the texts are given to the LA, RA and LL tips. We create 3 different leads
using these values and amplifier them 1000(1e3) times. So lead values increas to V levels
from mV levels.
Figure 33.​ RA, LA and LL Signals From Texts( mV)

Figure 34.​ LEAD-I, LEAD-II and LEAD-III Signals with Text Signals(V)

14. INSTRUMENTATION AMPLIFIER CIRCUIT

Instrumentation Amplifier is a circuit consisting of opamps and resistors that increase the
difference of two signals. The most important feature of the Instrumentation Amplifier is that
they have high CMRR (common mode rejection ratio), so the signals of the same feature do
not take this signal into account when both ends are applied. As a result, instrumentation
amplifiers eliminate noise as much as possible. . Our main use in the circuit is to increase the
ECG signals we obtain and to increase their differences.
Figure 35. ​Instrumentation Amplifier Circuit Created Using AMP01 Integration

Figure 36. ​Output of AMP01 Instrumentation Amplifier

We use Instrumentation Amplifier to amplify this signal. That's why we connected the MUXP
and MUXN outputs and Virtual Ground to the input of the amplifier. The gain of the
Instrumentation Amplifier is found with this formula:

G= 20 x Rs/Rg

The amplifier's input is divided into two: Common Mode signal and differential signal.
Common mode signal is a signal that revolves around 1kHz Virtual Ground with a peak value
of 1V. Differential signal, however, has a peak value of 1Mv of 400Hz.
15. CALIBRATION OSCILLATOR CIRCUIT

Oscillators are used in radio systems to produce sine signal oscillators, carrier signals and to
convert one frequency to another in the mixing floors. There will be two oscillator circuits in
the circuit, one will be connected to the calibration oscillator and the other will be connected
to the multiplexer input. NE555 integration consists of Trigger, Threshold, Discharge, Reset,
Input, Output and Ground terminals.

The 555 integrated circuit is designed as a free-running non-sinusoidal oscillator in unstable


mode. Note that the threshold input and the trigger input are combined. When the capacitor
voltage reaches 1/3 𝑉cc voltage, it lowers the lower comparator output to the low level and
when it reaches the 2/3 𝑉cc voltage, the upper comparator pulls the output to a high level.
This situation resets the flip-flop and transmits the transmitter with the voltage applied to the
base of the discharge transistor. From this moment, the capacitor discharges through the R2
resistance and discharge transistor. When the capacitor voltage reaches 1/3 𝑉cc voltage at the
discharge stage, it returns to the original state, the upper and lower comparators, respectively,
reach low and high levels; flip-flop output changes position again; the transistor becomes
clogged and the capacitor starts charging again.

Figure 37.​ Charge and Discharge Curve of the Capacitor

The period of the sign formed on the capacitor is equal to the sum of the charging time of the
capacitor and the discharge time. While the capacitor in charge is charged over 𝑅1 + 𝑅2
resistance, it discharges over üzerinden2 resistance. In this case, the charging time constant is
𝑅1 + 𝑅2X𝐶, the discharge time constant is 𝑅2X𝐶 seconds. Since the capacitor is charged and
discharged between 1/3 𝑉𝐶𝐶 and 2/3 𝑉𝐶𝐶 voltages, the charging time T𝐻 and discharge time
T𝐿:
T𝐻=0,693R1+R2 X C

T𝐿=0,693R2 X 𝐶

𝑇=T𝐻+T𝐿 =0,693 𝑅1+2𝑅2 𝐶

and frequency

𝑓=1,44/ (𝑅1+2𝑅2) 𝐶

𝑓 = 1,44/(2.5k+2x 2k)x220nF = 1 kHz

Figure 38.​ Calibration Oscillator

Figure 39.​ Inverse and Non-Calibrated Outputs of the Calibration Oscillator Output
By connecting the Inverter to the pulse end, we obtained the inverse and non-inverse states.
The output we obtained is shown in Figure 35. This oscillator represents our heart rate in
seconds and the pulse in simulation.

16. BUFFER CIRCUIT

Buffer circuit, also multiple outputs without disrupting the characteristics of a signal. It can be
used in the distribution to the terminal. Since there is no voltage difference between the Op
amp inputs, the output voltage and input voltage are the same. There is no voltage gain.

The output from demultiplexer has entered the buffer circuit. The buffer circuit prevents
demultiplexer from working extra. It is important for the signals not to be lost. It is an
important step before filtering.

Figure 40. ​Buffer Circuit and RC Filter


17. ECG SIMULATOR MEASUREMENTS AND OUTPUTS

Figure 41.​ ECG Sımulator Cırcuit

Figure 42.​ ECG Simulator Outputs from CAL, Lead-, Lead-II and Lead-III tips

You might also like