BME 207 ECG Design Project

by Wumbro in Circuits > Arduino

179 Views, 0 Favorites, 0 Comments

BME 207 ECG Design Project

Screenshot 2022-05-02 232326.png
Integrated breadboard.jpg

The goal of this project was to design a circuit that would act as an ECG amplifier. To do this an integrated circuit of INA, Notch filter, and lowpass filter was built. This would allow us to connect a human to the circuit and visualize their ECG.

Supplies

materials design project.png

The table provided as the materials/supplies needed with each specific resistor and capacitor values given in further steps.

INA Simulated on LTSpice

A 207 Design Project.png
Calculations INA.png
INA simulation.png

The electrical input for ECG is very low, around 1-2.5 mV. To get a good visual representation on the oscilloscope, this signal needs to be amplified via an INA circuit. To achieve this the values for INA were calculated to produce a gain of 1000, which produced ECG voltages of 1-2.5 V. The calculations for the INA component values are shown in the images above. We used values of R1 = 2,000 Ohms, R2 = 99,000 Ohms, R3 = 9,000 Ohms, and R4 = 90,000 Ohms.  To verify a gain of 1000 an AC sweep and DC op Prnt were simulated on the circuit which can be seen in the images above.

INA Analog Circuit

INA analog.jpg

Now that the component values were verified to produce a gain of 1000 on the simulation. The physical circuit could be built and tested. Due to limited lab resources however some of the component values had to be changed: R1 = 2000 Ohms, R2 = 100000 Ohms, R3 = 10000 Ohms, R4 = 100000 Ohms. To test the circuit it was connected to a function generator and oscilloscope, and input with 20 mV. Unfortunately, the gain produced a voltage greater than the oscilloscope could read and the output capped out at 16.4 V.

Notch Filter Simulated on LTSpice

Screenshot 2022-05-02 225742.png
Screenshot 2022-05-02 225829.png
Screenshot 2022-05-02 225918.png

The purpose of an ECG is to view the heartbeat as it is amplified by the circuit producing a solid image. However, AC wall power and other factors produce loud noise at 60 Hz. To prevent this noise from disrupting our ECG signal a notch filter with a center frequency of 60 Hz must be implemented. Using the equations in the images above, the component values were calculated. For the purpose of this project, the Quality Factor was set at 10. Our calculations for component values are shown in Figure 6 in the appendix. We used C = 100 nF, f0 = 60 Hz, R1 = 0.326 Ohms, R2 = 530,516 Ohms, R3 = 12,939 Ohms, and B = 37.7 Rad/sec. To test the success of the notch filter an AC sweep was performed which proved a center frequency at 60 Hz.

Notch Filter Analog Circuit

Notch analog.jpg
Screenshot 2022-05-02 230429.png

The physical circuit was built on a breadboard using the limited lab resources given. The following component values were changed to match our resources R1 = 1300 Ohms, R2 = 560000 Ohms, R3 = 1300 Ohms, C = 0.1 uf, C2 = 0.22 uf. To analyze our circuit and confirm the efficiency of the notch filter an AC sweep was implemented. To perform the AC sweep the function generator was set with Vpp= 1 V, Offset = 0 V, and frequency = 10 Hz. Connecting the function to the circuit and to an oscilloscope to record the output and input voltages. This process was repeated between the frequency range 10-70 Hz at varying frequency steps. The AC sweep when plotted on a bode plot showed that there was a center frequency at 60 Hz but the magnitude was higher than expected

Low Pass Filter Simulated on LTSpice

Screenshot 2022-05-02 230659.png
Screenshot 2022-05-02 230721.png
Screenshot 2022-05-02 230758.png

An ECG frequency typically ranges from 100 Hz to 150 Hz and anything above that threshold is noise in the signal. A low pass filter effectively removes this noise and allows the ECG to maintain a clear visual. The equations and calculations used to find the component values at the 150 Hz cutoff frequency are above in the images. They are as follows: R1 = 22/739 Kilohms, R2 = 22.74 Kilohms, C1 = 333 farads, and C2 = 683 farads. Using LTSpice XVII the component values were entered into the schematic. Like the notch filter, an AC sweep was simulated on the circuit. The AC sweep was performed with a sweep type of decade, 10 points per decade, start frequency of 1, and stop frequency of 1000

Low Pass Filter Analog Circuit

Screenshot 2022-05-02 231150.png
Screenshot 2022-05-02 231218.png

The low pass analog circuit using the respective schematic was built. Due to limited resources, the component values were changed: R1 = 22K, R2 = 22k, C1 = 0.33 uf, C2 = 0.68uf. To analyze our circuit and confirm the efficiency of the notch filter an AC sweep was implemented. The procedure for this AC sweep is similar to that described in the notch filter methods, however, the frequency for low pass ranged from 10 – 1000 Hz. The result of this AC sweep revealed a plot extremely similar to that from the simulated circuit, thus confirming the cutoff frequency of 150 Hz.

Integrated Analog Circuit

Screenshot 2022-05-02 231737.png
Screenshot 2022-05-02 231753.png

To completely visualize the ECG all aspects of the circuit must be integrated into one single circuit. This means the INA, notch filter, and low pass filter must all become one integrated circuit. The INA, notch filter, and low-pass filter were all built on the same breadboard, so none needed to be moved which, henceforth limiting the opportunity for user error. The order of integration connected the function input into the INA, the INA output to notch filter input, and notch filter output to the low pass filter input. To determine the efficiency of the integrated circuit is to put a real ECG signal through it. To do this, one of the team members was selected to be a test subject and an ECG was performed on this subject using the integrated circuit. To perform this, 3 electrodes and their associated probes were collected. Each electrode was attached to its respective part of the test subject's body following Lead II configuration and then connected to the circuit via probes. In lead II configuration, the ECG electrodes are placed by putting the positive lead on the left ankle, the negative lead on the right wrist, and the ground electrode on the right ankle. The output of the integrated circuit was then connected to the oscilloscope to visualize the result.  The resulting ECG wave ended up being upside-down, however all parts of the circuit seemed to be responding. The signal was amplified with a gain of 1000 to 2.74V, and all aspects of an ECG wave were seen (QRS complex, T and P waves).

Arduino for Digital Plot and BPM

Screenshot 2022-05-02 232326.png

The Arduino Uno and Arduino program is a system that allows the circuit output to be transformed from analog to digital. This application gives the user the ability to apply the circuit response to a coding program. Therefore, the ECG wave can be simulated at a smoother rate and can be analyzed in more ways. To produce the output and results the circuit must be connected to the Arduino uno and to a test subject.  As before for the integrated circuit, 3 electrodes were received, attached to their respective body part according to Lead II configuration, and connected to the integrated circuit. At this point, the output of the circuit connects to the Arduino device by running a jumper wire from “A0” to the circuit output and a jumper wire from “GND” to a grounding source. Using a USB cable, the Arduino device was linked to a computer containing the Arduino IDE software. After uploading our code to Arduino, the system was run to produce a resulting ECG graph.  Using the ECG graph produced, retrieve the high and low threshold. The upper threshold is 100, and the lower threshold is 70. Using these values, the code can be changed at the respective location allowing for the program to calculate the beats per minute of the test subject. The resulting ECG graph was very similar to via the integrated circuit on the oscilloscope as expected, and the resulting BPM was found to be 80.