Introduction: ECG Design

Through utilization of our gained understanding on basic circuit fundamentals and bio-signal acquisition principles, the goal of this final design project is to successfully acquire a human electrocardiogram signal (ECG) via circuit implementation, construction, and verification. In order to properly output a standardized ECG waveform, with identified PQRST wave components, three circuit stages were utilized: instrumentation amplifier, notch filter, and finally a low-pass filter. Given the necessary equations and researched frequency cutoffs and ranges, the circuit components for each of the three stages were chosen with intension to properly amplify and as well as filter unwanted frequencies from a human ECG signal. Before experimentally testing the circuit stages and full ECG design, the circuit was simulated in LTSpice circuit software. After computer simulated circuits were verified, the physical circuit construction and demonstration began. Although the verified gain and output measurements obtained through laboratory demonstration were not outstanding, as discussed in results, the obtained ECG signal viewed on the oscilloscope displayed stable PQRST wave components consistently. In order improve the circuit design to further steady the frequency range obtained and increase signal amplification, the utilization of a high-pass filter could potentially serve as a beneficial addition to the three stages already utilized in this project. 

Supplies

  1.  Materials: 
  2. Bread Board  
  3. Operational Amplifiers (LM 741) 
  4. Resistors 
  5. Capacitors  
  6. Wires  
  7. Electrodes 
  8. Software Used: 
  9. LT Spice 
  10. Arduino 
  11. Microsoft Execl
  12.  Electronic Equipment 
  13. DC Power Supply
  14. Function Generator
  15. Oscilloscope 
  16. Pre-Amp

Step 1: Instrumentation Amplifier

The instrumentation amplifier is a differential op-amp where the difference between two input terminals is amplified and the noise between the signals is reduced. Some key characteristics with an instrumentation amplifier include a low DC offset, low noises, high gain properties and high impedances. The instrumentation amplifier was made with a gain of 100 to allo for the best results. The schematic of the instrumentation amplifier is shown along with the calculated and experimental values for the circuit.

Results: Using the graph shown below from the oscilloscope, the gain of the instrumentation amplifier that is tested can be calculated by using the peak-to-peak values of the input curve compared to the output curve. The peak-to-peak measured for the input curve (yellow) is 32.8 mV and the peak-to-peak measure for the output curve (green) is 20.5V. The gain that was calculated with the graph shown below is 774.186. 

Step 2: Notch Filter

The notch filter  is designed to reduce the specific interference frequency associated with input signal (DC Voltage Generator) and leave other frequencies unaffected. The notch filter should also have no gain.  The notch filter is using a high pass and low pass filter in parallel to remove the noise specifically at 60 Hz. The schematic of the instrumentation amplifier is shown along with the calculated and experimental values for the circuit.

Results: The images show the magnitude response vs frequency plot for the notch filter generated. The magnitude response vs frequency plot represents the magnitude (gain) and phase difference between the input and outputs signals. It plots the magnitude and phase response curves which are a function of log(frequency). The first graph represents the output from LTSpice which highlights that the notch reduces the input signals at 60Hz. The second plot shows the information from appendix () of the results from the oscilloscope. It highlights that the notch filter reduces the input signal magnitude at 59.5 Hz which is within the threshold of 60Hz.

Step 3: Low Pass Filter

The low pass filter  is used to remove all frequencies above the ECG signal which would require a designated cutoff frequency. For this low pass circuit, the cutoff frequency would need to be determined by the peak on the QRS complex for an ECG wave. The cutoff frequency for the experiment would be 250 Hz with a gain of 1. The key function of the low pass filter is to remove high frequency noises that may come from different parts of the body. 

Result: The following graphs are the results for the low pass filter both in schematic and the physical circuit builds. The bode plot shows the cutoff frequency to around 240 Hz and the oscilloscope shows the cutoff frequency be at 250 Hz.

Step 4: Full ECG Design

After constructing the circuit by themselves and testing the output to ensure they meet the initial conditions of the project, the next step is to combine them together and create an ECG wave from a human test subject. Looking at the three schematics above, the circuit would be combined by using the output of the previous circuit schematic to the next circuit schematic. The circuit would then be in the following order: instrumentation amplifier to notch filter to low pass filter. The final ECG would have three inputs (which would be the different leads from the person) as shown in the physical build below. The different leads would be connected to both the wrist and the ankle (which acts like ground) when finding the ECG. To measure the result on the oscilloscope it would measure from the output of the low pass filter (positive) to the ground rail (negative). 

Result: The following graph shows the results of the full ECG circuit demo from the oscilloscope with the human subject. The images highlight the different waves of the ECG and allow for the calculation of the heart rate. The amplitude of the graph shown is 1.2987 Hz which would then give a heart rate of 77 Hz. This is calculated using the following formula: Amplitude of Graph * 60. 

Step 5: Connecting Full Circuit to Arduino Uno

The Arduino device that was used is an Arduino Uno which is a microcontroller board. It has 14 digital input and output pins, 6 analog inputs, a ceramic resonator, USB connection and a power supply. With the Arduino Uno, it was connected to the ECG by having an input signal (A0) and connection to the ground. For the purpose of the experiment, it was connected to a pre-amp machine to allow for a higher magnitude than what the circuit could produce. From the circuit to the board, it was then connected to a laptop using a USB cable.

Result:The following image below shows the result of the Arduino code calculating the heart rate and the ECG signal from a human subject. The heart rate that is found using the calculation from the code gives a heart rate of 76 BPM. The graph below shows an ECG wave but specifically the P-wave, the R-Wave and the T-waves. This is since the code only shows the positive outputs of the ECG wave.