biomedical instrumentation lab

profilegansare
lab5.zip

lab5/LAB5.docx

LAB #1: USE OF INSTRUMENTS .........................................................................................................1-1

LAB #2: BASIC CIRCUITS DEVELOPMENT.....................................................................................1-1

LAB #3: LABVIEW PROGRAMMING .................................................................................................1-1

LAB #4: ECG AMPLIFIER – PART I....................................................................................................4-1

LAB #5: ECG AMPLIFIER – PART II...................................................................................................5-1 5.1. *GOAL(S) OF THIS LAB .....................................................................................................................5-1

5.1.1. Students to Do and Learn.........................................................................................................5-1 5.1.2. TA(s) to Do...............................................................................................................................5-1 5.2. PRINCIPLE OF CIRCUITS.....................................................................................................................5-2

5.2.1. Circuit Diagram.......................................................................................................................5-2 5.2.2. Low-Pass Filter (First Order)..................................................................................................5-3 5.2.3. **Gain of the Circuit................................................................................................................5-5

5.3. **SCHEMATICS OF CIRCUITS.............................................................................................................5-6 5.4. SIMULATION OF CIRCUITS.................................................................................................................5-7

5.4.1. **Including Capacitors C1 and C2..........................................................................................5-7 5.4.2. **Remove Capacitors C1 and C2 ............................................................................................5-9 5.4.3. **Simulation of Low-Pass Filter............................................................................................5-10

5.5. CONSTRUCTION OF CIRCUITS..........................................................................................................5-11

5.5.1. Start with the Circuits Saved from Labs #2 and #4................................................................5-11 5.5.2. Insert Low-Pass Filter............................................................................................................5-13 5.5.3. A Sample Circuit ....................................................................................................................5-13 5.6. TESTS OF CIRCUITS WITH FUNCTION GENERATOR ..........................................................................5-14

5.6.1. Sine Wave (100 Hz, 20 mVpp)................................................................................................5-15 5.6.1.1. Connect to Power Supply................................................................................................................ 5-15

5.6.1.2. Connect To Function Generator...................................................................................................... 5-16

5.6.1.3. Connect to Oscilloscope.................................................................................................................. 5-19

5.6.1.4. Setup Function Generator ............................................................................................................... 5-21

5.6.1.5. Setup Power Supply........................................................................................................................ 5-22 5.6.1.6. **Setup Oscilloscope and Display Sine Wave Signal..................................................................... 5-22

5.6.2. Pseudo ECG Signal (1 Hz, 20 mVpp).....................................................................................5-23

5.6.2.1. Setup Function Generator ............................................................................................................... 5-23 5.6.2.2. **Setup Oscilloscope and Display Pseudo ECG Signal ................................................................. 5-23

5.6.3. Turn off Function Generator and Disconnect Cables ............................................................5-24

5.7. TEST OF CIRCUITS ON HUMAN ECG SIGNAL...................................................................................5-24

5.7.1. Notes.......................................................................................................................................5-24 5.7.2. **Setup for Test......................................................................................................................5-25 5.7.3. Recover Differential Setting ...................................................................................................5-26 5.7.4. Attach Cables to Circuit.........................................................................................................5-26 5.7.5. Connect to Electrodes.............................................................................................................5-29

5.7.6. Enable Output of Power Supplies...........................................................................................5-30

5.7.7. **Setup Oscilloscope and Display ECG Signal.....................................................................5-30 5.8. PROCESS HUMAN ECG SIGNAL WITH LABVIEW.............................................................................5-30 5.8.1. Using LabView Saved in Lab #3.............................................................................................5-31

5.8.1.1. Connect the Output of Circuit to NI USB-6009 Device.................................................................. 5-31 5.8.1.2. Connect to Electrodes ..................................................................................................................... 5-33 5.8.1.3. **Results of Processing ECG Signals............................................................................................. 5-33

5.8.2. Further Studies.......................................................................................................................5-35

5.8.2.1. **Study Polarity of ECG Signal ..................................................................................................... 5-35

5.8.2.2. **Study Effects of Cut-Off Frequencies of Low-Pass Filter in LabView....................................... 5-36

5.8.2.3. **Study Order of Low-Pass Filter in LabView Program................................................................ 5-36 5.8.2.4. **Study Effects of Cut-Off Frequencies of Band-Stop Filter in LabView...................................... 5-37 5.9. SAVE YOUR WORK .........................................................................................................................5-37

5.9.1. *Save Files with winSCP........................................................................................................5-37 5.9.2. *Save Your Constructed Circuits ...........................................................................................5-38 5.10. TURN OFF AND DISCONNECT EQUIPMENT .....................................................................................5-38

ii

Lab #5: ECG Amplifier – Part II

5.1. *Goal(s) of This Lab

5.1.1. Students to Do and Learn

1. This is the second part of an electrocardiogram (ECG) system. The goals of this lab is to: (i) produce schematic of the completed ECG circuit by inserting a low-pass filter between the circuits built in Labs #2 and #4, (ii) simulate the circuit, (iii) construct the circuit on the breadboard, (iv) test the circuit with signals from a function generator, (v) test the circuit with a human ECG signal, (vi) process the ECG signals with LabView program that you have developed in Lab #3, and (vii) study influences of filter and other parameters on ECG signals.

1. Save your schematics as both native MultiSim files and .jpg files.

1. Save your simulation results as .jpg files.

1. Save your computer captured oscilloscope files (test results with both sine wave and the ECG signals from function generator and human body) as .png files.

1. Save your LabView processed results as .jpg files.

5.1.2. TA(s) to Do

1. TA(s) (Task #1): Do Lab First: TAs should complete the same lab before students start their labs so that TAs can anticipate the questions from the students and can help students better.

1. TA(s) (Task #2): Guidance at Beginning of Lab: TAs should give a brief guide to students at the beginning of each lab to address lab specific issues such as identifying cables and their leads, and others.

1. TA(s) (Task #3): Clean Up Files: TAs should make sure students have copied their saved files and then deleted the copied files from the computers before they leave the lab. Any files saved by students but have not been deleted after students leave should be deleted by TAs if students could not delete them for some reason. This is important to avoid confusing different groups of students and clustering the computers.

1. TA(s) (Task #4): Check Student Files: TAs should check all the signals (sine wave, pseudo ECG signals, ECG signals from human body, and ECG signals processed with LabView program) saved to files by students. If there are some problems with the files, students may need to make corrections.

1. TA(s) (Task #5): Check Circuits: TAs should check the neatness of the circuit constructed.

5.2. Principle of Circuits

5.2.1. Circuit Diagram

1. The following is the circuit diagram of a complete ECG circuit. The circuits from Labs #2 and Lab #4 are reused. The new circuit to be inserted between the circuits of Labs #4 and #2 is a low-pass filter. A low-pass filter allows low-frequency components of a signal to pass while removing high-frequency components. This is opposite to the high-pass filters in Lab #4.

1. Please notice that the value of Resistor R1 is changed from 220 Ohm to 1.5k Ohm and the value of the potentiometer R11 is adjusted to its maximum (i.e., 100% or 20k Ohm):

5.2.2. Low-Pass Filter (First Order)

1. The circuit diagram of the low-pass filter with a cut-off frequency of about is

3

6

83

1

1

Hz

106

)

2

2

(1.510)

(1.010

c

f

RC

π

π

=

=

×

×

×

×

shown below (the input impedance of the next stage of the amplifier is ignored for simplicity). The order of this filter is 1. As mentioned in Lab #3, a filter of a high order will be complicated when realized with electronic components and may distort signals, although an ideal filter should have an infinitely high order.

1. The reason why the low-pass filter can remove high-frequency components is as follows: As the frequency of the signal applied to the input of the filter (Vin_LP) is increased, the impedance of Capacitor C3 is decreased. Since the value of Resistor R8 is fixed and is independent of frequencies, the output voltage (Vout_LP) of the filter becomes smaller and smaller as the frequency increases. At very high frequency, the output is shorted to the ground and the output voltage is zero because the impedance of the capacitor becomes zero.

1. Derivation of cut-off frequency of the low-pass filter: The cut-off frequency of the low-pass filter is defined as the frequency, fc , at which the magnitude of the output signal becomes 1 of that of the input signal. I.e., , or

2

8 3

1

1

1

2

c

j

R C

ω

=

+

3

8

3

1

1

1

2

c

c

j

C

R

j

C

ω

ω

=

+

, or 1 = 1 , or 1 (+ ωcR C8 3)2 =2, or (ωcR C8 3)2 =1,

1 (+ ωcR C8 3)2 2

fc = 1

R8 3C

or ωcRC8 3 =1, or ω πc =2 fc = 1 , or above.

R8 3C

5.2.3. **Gain of the Circuit

• D5.001. (i) Derive the formula for the maximum gain of the entire ECG circuit above. I.e., Gain=Vout/(Vin_1-Vin_2). The maximum gain is obtained when Capacitors C1 and C2 that form the high-pass filters and Capacitor C3 and Resistor R8 that form the low-pass filter are removed (see figure below). (ii) Calculate the gain at frequency of 100 Hz for the ECG circuit above (including C1, C2, C3, and R8). Since the cut-off frequency of the low-pass filter is 100 Hz, the gain at this

. (iii) Save your formula for the maximum gain and the calculated gain at 100 Hz above for your report.

frequency should be the maximum gain multiplied by

1

0.707

2

5.3. **Schematics of Circuits

• D5.002. (i) Produce the schematic of the complete ECG circuit in Section 5.2 above with MultiSim (see Section 2.3 of Lab #2 if you have forgotten how to make schematics). To save time, you could copy the circuit diagrams of Lab #2 and #4 first and then modify from what you have copied. Notice that the value of Resistor R1 is changed to 1.5k Ohm and the value of the potentiometer R11 is adjusted to its maximum or 100% at 20k Ohm. (ii) Click “File” -> “Save” on MultiSim to save the schematic to a file named “d5.002.ms13”. (This file is needed whenever you want to modify the circuit.) (iii) Save your circuit diagram using the screen capture with the Print Screen key (or Alt + Print Screen) on the keyboard and the MS Photo Editor into .jpg format with the file name, d5.002.jpg, for your report. (The .jpg format allows you to handle the file and insert the image into your report without needing to use the lab computers.) (The Microsoft Photo Editor was introduced in the classnote of Lab #1 and the method to use it to save computer screen images is in Section 2.3 of the classnote of Lab #2.)

5.4. Simulation of Circuits

5.4.1. **Including Capacitors C1 and C2

1. D5.003. (i) Connect Vin_1 and Vin_2 to a signal source (shown in the dotted box below with a resistor R12 that is used to avoid common mode noise) as in the following figure. (ii) Set up the same parameters for AC analyses as you have done for circuit simulation in Lab #2, with an expression of V(vout)/(V(vin_1)V(vin_2)) for the overall gain of the circuit, and then do simulation. (iii) Compare the gain between what you calculated above and what you obtained from the simulation at frequency of 100 Hz. (iv) Save your schematic of the circuit and simulation result as .jpg files with the Microsoft Photo Editor in the procedure described above for your report.

1. The following is the simulation result:

5.4.2. **Remove Capacitors C1 and C2

• D5.004. (i) Remove Capacitors C1 and C2 in the circuit (replace them with wires in the schematic) as in the figure below, and then repeat the simulation above. (ii) Save your schematic of the circuit and simulation result as .jpg files with the Microsoft Photo Editor in the procedure described above for your report.

5.4.3. **Simulation of Low-Pass Filter

• D5.005. (i) Use the schematic above and set up the same parameters for AC analyses as you have done for circuit simulation in Lab #2, with an expression of

V(vout_lp)/V(vin_lp) for the gain of the low-pass filter, and then do simulation. (ii) Save your simulation result as a .jpg file with the Microsoft Photo Editor in the procedure described above for your report. (iii) What are the differences and similarities of the frequency response (AC analyses) of the magnitude of the gains between the low-pass filter and the circuit above where both Capacitors C1 and C2 are removed?

5.5. Construction of Circuits

1. Important: Understand Circuit Diagram and Wiring: Please make sure that you understand how the breadboard is pre-wired (there are hidden wires underneath the holes of the breadboard) according to the explanations in Section 1.3 of Lab #1. Please also check the entire circuit (taking into account the hidden wires) with the schematic in Section 5.2 after you have completed the construction of the circuit to make sure that your connections are correct.

1. Important: Purposely Blurring of Figures: The figures/photos below for circuit construction are for illustration purpose only and the steps described, if there are any, are to specify where the main components of the circuit should be located to leave room for other circuits to be inserted in future labs and make the circuit neat for easier troubleshooting. The resolution of figures is purposely made low to keep the file size of the classnotes small and allow students to learn how to wire the circuit using the circuit diagram, instead of mechanically following the figures to wire without understanding the circuit. Multiple ways of electrical connections are permissible as long as they result in a correct circuit. You must check the correctness of the circuit before you start to test it.

5.5.1. Start with the Circuits Saved from Labs #2 and #4

1. Make sure that R1 of Lab #4 is changed from 220 Ohm to 1.5k Ohm.

1. Make sure that Potentiometer R11 of Lab #2 is adjusted to its maximum value, i.e., 20k Ohm.

1. Remove the output (Pin #6 of U3) and input (Pin #3 of U4) signal wires of circuits built in Labs #4 and #2, respectively, to prepare for adding the low-pass filter:

5.5.2. Insert Low-Pass Filter

• The low-pass filter in Section 5.2 above should be inserted between the two amplifier circuits that you have built in Labs #2 and #4 respectively to reduce noise before signals from the circuit are digitized. The low-pass filter consists of one 1.5k Ohm resistor (R8) and 1uF capacitor (C3).

5.5.3. A Sample Circuit

• The following is an example of completed circuit with 4 operational amplifiers and one low-pass filter to give you a general idea of where the components are placed. The figure may be purposely blurred so that you have an opportunity to learn how to wire the circuit. Please check your constructed circuit against the schematics in Section 5.2 above to make sure that the connections are correct. Please take into account the hidden connections of the breadboard explained in Section 1.3 of Lab #1.

5.6. Tests of Circuits with Function Generator

1. Ground the input (Pin #3 of the operational amplifier U2) to make the circuit to have only one input for testing with signals from the function generator.

1. Adjust the potentiometer to its maximum value of 20k Ohm if you have not already done so (clockwise turn of the screw driver increases the value).

1. Note: Make sure that the value of the potentiometer in the circuit of Lab #2 is always set to be larger than about 3k Ohm to avoid oscillations that may create noise and make the circuit in this lab malfunction.

5.6.1. Sine Wave (100 Hz, 20 mVpp)

5.6.1.1. Connect to Power Supply

1. Connect the yellow banana-plug-to-banana-plug cable to the post of negative voltage group (variable from 0 to -25V) of the power supply:

1. Connect the blue banana-plug-to-banana-plug cable to the ground (GND) post of the power supply:

1. Connect the red banana-plug-to-banana-plug cable to the post of positive voltage group (variable from 0 to +25V) of the power supply:

5.6.1.2. Connect To Function Generator

1. Attach a BNC-to-alligator-clips cable to the output of the function generator:

1. Attach the black alligator clip of the BNC-to-alligator-clips cable to the ground (green jump wire) of the circuit board:

1. Attach the red alligator clip of the BNC-to-alligator-clips cable to the yellow jump wire that is one (Pin #3 of operational amplifier U1) of the inputs of the ECG amplifier (as instructed above, the other input should be connected to the ground):

1. Connect one end of a BNC-to-BNC cable to the function generator:

5.6.1.3. Connect to Oscilloscope

1. Connect the other end of the BNC-to-BNC cable to Channel #1 (CH 1) of the oscilloscope:

1. Connect a BNC-to-alligator-clips cable to Channel #2 (CH 2) of the oscilloscope:

1. Attach the black alligator clip of the BNC-to-alligator-clips cable to the ground (green jump wire) of the circuit board:

1. Attach the red alligator clip of the BNC-to-alligator-clips cable to the yellow jump wire that is the output (Pin #6 of operational amplifier U4) of the ECG amplifier:

5.6.1.4. Setup Function Generator

1. Important: Please notice that in our labs, the direct current (DC) offset of the function generator must be set to zero if this has not already been done. If this is neglected and your function generator has a DC offset that is not zero, the measurements and results of this and future labs will not be correct and it may take a lot of time to troubleshoot to find out this problem. (Notice that when you turn on the function generator, the option “Offset” will be shown on the display.) For safe, you should check at the beginning of each lab to ensure that the offset is set to 0 to avoid problems in case senior design students use the equipment while the labs are not in session.

1. Produce 100 Hz, 20 mVpp sine wave with the function generator. The output of the function generator should be set to the “High Z” mode. (Please follow Section 1.5 “Use of Function Generator” in the classnote of Lab #1 for steps of set up if you forget how to do this.)

5.6.1.5. Setup Power Supply

1. Please make sure that the green (ground) wires on the power supply and bread board are not losing each time you use the power supply for any of your labs. This is important since losing ground will make your circuit not to work and it may be difficult for you to figure out what goes wrong.

1. Set the voltages of the power supply to +/- 15V and set the current limit to 35 mA (or 0.035 A) for both positive and negative powers to reduce the risk of burning out the breadboard or circuit components. (Please follow Section 1.6 “Use of Power Supply” in the classnote of Lab #1 for steps of set up if you forget how to do this.)

5.6.1.6. **Setup Oscilloscope and Display Sine Wave Signal

1. Display the sine waves produced on both channels of the oscilloscope. If the circuit does not work, you should troubleshoot each operational amplifier stage to find loose connections, shorts, or misconnections by checking their output signals successively with the oscilloscope.

1. D5.006. (i) Setup the oscilloscope and measure the “Peak-toPeak” amplitudes of the input (Channel #1) and output (Channel #2) waveforms of the circuit with the oscilloscope. (The “Quick Meas” button and then “Select Source” in the menu allow you to display the results of selected channel.) (ii) If the sine wavefrom the output of the circuit is distorted on the top and bottom because the gain is too high, temporarily change the voltages of the power supply to +/-17V (do not adjust the voltage higher than these values since the OpAmps may be burnt out). (iii) Compare the measured gain of the amplifier at frequency of 100 Hz with that calculated theoretically in Section 5.2 above (R1=1.5k Ohm, R3=10k Ohm, R5=10k Ohm, R7=100k Ohm, R8=1.5k Ohm, C3=1uF, R10=1.5k Ohm, and R11=20k Ohm). (iv) Save the waveforms along with displayed amplitudes to the computer desktop with IntuiLink in the .png file format for your report. (Please follow Section 1.4 “Use of Oscilloscope” in the classnote of Lab #1 for steps of set up if you forget how to do this. The steps to save oscilloscope screen with IntuiLink are given in Section 1.3 “Information” of Lab #1.)

1. Set the voltage of the power supply back to +/-15V if you have changed them to +/-17V above.

5.6.2. Pseudo ECG Signal (1 Hz, 20 mVpp)

5.6.2.1. Setup Function Generator

• Produce 1 Hz and 20 mVpp pseudo ECG signal with the function generator. The output of the function generator should be set to the “High Z” mode. Make sure the DC Offset is set to zero. (Please follow Section 1.5 “Use of Function Generator” in the classnote of Lab #1 for steps of set up if you forget how to do this.)

5.6.2.2. **Setup Oscilloscope and Display Pseudo ECG Signal

1. Display the pseudo ECG signal produced on both channels of the oscilloscope.

1. D5.007. (i) Setup the oscilloscope in “Roll” mode and measure the “Peak-to-Peak” amplitudes of the input (Channel #1) and output (Channel #2) pseudo ECG waveforms of the circuit with the oscilloscope. (The “Quick Meas” button and then “Select Source” in the menu allow you to display the results of selected channel.) (ii) Compare the measured gain of the amplifier with the maximum gain calculated theoretically in Section 5.2 above (R1=1.5k Ohm, R3=10k Ohm, R5=10k Ohm, R7=100k Ohm, R8=1.5k Ohm, and R11=20k Ohm). (iii) Save the waveforms along with displayed amplitudes to the computer desktop with IntuiLink in the .png file format for your report. (iv) Explain why the gain measured does not reach the maximum gain of the circuit and why the shapes of the input and output waveforms are different. (Please follow Section 1.4 “Use of Oscilloscope” in the classnote of Lab #1 for steps of set up if you forget how to do this. The steps to save oscilloscope screen with IntuiLink are given in Section 1.3 “Information” of Lab #1.)

5.6.3. Turn off Function Generator and Disconnect Cables

• Disable (not to power off) the output of the power supply by pushing the “Output On/Off” button and turn off the function generator. Remove the BNC-to-BNC cable and remove the BNC-to-alligator-clips cable that connects between the function generator and Channel #1 of the oscilloscope.

5.7. Test of Circuits on Human ECG Signal

5.7.1. Notes

1. Note #1: Connection of ECG Electrodes: ECG electrodes are important for making electrical connections between human body and the amplifier circuits. The quality of these electrodes will have a strong influence on the quality of ECG signals that you can get. When the electrical coupling between the electrodes and the body is not good, the signals may be buried in noise.

1. Note #2: Working on Human ECG Signals: If your circuit works fine with signals from the function generator but you get excessive noise that prevents you from continuing the experiment when you measure ECG signals from the human body, you should suspect that your electrodes may be dried out (this may happen if the electrodes are left out of a sealed enclosure for a few days) and do not make good electrical connections.

1. Note #3: Excessively High Frequency Displayed: If your oscilloscope displays a frequency that is much higher than your actual heart beating rate when you measure the ECG signals from human body, the frequency displayed is likely to be that of the noise, which is random.

1. Note #4: Movement of Body: In addition, the movement of human body will produce irregular ECG signals that cannot be used for medical diagnoses. Therefore, please stand or sit still when acquiring the ECG signals.

1. Note #5: Need a High Gain: ECG signals are generally weak and thus needs to be amplified more than 1000 folds by electrical circuits to reach an amplitude in the range of volts.

5.7.2. **Setup for Test

1. D5.008. (i) Change Resistor R1 from 1.5k Ohm to 220 Ohm as shown in the circuit diagram in Section 5.2 to increase gain. Put the 1.5k Ohm resistor back to the correct drawer to avoid the resistor being mislabeled. (ii) Adjust the potentiometer value to its maximum of 20k Ohm if you have not already done so. (iii) Calculate the maximum gain (theoretical) of the circuit in Section 5.2 with R1 changed to 220 Ohm to get an idea how high the maximum gain of this amplifier is.

1. Place ECG electrodes on the inner wrists of the left and right hands respectively, and place an ECG electrode on the inner ankle of the left foot, as in Section 4.10 of Lab #4.

5.7.3. Recover Differential Setting

• Recover the differential setting of the amplifier by disconnecting the grounded input (Pin #3 of operational amplifier U2) from the ground to prepare the circuit for testing on human ECG signal:

5.7.4. Attach Cables to Circuit

1. Attach a red alligator-clip-to-alligator-clip cable to one of the inputs (Pin #3 of the operational amplifier U1) of the amplifier circuit:

1. Attach a yellow alligator-clip-to-alligator-clip cable to the other input (Pin #3 of the operational amplifier U2) of the amplifier circuit:

1. Attach a black alligator-clip-to-alligator-clip cable to the ground (GND) of the amplifier circuit:

1. Extend the length of the ground (GND) cable with another black alligator-clip-to-alligator-clip cable:

5.7.5. Connect to Electrodes

• Connect the other ends of the red and yellow alligator-clip-toalligator-clip cables to the ECG electrodes on the inner wrist of the left and right hands, respectively. Attach the other end of the extended black alligator-clip-to-alligator-clip cable to the ECG electrode on the inner ankle of the left foot:

5.7.6. Enable Output of Power Supplies

• Enable the output of the power supply by pushing the “Output On/Off” button:

5.7.7. **Setup Oscilloscope and Display ECG Signal

• D5.009. (i) Setup the oscilloscope in “Roll” mode to display and measure the “Peak-to-Peak” amplitude of the ECG signal (Channel #2). Turn off Channel #1 display of the oscilloscope by pushing the Channel #1 display light since it is not used. (ii) Adjust the scale of the waveform on the oscilloscope for a proper display by turning the knob of Channel #2 as necessary. (iii) Save the waveform along with displayed amplitude to the computer desktop with IntuiLink in the .png file format for your report. (iv) From the peak-to-peak output voltage measured, what would the peak-to-peak input voltage be using the maximum gain of the amplifier calculated with R1 = 220 Ohm? (Please follow Section 1.4 “Use of Oscilloscope” in the classnote of Lab #1 for steps of set up if you forget how to do this. The steps to save oscilloscope screen with IntuiLink are given in Section 1.3 “Information” of Lab #1.)

5.8. Process Human ECG Signal with LabView

1. Adjust the potentiometer to its maximum value (20k Ohm) if it has not already been done.

1. In Lab #3, you have set the limits of the input voltages to +/10Vp (here “p” means peak) for the digitizer NI USB-6009. To avoid saturation or out of range error of the digitizer, adjust the potentiometer in the circuit to make sure that the signal inputting to the digitizer is within the limits. Since the ECG signal may have different positive and negative peak values, you need to ensure both peaks are smaller than 10Vp. Please notice that the true ECG signal is obtained after you remain still for a while (i.e., when you move, you may get an excessively large signal but that is not a true ECG signal).

5.8.1. Using LabView Saved in Lab #3

5.8.1.1. Connect the Output of Circuit to NI USB-6009 Device

1. Connect the output of the ECG amplifier circuit (Pin #6 of the operational amplifier U4) to the NI USB-6009 digitizing device with a yellow alligator-clip-to-alligator-clip cable:

1. Connect the other end of the yellow alligator-clip-to-alligatorclip cable to the input wire (yellow) of the NI USB-6009 device:

1. Connect the ground (GND) of the ECG amplifier circuit to the NI USB-6009 digitizing device with a black alligator-clip-toalligator-clip cable:

1. Connect the other end of the black alligator-clip-to-alligatorclip cable to the ground (GND) wire (green) of the NI USB6009 device:

5.8.1.2. Connect to Electrodes

• Connect the alligator-to-alligator clips to the hands and the leg of the human body as in Section 5.7 above:

5.8.1.3. **Results of Processing ECG Signals

1. Open the LabView program (the one with a heart rate warning LED and with a .vi file extension) that you developed in Lab #3 by double clicking on the file with your left mouse button and show the front panel by clicking “Windows” -> “Front Panel” after opening the file:

1. Click on the thick arrow “Run” button on the upper-left corner of the front panel to run the program and get results of:

1. (i) the digitized ECG signal from the NI USB-6009 digitizer connected to the ECG circuit (left graph),

1. (ii) the ECG signal processed by the 60 Hz band-stop filter (middle graph), and

1. (iii) the ECG signal that is further processed with a low-pass filter of a cut-off frequency of 100 Hz (right graph).

1. Please notice that the figure below is for illustrations only and your signals may have less noise and thus a higher quality.

1. Please also notice that the scales of each graph may be different due to the setting of auto scaling in the graphs. After you have acquired waveforms (having clicked on the “STOP” button), please turn off the auto scale and set the X-Y scales the same for all graphs before saving it to a .jpg file with Microsoft Photo Editor for easy comparison (right mouse click on a graph -> Properties -> Scales, Remove Autoscale and set X-scale to 0 and 3, Y-scale to -5 and 5 depending on your signal amplitude, and details are in LabView user’s manual). To acquire new waveforms, set each graph to auto scale again to avoid waveforms being partially cut off. This needs to be done each time when new waveforms acquired.

1. D5.010. Save your result as a .jpg file with the Microsoft Photo Editor in the procedure described above for your report.

5.8.2. Further Studies

5.8.2.1. **Study Polarity of ECG Signal

1. D5.011. (i) Switch the connections of the two electrodes on your wrists (switch the alligator clips on the wrists) to see the change of your signals on LabView. (ii) Save your result as a .jpg file with the Microsoft Photo Editor in the procedure described above for your report. (iii) Compare the waveforms with those before switching the electrodes in terms of the polarity of the signal.

1. Switch back the electrodes on your wrists to return to your original connections.

5.8.2.2. **Study Effects of Cut-Off Frequencies of Low-Pass Filter in LabView

1. D5.012. (i) Change the cut-off frequency of the low-pass filter in LabView from 100 Hz to 80, 40, and 20 Hz respectively (a lower cut-off frequency may not only remove noise but also remove some components of the ECG signal). (ii) Save your results as .jpg files with the Microsoft Photo Editor in the procedure described above for your report. (iii) From the results, what changes do you see in the Human ECG signal in terms of signal amplitude, noise, and shape in the third display panel as the cut-off frequency decreases?

1. Change the cutoff frequency of the low-pass filter back to 100 Hz for the next study.

5.8.2.3. **Study Order of Low-Pass Filter in LabView Program

1. D5.013. (i) Change the orders of the low-pass filter in LabView from 5 to 1 (a filter of a lower order will have a slower transition between the pass and stop bands in its frequency response). (ii) Save your result as a .jpg file with the Microsoft Photo Editor in the procedure described above for your report. (iii) From the result, what changes do you see in the Human ECG signal in terms of signal amplitude, noise, and shape in the third display panel?

1. Change the order of the low-pass filter back to 5 to reset.

5.8.2.4. **Study Effects of Cut-Off Frequencies of BandStop Filter in LabView

1. D5.014. (i) Change the cut-off frequencies of the band-stop filter in LabView from 58 and 62 Hz to 48 and 52, respectively. (ii) Save your result as a .jpg file with the Microsoft Photo Editor in the procedure described above for your report. (iii) From the result, do you conclude that you have 60 Hz interference signal or not near your table?

1. Change the lower and higher cut-off frequencies of the bandstop filter back to 58 and 62 Hz respectively so that you would not get confused if you would like to do other tests.

5.9. Save Your Work

5.9.1. *Save Files with winSCP

• Use the “winSCP” program to: (i) save your files to your engineering account and then (ii) delete the saved files from your desktop. Deleting from your computer desktop the files that you produced and transferred to your account would avoid confusing the groups that do the same lab using the same computer after you and also would prevent your results be misused by others. (Please follow Section 1.3.4 “Software to Use” in the classnote of Lab #1 for steps to use winSCP if you forget how to do this.)

5.9.2. *Save Your Constructed Circuits

• Save the bread board that contains your completed circuits for your report when needed by putting it on the shelves at the back of the room after you have completed this lab. Please pin a piece of paper with your name(s) on the bread board if you have not already done so.

5.10. Turn off and Disconnect Equipment

• After completing the lab, turn off (i) power supply, (ii) function generator, (iii) multimeter, (iv) oscilloscope, (v) computer, and (vi) monitor if they have not been turned off already. Disconnect the cables that you have used and put them on the hangers at the back of the room.