ECG

by mhanlon02 in Circuits > Arduino

603 Views, 2 Favorites, 0 Comments

ECG

Screen Shot 2022-04-30 at 2.31.08 PM.png

An ECG is able to measure the heart rate and rhythm of a patient. This machine is able to detect serious heart issues and is important in the medical world. We have created an ECG by using 3 different types of circuits and putting them together. We also use an Ardunio to calculate BPM. This project focuses on the heart and how we can best measure the waves.

Supplies

Instrumental Amplifier (to achieve a gain of 1000)

  1. Resistor 1 value of 1894.7 Ohms
  2. Resistor 2 value of 1000 Ohms
  3. Resistor 3 value of 18000 Ohms
  4. Resistor 4 value of 50000 Ohms
  5. 3 Op-Amps

Low Pass Filter (Cutoff frequency of 150 Hz)

  1. Capacitor 1 value of 0.034 μF
  2. Capacitor 2 value of 0.068 μF
  3. Resistor 1 value of 22060 Ohms
  4. Resistor 2 value of 22060 Ohms
  5. Wires
  6. 1 Op-Amp

Notch Filter (Quality Factor of 8, Cuttoff frequency of 60 Hz)

  1. Capacitor 1 value of 0.068 μF
  2. Capacitor 2 value of 0.068 μF
  3. Resistor 1 value of 2438 Ohms
  4. Resistor 2 value of 624137 Ohms
  5. Resistor 3 value of 2428 Ohms
  6. 1 Op-Amp
  7. Wires

1 Arduino

1 Oscilloscope

3 Electrodes to attach to the right wrist, left ankle, and right ankle

3 Grabber Hooks (connector wire)

1 Banana Connector

1 Power Supply Source

1 Function Generator

1 Breadboard

Create the Low Pass Filter

Screen Shot 2022-04-30 at 2.34.47 PM.png

Using the provided template as a guide, place the given resistor values in the specific place which corresponds to the labeled number value on the breadboard. The values are labeled in the supplies section. Now, put the capacitors in the correct labeled places on the breadboard as well as the op-amp. Use wires if necessary to connect the circuit together.


To make sure that the circuit is running properly, connect the function generator to the input wires and the output wires to the oscilloscope. The input source should be 1V. In the function generator, press sine wave and a frequency of 10 Hz. You should see a sine wave. Test out different frequency types from 10 Hz to 1000 Hz. You should see a trend where the frequency increases and the magnitude of the voltage decreases.

Create the Notch Filter

Screen Shot 2022-04-30 at 2.41.02 PM.png

Using the provided template as a guide, place the given resistor values in the specific place which corresponds to the labeled number value on the breadboard. The values are labeled in the supplies section. Now, put the capacitors in the correct labeled places on the breadboard as well as the op-amp. Use wires if necessary to connect the circuit together.


To make sure that the circuit is running properly, connect the function generator to the input wires and the output wires to the oscilloscope. The input source should be 1V. In the function generator, press sine wave and a frequency of 10 Hz. You should see a sine wave. Test out different frequency types from 5 Hz to 90 Hz. We will be using a cutoff frequency of 60 Hz. As the frequency increases from 5-60 Hz, the magnitude should be decreasing. The lowest magnitude value should be 60 Hz, which is the cutoff frequency value. Then as you increase from 61-90 Hz, the values should start to increase again.

Create Instrumental Amplifier

Screen Shot 2022-04-30 at 2.42.15 PM.png

Using the provided template as a guide, place the given resistor values in the specific place which corresponds to the labeled number value on the breadboard. The values are labeled in the supplies section. Now, put the capacitors in the correct labeled places on the breadboard as well as the op-amp. Use wires if necessary to connect the circuit together.


To make sure that the circuit is running properly, connect the function generator to the input wires and the output wires to the oscilloscope. The input source should be 10 mV. In the function generator, press sine wave and a frequency of 10 Hz. You should see a sine wave. Test out the different frequencies from 10 Hz to 15000 Hz. We will have a gain of 1000. You should see the magnitude from 10-7500 Hz stay consistent, but from 9000-15000 Hz, the magnitude values should start to slowly decrease.

Putting It All Together and Measuring Human Cardiac Signals

Screen Shot 2022-04-30 at 2.49.28 PM.png

After all of the circuits are running properly, connect them and attach 3 electrodes to your human subject. 1 lead should be on the right wrist, 1 lead should be on the left ankle, and the ground lead should be on the right ankle. Attach the electrode ends to the circuit so that they are connected. On the frequency generator, change the setting to cardiac output with a frequency of 1.2 Hz. Output the results. You should see a P, QRS, and T wave, which signals that you are outputting the heart's rhythm.

From the provided figure, the yellow line represents the input from the function generator and the green line represents the output from the patient.

Arduino and BPM

Screen Shot 2022-04-30 at 3.10.09 PM.png
Screen Shot 2022-04-30 at 3.12.59 PM.png
Screen Shot 2022-04-30 at 3.12.55 PM.png

After completing the human subject, we will be providing a code for the Arduino to generate a BPM. Download the Ardunio program on your computer and obtain an Arduino. Type in the code. Attach the Arduino to the breadboard and run the code. You need to ground the Arduino with the ground from the breadboard and connect A0 to the input. You should see a similar diagram and results to the figures provided.