Introduction: ECG and Heart Rate Monitor
Electrocardiogram, also called an ECG, is a test that detects and records human heart’s electrical activity. It detects heart rate and the strength and timing of the electrical impulses passing through each part of a heart, which is able to identify heart problems such as heart attacks and arrhythmia. ECG's in hospitals involves twelve electrodes to the skin on chest, arms and legs. In this intractable, we are only using three electrodes, one for each wrist as two recording sites and one for right ankle as ground. It is important to note that 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.
To acquire and analyze a human ECG signal, we need a instrumentation amplifier that amplifies the input signal by 1000, a notch filter that removes alternating current noise (60 Hz) and a lowpass filter that filters other noises above 250 Hz. A 250Hz cut-off is used because the frequency range of a human ECG is between 0-250Hz
Step 1: Materials
Function generator, Power supply, Oscilloscope, Breadboard.
Resistors: 1k - 500k ohm
Capacitors: 20 - 100 nF
Operational amplifier x5 (UA741)
Step 2: Build the Instrumentation Amplifier
Referring to the circuit and the equations of the instrumentation amplifier. We first need to calculate the correct resistor values. Since the instrumentation amplifier has 2 stages there are two separate gains, k1 and k2. Since we need a gain of 1000, k1 multiply by k2 should be equal to a thousand. In this tutorial we used the following values, feel free to change these values if you don't have a wide range of resistors.
R1=1000Ω, R2=15000Ω hence, K1=1+(2*15000)/1000=31
R3=1000Ω, R4=32000Ωhence, K2=32000/1000=32
Now that you know what resistor values you need, go ahead and make the circuit.
To test the instrumentation amplifier, you could use a function generator to generate a sine wave with a known amplitude, connect it to the input of the circuit and connect the output of the amplifier to an oscilloscope, you should see a a sine wave with an amplitude a 1000 times bigger than the input sine wave
Step 3: Build Notch Filter
Similar to the instrumentation amplifier, refer to the circuit and equations to find the appropriate component values. We know that in this notch filter, we need to cut out frequencies of 60Hz therefore f0 is 60Hz, we are also going to use a quality factor of 8 which would give us a good accuracy. Using these values we can now find appropriate component values:
C=100 nF, Q = 8, w0=2ℼf =2*pi*60 =120pi
Now that you know the values of the components that you need go ahead and build the circuit. Not that you could use resistors in parallel or series in order to get values as close as possible to the values needed.
To test the notch filter, you could perform a frequency sweep. Input a sine wave with amplitude of 0.5V and vary the frequency. Look how the amplitude of the output that is connected to an oscilloscope changes when you get close to 60Hz. For example when you frequency is below 50 or above 70 you should see an output signal similar to the input but the closer you get to 60Hz the amplitude should decrease. If this doesn't happen check your circuit and make sure you used correct resistor values.
Step 4: Build Second Order Butterworth Filter
The type of lowpass filter we used is active second order. This filter is used because it gives us a good enough accuracy and although it requires power but the performance is better. The filter is designed to cut off frequencies above 250 Hz. This is because an ECG signal has different frequency component that is between zero and 250 Hz and any signal with a frequency of above 250 Hz would be considered as noise. The first image shows the schematic of the lowpass filter with all the correct resistor values.(Note that R7 should be 25632Ω instead of 4kΩ). The second image includes all the equations that you could use to calculate the component values yourself.
To test the lowpass Filter, use the function generator to generate a sine wave with an amplitude of 0.5V. When inputting frequencies below 250Hz, you should see an output similar to the input but the larger you get after 250Hz the output should get smaller and eventually become really close to zero.
Step 5: Put It All Together!
After you finished building the three stages, put them all together by putting instrumentation amplifier, followed by notch filter, and then lowpass filter. Your circuit should look similar to this image.
Step 6: Testing the Whole Circuit
Using a function generator, input an arbitrary ECG signal with an amplitude of no larger than 15mV to the input of the instrumentation amplifier. Connect the output of the low pass filter to an oscilloscope. You should get an output similar to this image. The green signal is the output of the board and the yellow signal is the input signal to the circuit. You could also measure the heart rate by acquiring the frequency using the oscilloscope and multiplying that number by 60.
Note that if you'd like to measure your own ECG signal you could do so by connecting the two input of the instrumentation amplifier to each one of your wrists using an electrode and grounding your leg. Just keep in mid before doing this ensure the circuit and the circuit-to-instrument connections are utilizing proper isolation techniques.