Introduction: ECG Monitor
NOTICE: This is not a medical device. This is for educational purposes only using simulated signals. If using this circuit for real ECG measurements, please ensure the circuit and the circuit-to-instrument connections are utilizing proper isolation techniques.
Electrocardiography is the process of recording electrical signals generated by the heart of a patient to obtain information about the heart's activity. In order for the electrical signal to be captured effectively, it must be filtered and amplified through electrical components. The information must also be presented to a user in a clear and effective manner.
The following Instructable outlines how to build the amplification/filtering circuitry as well as a user interface. It involves building an instrumentation amplifier, a notch filter, a low pass filter, and a user interface in LabVIEW.
The first step in the process is to define the requirements of the analog circuit. After defining the requirements, decisions are made about what primary components will constitute the circuit. Later, smaller details are addressed concerning the characteristics of these major components, and finally the circuit design phase is concluded by defining the exact values of every resistor and capacitor in the circuit.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Defining Requirements and Primary Components
The circuit’s job is to amplify the ECG signal generated by the patient, and filter out all associated noise. The raw signal consists of a complex waveform with a maximum amplitude of roughly 2 mV and frequency components in the range of 100 Hz to 250 Hz in the QRS complex. This is the signal to be amplified and recorded.
On top of that signal of interest, noise is produced from several sources. Power supplies generate 60 Hz noise and patient movement produces artifacts in the range of less than 1 Hz. More high-frequency noise is introduced from background radiation and telecommunication signals such as cell phones and wireless internet. This collection of noise is the signal to be filtered.
The circuit must first amplify the raw signal. It then must filter out 60 Hz noise, and any other noise above 160 Hz. Filtering low-frequency noise associated with patient movement is deemed unnecessary, as the patient can simply be instructed to hold still.
Because the signal is measured as the difference in potential between two electrodes located on the patient, amplification is achieved through the use of an instrumentation amplifier. A simple difference amplifier could be used as well, but instrumentation amps often perform better in regards to noise rejection and tolerances. 60 Hz filtering is achieved through use of a notch filter, and the rest of the high frequency filtering is achieved through use of a low-pass filter. These three elements make up the entire analog circuit.
Knowing the three elements of the circuit, smaller details can be defined concerning gains, cutoff frequencies, and bandwidths of the components.
The instrumentation amp will be set to a gain of 670. This is large enough to record a small ECG signal, but also small enough to ensure that the op-amps behave within their linear range when testing the circuit with signals near 20 mV, as is the minimum on some function generators.
The notch filter will be centered on 60 Hz.
The low pass filter will have a cutoff frequency of 160 Hz. This should still capture the majority of the QRS complex and reject high-frequency background noise.
Step 2: Instrumentation Amplifier
The schematics above describe the instrumentation amplifier.
The amplifier has two stages. The first stage consists of the two op-amps on the left of the images above, and second stage consists of the single op-amp on the right. The gain of each of these can be modulated as one pleases, but we have decided to build it with a gain of 670 V/V. This can be achieved with the following resistance values:
R1: 100 Ohms
R2: 3300 Ohms
R3: 100 Ohms
R4: 1000 Ohms
Step 3: Notch Filter
The schematics above describe the notch filter. This is an active filter, so we could choose to make it amplify or attenuate a signal if we wanted, but we already achieved all amplification necessary, so we choose a gain of one for this op-amp. The Center frequency should be 60 Hz and the quality factor should be 8. This can be achieved with the following component values:
R1: 503 Ohms
R2: 128612 Ohms
R3: 503 Ohms
C: 0.33 microFarads
Step 4: Low Pass Filter
Again, this is an active filter, so we could choose any gain we want, but we will choose 1. This is accomplished by turning R4 above into a short circuit, and R3 into an open circuit. The rest is, as with the other components, achieved by using our previously defined requirements in combination with the equations governing the circuits to obtain individual element values:
R1: 12056 Ohms
R2: 19873.6 Ohms
C1: 0.047 microFarads
C2: 0.1 microFarads
Step 5: Design Full Circuit Virtually
Designing a circuit in a virtual circuit building software such as PSPICE can be very helpful in catching errors and solidifying plans before moving on to real analog circuit fabrication. At this point, one can capture AC sweeps of the circuit to ensure that everything behaves according to plan.
Step 6: Build Full Circuit
The circuit can be built in whatever way you like, but a breadboard was chosen for this case.
Assembly on a breadboard is recommended because it easier than soldering, but soldering would give more durability. Placing a 0.1 microFarad bypass capacitor to ground in parallel with the power source is also recommended, as this help eliminate unwanted deviations from constant power.
Step 7: LabVIEW User Interface
The LabVIEW user interface is a means of converting from analog signals to visual and numerical representations of the ECG signal that are easy for a user to interpret. A DAQ board is used to convert the signal from analog to digital, and the data is imported to LabVIEW.
The software is an object-based program that helps in data processing and interface creation. The data is first visually represented by the graph, and then some signal processing is performed in order to determine the frequency of the heartbeat so that it can be displayed next to the graph.
In order to determine heart rate frequency, one must detect heartbeats. This can be accomplished with Lab VIEW's peak detection object. The object outputs the indices of peaks in the received data array, which can then be used in calculations to determine the time that passes between heartbeats.
Because LabVIEW details would be an entire different Instructable, we'll leave the details to another source. The exact workings of the program can be seen in the block diagram presented above.
Step 8: LabVIEW Final User Interface
The final user interface displays an amplified, filtered, converted, and processed signal along with heart frequency readout in beats per minute