Minor Project Report 1
Minor Project Report 1
Minor Project Report 1
On
Of
BACHELOR OF TECHNOLOGY
In
By
OCTOBER 2019
2
BONAFIDE CERTIFICATE
who carried out the minor project work under my supervision. Certified further, that
to the best of my knowledge the work reported herein does not form part of any other
project report or dissertation on the basis of which a degree or award was conferred
Date:
3
ACKNOWLEDGEMENT
We would like to extend our gratitude to the many people who helped to bring
this project to fruition. First, we would like to thank the management for the academic
and technical support. We are also thankful to director (E&T), Dr. C.
Muthamizhchelvan for the academic and technical support.
We would like to thank Coordinator Dr. R. Sridhar for his support and
valuable inputs throughout our project. We are deeply grateful for their help, valuable
guidance and support. Their in-depth knowledge and vast experience proved to be the
guiding light throughout the course of our project. We also offer our thanks to our
project coordinators.
Finally, we express our very profound gratitude to our parents for providing us
with unfailing support and continuous encouragement throughout the process of
researching and writing this thesis. This accomplishment would not have been
possible without them.
(SHANID PRASAD)
(OM PRAKASH)
4
ABSTRACT
The project uses Sparksfun’s AD8232 ECG module to process the heart
signal. As the electrical signal coming from heart are merely some microvolts it is
important to have a device which doesn’t cause any error as the margin of calculation
is very small. AD8232 has the required instrumentation amplifier, electrical filters and
other required components all placed in the chip itself. The input is taken from
electrodes which are stuck at correct position.
The output received is an analog signal which can be read using and display
device which in our case is the system itself. Also there are two extra digital signal
which tell the direction or polarity of the voltage received for correct ECG shape. The
signal is received using an Arduino Uno board and is send to the system via Serial
port data transfer between Arduino and computer.
The project presents with a clear ECG signal which can be processed further to
produce other trivial data about the heart such as BPM (beats per minute), QRS
complex shape and its interval. The output is obtained either by the computer or by an
LCD display attached to show the BPM and condition of the heart based on the
output.
Thus the project can be used to determine any abnormality is heart condition
before any fatal condition.
5
TABLE OF CONTENTS
LIST OF FIGURES
FIGURE NO. TITLE PAGE
3 Circuit Connections 9
4 ECG OUTPUT 15
CHAPTER 1
INTRODUCTION
1.1 GENERAL
Understanding various phenomenon which occur in the human body is very
important to study about its working. In earlier days the ideas about the working of
the body was less and some things were not explainable during that time. Over the
past various new inventions and theories have come to our knowledge which has
increased our understanding of the working of the body. The heart being one of the
most important organ of the body as its continuous working is the reason for every
living being to be alive in the world. The hearts function is to transport various
nutrients and oxygen throughout our body. It continuously pumps blood in the body
which is gives energy and nutrients to the body to work.
Heart being this important for the survival of the body, any malfunction of
problem will cause the whole body to collapse. The heart being a muscle and
protected by the rib cage it is very hard to study and understand its working just by
some parameters like blood pressure, heart beat etc. These parameters can give a
rough idea about hearts current state but they can’t be used to determine the heart
condition surely.
For the purpose we used the electrical conduction system of the heart to
determine about how it’s currently functioning and if there is any abnormality. The
electrical conduction system is told properly further, so by recording the electrical
activity of the heart we can determine its condition. We have machines in the hospitals
which gives the ECG (Electrocardiogram) of the heart. Using the ECG we can
understand about the heart in a detailed way.
The Main Objective of the project is to provide us with ECG of the heart
using basic electronics components. The project is based on the actual working ECG
machine which are used in actual hospital. The output of the device can be taken on
either a computer or an LCD display to show the result. The ideal output will be a
noiseless and proper ECG of the heart along with correct BPM (beats per minute) on
the LCD display and some other information.
CHAPTER 2
WORKING OF HEART
2.1 INTRODUCTION
The heart is a muscular organ that pumps blood continuously throughout the
body. It is comprised of four chambers — the right and left atrium and the right and
left ventricle.
The chambers of the heart work together by alternately contracting and relaxing to
pump blood throughout the heart. To accomplish this, the heart uses an electrical
system to trigger a heartbeat. Essentially, the electrical system is the power source that
makes all the heart's functions possible.
Blood vessels lead in and out of the chambers, which receive and distribute blood
throughout the body. The four chambers are connected by four valves — the tricuspid,
pulmonic, mitral and aortic valves. These valves work like one-way doors, allowing
blood to flow in only one direction.
The heart pumps blood with a rhythm determined by a group of pacemaking cells in
the sinoatrial node. These generate a current that causes contraction of the heart,
traveling through the atrioventricular node and along the conduction system of the
heart. The heart receives blood low in oxygen from the systemic circulation, which
enters the right atrium from the superior and inferior venae cavae and passes to the
right ventricle. From here it is pumped into the pulmonary circulation, through
the lungs where it receives oxygen and gives off carbon dioxide. Oxygenated blood
then returns to the left atrium, passes through the left ventricle and is pumped out
through the aorta to the systemic circulation−where the oxygen is used
and metabolized to carbon dioxide. The heart beats at a resting rate close to 72 beats
per minute. Exercise temporarily increases the rate, but lowers resting heart rate in the
long term, and is good for heart health.
The conduction system consists of specialised heart muscle cells, and is situated
within the myocardium. There is a skeleton of fibrous tissue that surrounds the
conduction system which can be seen on an ECG. Dysfunction of the conduction
system can cause irregular, fast, or slow heart rhythms
The sinoatrial node is found in the upper part of the right atrium near to the junction
with the superior vena cava. The electrical signal generated by the sinoatrial node
travels through the right atrium in a radial way that is not completely understood. It
travels to the left atrium via Bachmann's bundle (Bachmann's bundle is, during
normal sinus rhythm, the preferential path for electrical activation of the left atrium.),
such that the muscles of the left and right atria contract together. The signal then
travels to the atrioventricular node. This is found at the bottom of the right atrium in
the atrioventricular septum—the boundary between the right atrium and the left
ventricle. The septum is part of the cardiac skeleton, tissue within the heart that the
electrical signal cannot pass through, which forces the signal to pass through the
atrioventricular node only. The signal then travels along the bundle of His to left and
right bundle branches through to the ventricles of the heart. In the ventricles the signal
is carried by specialized tissue called the Purkinje fibers which then transmit the
electric charge to the heart muscle.
Cardiac muscle has some similarities to neurons and skeletal muscle, as well
as important unique properties. Like a neuron, a given myocardial cell has a
negative membrane potential when at rest. Stimulation above a threshold value
induces the opening of voltage-gated ion channels and a flood of cations into the cell.
The positively charged ions entering the cell cause the depolarization characteristic of
an action potential. Like skeletal muscle, depolarization causes the opening
of voltage-gated calcium channels and release of Ca2+ from the t-tubules. This influx
of calcium causes calcium-induced calcium release from the sarcoplasmic reticulum,
and free Ca2+ causes muscle contraction. After a delay, potassium channels reopen,
and the resulting flow of K+ out of the cell causes repolarization to the resting state
5
2.3 ELECTROCARDIOGRAPHY
In a conventional 12-lead ECG, ten electrodes are placed on the patient's limbs and on
the surface of the chest. The overall magnitude of the heart's electrical potential is
then measured from twelve different angles ("leads") and is recorded over a period of
time (usually ten seconds). In this way, the overall magnitude and direction of the
heart's electrical depolarization is captured at each moment throughout the cardiac
cycle. By studying overall change we can understand about the current state of heart.
There are three main components to an ECG: the P wave, which represents the
depolarization of the atria; the QRS complex, which represents the depolarization of
the ventricles; and the T wave, which represents the repolarization of the ventricles.
The electrocardiogram (ECG) is the primary tool in the diagnosis of any heart
related problems. By comparing the ECG result with previous done ECG we can
provide information about any cardiac abnormalities. Usually symptoms like chest
pain, high blood pressure and problems in breathing are signs of heart related
problems and having and ECG can clear any doubts about the problem. Some heart
related problems does not give very clear signs and symptoms. As sometimes a minor
chest pain which can be interpreted as normal indigestion, and it can be an early sign
of heart attack. To correctly interpret the heart related problem ECG plays the most
important role in heart related medical procedures.
6
CHAPTER 3
WORKING PRINCIPLE OF AN ECG MACHINE
3.1 INRODUCTION
To get the required QRS complex we need to use various electrical circuits to amplify
the signal, to clear the disturbances and to finally get the ECG signal. In a simple
ECG machine electrodes are important as without good conducting electrode we
cannot get an accurate ECG. Instrumentation amplifiers are used to amplify the signal.
Since the signal is very small it is very essential to amplify the signal to a suitable
level so it can be identified and worked with.
The signal after amplification need to be passed through various filters so that we get
the required QRS complex. There is also need of rectification of the signal as we need
only the upper half so rectifier is required. By putting together all this individual
circuits and processing the raw signal coming from heart we can get an ECG signal. If
the signal is needed to be further processed we can also add an analog to digital
convertor which feeds the computer with the data. In this way we can obtain the ECG
from raw electrical signal produced by heart.
These are the individual components of a simple ECG and their respective
works.
Pre-Processing: The amplified ECG signal is passed through a filter to remove the
noise or unwanted signal. Pre-processing of ECG signal helps to remove
contaminants. ECG contaminants can be
The power interference is narrow –band noise centered at 50Hz with a bandwidth of
less than 1 Hz. We can use a notch filter to remove it. However these signals are odd
multiple and can be filtered using a low pass filter. Motion artifacts are in the range of
less than 1 Hz so high pass filter can be used to remove motion artifacts.
Analog to Digital Converter: The signal after following processing can be directly
shown using an oscilloscope or by adding an ADC to the circuit we can send it a
computer for further calculations.
Various other circuits can be added to a simple ECG circuit to make it more efficient
like adding a peak detector circuit to detect the peak of an ECG. This can be used to
calculate beats per minute. Also multiple amplifiers can be placed to make the signal
better and easy to work with.
The end result is the ECG which can be taken as output in many ways as a visual
output. The graph can then be studied properly to understand the heart condition.
CHAPTER 4
AD8232 ECG MODULE
4.1 SPECIFICATIONS
As seen in the previous chapter the circuit of an ECG can be quite complex and
also adding several circuits can take a lot of space as making each individual circuit is
tough. So for this project we are using the AD8232 ECG module. The AD8232 is an
integrated signal conditioning block for ECG and other bio potential measurement
applications. It extract, amplify, and filter small bio potential signals in the presence
of noisy conditions, such as those created by motion or remote electrode placement.
The module contains all the required circuits build in a small chip which also has
input and output ports. The chip is programmable as in this project we are using it
with an Arduino Uno microcontroller. The output obtained is finally given to the
computer where we can see the ECG graph using serial plotter in the Arduino IDE.
The board also has an LED which blinks according to the ECG signal. The AD8232
breaks out nine pins from the IC which are SDN, LO+, LO-, OUTPUT, 3.3V, GND
which are the output side pins and RA (Right Arm), LA (Left Arm), and RL (Right
Leg) for input. It already has a jack port soldered on it so we can use the electrodes by
directly connecting the electrode jack.
The circuit involves the use of 5 pins of the AD8232 board connected to the Arduino
board.
1. GND and 3.3V of the module is connected to the GND and 3.3V of Arduino
2. Output pin is connected to any analog input pin on Arduino here we use A0
3. L0- and L0+ are connected to any digital pins of Arduino here we use 11 and
10
4.3 CODING
void setup() {
Serial.begin(9600);
void loop() {
Serial.println ('!');
else{
Serial.println(analogRead(A0));
delay(1);
}
11
int i = 0;
long lastDebounceTime = 0;
long counter = 0;
boolean no_pulse_latch = 1;
boolean acq_pulse_latch = 0;
boolean beat_pulse_latch = 0;
boolean beat_latch = 0;
//Variables used
int beat_time = 0;
int num1_new = 0;
int num2_new = 0;
int num3_new = 0;
12
void setup() {
Serial.begin(9600);
i = 0;
void loop() {
Serial.print("detecting beat...");
Serial.println(millis());
no_pulse_latch = 0;
acq_pulse_latch = 1;
beat_pulse_latch = 0;
beat_latch = 0;
lastDebounceTime = millis();
detachInterrupt(0);
sum = 0.0;
delay(1);
13
average = sum/amount;
Serial.println(average);
delay(1);}
beat_latch = 1;
Serial.println("First Beat");
no_pulse_latch = 0;
acq_pulse_latch = 0;
beat_pulse_latch = 1;
debounceDelay = 400;
int difference = 0;
Serial.print(average);
Serial.print(a_read);
Serial.println(difference);
delay(100);*/
newtime = millis();
beat_latch = 1;
lastDebounceTime = millis();
oldtime = newtime;
Serial.print("BPM: ");
Serial.println(BPM);
beat_latch = 0;
}}
Serial.println(millis());
no_pulse_latch = 1;
acq_pulse_latch = 0;
beat_pulse_latch = 0;
average = 0.0;
debounceDelay = 400;
a_read = analogRead(A0);
delay(1);
void right_Hand_Detect(){
lastDebounceTime = millis();
15
}}
The result obtained from by uploading the above given code is the ECG signal.
Given below is an example of what a correct ECG will look and the beats per minute
calculated
CHAPTER 5
IDENTIFICATION OF VARIOUS PARTS OF ECG
Thus, the overall direction of depolarization and repolarization produces a vector that
produces positive or negative deflection on the ECG depending on which lead it
points to.
17
Normal rhythm produces four entities – a P wave, a QRS complex, a T wave, and a U
wave – that each have a fairly unique pattern.
Aberration
3. AV node:
First-degree AV block
4. Right bundle
5. Left bundle
CHAPTER 6
SUMMARY
In this project we have made an ECG machine using an AD8232 ECG module and
Arduino Uno. The AD8232 is a low power low noise ECG module and can used with
any microcontroller. It consists of all the circuits and parts an ECG machine has in the
small chip. The input for the project is taken from electrodes placed at specific
positions on the chest. These sense the electrical activity of the heart. The signal these
electrodes pickup are then conveyed to the AD8232 module.
After receiving the signal the module does the amplification and all the pre-processing
required for the ECG signal to get rid of all the noises and problems which we have
seen in the previous chapters.
The resultant signal is then given to Arduino Uno MCU. The Arduino board is
programmed to then collect the data and transfer it to the computer via serial
communication. The final signal is seen using Serial Plotter which then gives a
voltage vs time continuous graph which is the required ECG.
Also in other code the Arduino is able to sense the signal and due some calculations
with it and then produce the beats per minute from the given ECG signal.
19
CHAPTER 7
CONCLUSION
The project can be used to provide heart related diagnosis in places where
it is hard to take the whole ECG machine as the whole project fits inside a
small box. Also using different software like Processing etc. The graphs
can be studied more correctly and processed nicely. The project is also
cost efficient as it took less than Rs. 1000 to create the project and the
result can also be taken directly in oscilloscope using a soundcard or by
using a computer as we have done.
Overall it is a low price, low power, space efficient and accurate ECG
system which can be used where its requirement lies.
20
CHAPTER 8
REFERENCES
Wikipedia contributors. "Heart." Wikipedia, The Free Encyclopedia. Wikipedia, The
Free Encyclopedia, 21 Oct. 2019. Web. 21 Oct. 2019.
Bryn Farnsworth,” What Is ECG and How Does It Work? ”. IMOTIONS, 15 Jan 2019
“Six Abnormal ECGs — Not All Are Cases of the Heart.” Medscape, 21 Oct 2019