by Electrocardiogram (ECG) Circuit
An ECG measures the electrical activity of the heart using electrodes placed on the skin. ECGs are ubiquitous devices for physicians and are useful in capturing abnormal heart rhythms or diagnosing heart failure. This project aims to build a simple electrocardiogram (ECG) circuit from basic electronics components. The circuit amplifies electrical signals from the heart and processes the signal to remove noise.
Tools and Materials
- Breadboard (large enough for full ECG circuit) [PB505 board recommended]
- *3M Red Dot ECG electrodes - Pack of 50
- 3 crocodile clip wires to attach to the electrodes
- Resistors: 500Ω, 1kΩ, 15kΩ, 33kΩ, 1.5kΩ, 150Ω, 400kΩ, 20kΩ, 5kΩ, 60kΩ, 300kΩ
- 5kΩ Potentiometer (Variable resistors)
- Variable Resistor box
- Capacitors: 100nF, 22nF, 1µF
- Five general purpose LM741 or UA741 op-amps
- DC voltage supply capable of supplying +15V and -15V
- Function generator for diagnostic purposes
- A plethora of wires
Building the differential amplifier circuit.
The differential amplifier will amplify the low voltage signals carried by the electrodes. Electrical heart signals are on the order of 1mV. Build the circuit in Fig. 1 using either UA741 or LM741 op-amps. These op-amps are powered with +15V and -15V voltages on pins 7 and 4 respectively. Check the datasheet for your op-amp to figure out the appropriate pins. Op-amps powered by +5V/-5V can also be used, however these will produce ECG signals with low gain and thus more noise. Use a resistor box for Rgain initially to choose your gain. Then replace it with the chosen Rgain value. Gain of the circuit is calculated by equation in Fig. 2. For the ECG you want a gain of at least 500. I’ve found that a Rgain of 500Ω will give you a gain of 2000 which is ideal. If not using a PB505 board, use DC voltage supply to power op-amps.
Test the differential amplifier circuit.
To test the differential amplifier, connect input pin for electrode 1 to ground and input pin for electrode 2 to a function generator. Change Rgain to be very high (100kΩ) and drive a 100mV sine wave of 100 Hz using the function generator. Increasing Rgain will decrease the gain as the function generator cannot produce very low voltage signals, and we do not want to saturate the op-amps. Analyze the output signal on the oscilloscope. Measure the gain of your output signal and compare the theoretical gain using the equation in Fig. 2.
Build a 60Hz notch filter.
All power lines in buildings in the US have a 60Hz background signal. This can pollute our ECG signal. A notch filter attenuates (i.e., reduced amplitude) specific frequencies and all others unchanged. This step is the most time-consuming step. Build the circuit in Fig. 3. For a capacitance of 200nF for C2, use two capacitors of 100nF each that are in parallel with each other. Use the variable resistor box for R6. In theory, R6 = R4 = 1650Ω and R5 = 424.5kΩ will give you the 60Hz notch filter. Practically however, you will need to change R6 to find the resistance for which a 60Hz signal is maximally attenuated. Fig. 4 shows a simulation using circuitlab.com of the circuit in Fig. 3. Here we see that only at 60 Hz there is a sharp decrease in output voltage in comparison to input voltage.
Determine value of R6 and test the 60 Hz notch filter.
Drive a 7.5V pk-pk 60Hz sine wave signal using the function generator through the Notch Filter circuit only. View both the input and the output on an oscilloscope. For R6 values ranging from 1.65kΩ to 3kΩ, measure the attenuation (Vout/Vin). Determine a crude estimate of the R6 value for which the attenuation is maximized. Switch the variable resistor box with a 5kΩ potentiometer. Vary the resistance between one end and the middle pin of the potentiometer close to the crudely estimated value of R6. Set the resistor of the potentiometer such that the 60Hz sine wave through the Notch Filter is maximally attenuated. It is important that your notch filter attenuates 60Hz (63Hz or 57Hz will not cut it!). After picking the resistor value, your oscilloscope view should look like Fig. 5.
Build Low pass filter.
A low pass filter will filter out high frequencies in the environment that could pollute the sensitive ECG signal. The low pass filter sets a cutoff frequency of about 80Hz. While heart beats have a frequency of ~1 to 3 Hz, the individual waveforms that make up the ECG signal have a higher frequency of about 1 to 50Hz. Unlike the notch filter, you do not need to get the low pass filter to cut off at exactly 80Hz. Build the circuit in Fig. 6. This step should be straightforward.
Test Low pass filter.
Test the low pass filter built as in Fig. 6. Drive a 10Hz sine wave through the low pass filter only and observe both the input and output on the oscilloscope. The output should not be attenuated. Your signal should look like Fig. 7 (CH1 is the output, CH2 is the input). Now drive a 130Hz sine wave through the filter. Observe the output on the oscilloscope. The sine wave should be attenuated by about ½, as seen in Fig. 7 (CH1 is the output, CH2 is the input).
Build High Pass filter
A high pass filter will ensure that very low frequency signals do not pollute the ECG signal. It will remove any low-level noise in the environment. The high pass filter shown in Fig. 8 has a cutoff frequency of 0.5 Hz. Remember that heart beats have a frequency of 1 to 3Hz, so this will not affect the actual electrical signal from the heart.
Bring it all together
Couple all the circuits built using the functional block diagram in Fig. 9. The differential amplifier output will be the input for the notch filter. The notch filter output will be the input for the low pass filter and the output of the low pass filter will be the input of the high pass filter. The final output should be sent to an oscilloscope for viewing.
Three electrodes will be needed. Using wires and crocodile clips, attach 2 of the skin electrodes to the circuit as seen in Fig. 1. Connect one to each wrist, exactly below where the palm starts to ensure proximity to a major artery. The third electrode must be connected to the right leg and to ground. The ground electrode is crucial to obtain the ECG signal.