Electrocardiogram (ECG) Circuit: Instructables
Electrocardiogram (ECG) Circuit: Instructables
Electrocardiogram (ECG) Circuit: Instructables
by h_salaman
Note: This is not a medical device. This is for Many electrical devices are used to measure and
educational purposes only using simulated record biological activity in the human body. One
signals. If using this circuit for real ECG such device is the electrocardiogram, which
measurements, please ensure the circuit and the measures the electrical signals produced by the
circuit-to-instrument connections are utilizing heart. These signals give objective information about
proper isolation techniques. the structure and function of the heart. The ECG was
first developed in 1887 and gave physicians a new
We are two students in Biomedical Engineering and way to diagnose heart complications. ECGs can
after taking our first circuits class, we were quite detect heart rhythm, heart rate, heart attacks,
excited and decided to use the basics we learned to inadequate blood and oxygen supply to the heart, and
do something useful: display an ECG and read heart structural abnormalities. Using simple circuit design,
rate. This would be the most complex circuit we've an ECG can be made that could monitor all of these
built yet! things.
Basic materials needed to build the circuit are shown in pictures. They include:
Breadboard
Operational amplifiers
All op amps used in this circuit are LM741.
For more info, see the datasheet: http://www.ti.com/lit/ds/symlink/lm741.pdf
Resistors
Capacitors
Wires
Stick-on electrodes
These are only needed if you decide to try the circuit on a real person.
LabVIEW 2016
CircuitLab or PSpice for simulations to check values
Excel
This is highly recommended in case you need to change any characteristics of your
circuit. You may also need to play with the numbers until you find resistor and
capacitor values that are readily available. Pen-and-paper calculations discouraged for
this one! We have attached our spreadsheet calculations to give an idea.
DC Power supply
DAQ board to interface the circuit to LabVIEW
Function generator to test circuit
Oscilloscope to test circuit
5 2
3
We will use a notch filter to remove the 60 Hz noise present in all power supplies in the United States.
We will set the quality factor Q to be 8, which will provide an acceptable filtering output while keeping component
values in a feasible range. We also set the capacitor value to be 0.1 F so that calculations affect the resistors
only . The resistor values calculated and used can be seen in the table (in pictures) or below
Q = w/B
set Q to 8 (or choose your own based on your own need)
w = 2*pi*f
use f = 60 Hz
C
set to 0.1 uF (or choose your own value from available capacitors)
R1 = 1/(2*Q*w*C)
Calculate. Our value is 1.66 kohm
R2 = 2*Q/(w*C)
Calculate. Our value is 424.4 kohm
R3 = R1*R2/(R1+R2)
Calculate. Our value is 1.65 kohm
The notch filter should pass all frequencies unchanged except for those around 60 Hz. This can be checked with
an AC sweep. A filter with a gain of -20 dB at 60 Hz is considered good. You can simulate this in PSpice or
CircuitLab, or test the physical device, or both!
This kind of notch filter may generate a good notch in the simulated AC sweep, but a physical test showed that our
original values generated a notch at a lower frequency than intended. To fix this, we bumped up R2 by about 25
kohm.
The oscilloscope image shows the filter greatly reduces the input signal magnitude at 60 Hz. The graph shows an
AC sweep for a high quality notch filter.
The last stage of the device is an active low-pass filter. The ECG signal is made of many different waveforms,
which each have their own frequency. We want to capture all these, without any high-frequency noise. The
standard cutoff frequency for ECG monitors of 150 Hz is selected. (Higher cutoffs are sometimes chosen to
monitor for specific heart problems, but for our project, we will use a normal cutoff.)
If you would like to make a simpler circuit, you could also use a passive low-pass filter. This will not include an op
amp, and will consist of just a resistor in series with a capacitor. The output voltage will be measured across the
capacitor.
We will design it as a Second order Butterworth filter, which has coefficients a and b equal to 1.414214 and 1,
respectively. Setting the gain to 1 makes the operational amplifier into a voltage follower. The equations and
values chosen are shown in the table (in pictures) and below.
w=2*pi*f
set f = 150 Hz
C2 = 10/f
Calculate. Our value is 0.067 uF
C1 <= C2*(a^2)/(4b)
Calculate. Our value is 0.033 uF
R1 = 2/(w*(aC2+sqrt(a^2*C2^2-4b*C1*C2)))
Calculate. Our value is 18.836 kohm
R2 = 1/(b*C1*C2*R1*w^2)
Calculate. Our value is 26.634 kohm
The filter should pass frequencies below the cutoff unchanged. This can be tested using an AC sweep. You can
simulate this in PSpice or CircuitLab, or test the physical device, or both!
The oscilloscope image shows the filter's response at 100 Hz, 150 Hz, and 155 Hz. Our physical circuit had a
cutoff closer to 155 Hz, shown by the -3 dB ratio.
The high-pass filter is used so that frequencies below a certain cut-off value are not recorded, allowing a clean
signal to be passed through. The cut-off frequency is chosen to be 0.5 Hz (a standard value for ECG monitors).
The resistor and capacitor values needed to achieve this are seen below. Our actual resistance used was 318.2
kohm.
R = 1/(2*pi*f*C)
set f = 0.5 Hz, and C = 1 uF
Calculate R. Our value is 318.310 kohm
The filter should pass frequencies above the cutoff unchanged. This can be tested using an AC sweep. You can
simulate this in PSpice or CircuitLab, or test the physical device, or both!
The flowchart lays out the design concept of the is set to take continuous samples at a rate of 1 kHz,
LabVIEW portion of the project which records the with the number of samples changed between 3,000
signal at a high sampling rate and displays the heart and 5,000 samples for peak detection and signal
rate (BPM) and ECG. Our LabView circuit contains clarity purposes.
the following components: DAQ assistant, index
array, arithmetic operators, peak detection, numerical Mouse over the different components in the circuit
indicators, waveform graph, change in time, max/min diagram to read where in LabVIEW to find them!
identifier, and number constants. The DAQ assistant
2
1 6
3 9
4 5 7
Now that the circuit has been assembled, data can be If you choose to test the device on a human be sure
collected to see if it works! Send a simulated ECG the power supply you are using for the op amps limits
through the circuit at 1 Hz. The result should be a the current at 0.015 mA! There are several
clean ECG signal where the QRS complex, P wave, acceptable lead configurations but we chose to place
and T wave can be clearly seen. The heart rate the positive electrode on the left ankle, the negative
should also be displaying 60 beats per minute (bpm). electrode on the right wrist, and the ground electrode
To further test the circuit and the LabVIEW setup, on the right ankle as seen in the attached picture.
change the frequency to 1.5 Hz and 0.5 Hz. The heart
rate should change to be 90 bpm and 30 bpm Using some basic circuitry concepts and our
respectively. knowledge of the human heart we have shown you
how to create a fun and useful device. We hope
For slower heart rates to accurately be displayed you you've enjoyed our tutorial!
may need to adjust the DAQ settings to show more
waves per graph. This can be done by increasing the
number of samples.