Make Your Own Electrocardiogram (ECG)

438

2

1

Posted

Introduction: Make Your Own Electrocardiogram (ECG)

NOTICE:

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 battery power and other proper isolation techniques.

[Image taken from https://scienceprog.com/avr-dds-signal-generator-v...]

Step 1: Know Your Stuff

The electrocardiogram (ECG) is an important tool used by physicians to monitor the electrical activity of the heart. It’s useful in capturing everything from abnormal heart rhythms to diagnosing heat failure. By following this Instructable, you will be able to build a device that displays the electrocardiogram of a person using only basic breadboarding skills, and general electronics lab equipment. Once you have good signal output, you could use this same signal to calculate heartrate, or another interesting metric using a microcontroller.

-

If you don’t know what an ECG is, it is simply a recording of the heart’s activity. Due to the electrical nature of the heart’s contractions, one can record the change in voltage by placing electrodes on the skin and processing the signal. The plot of these voltages over time is called an electrocardiogram (ECG for short). ECGs are typically used to diagnose various forms of heart failure, or passively monitor patient stress. A healthy ECG has specific features that are universal between humans. (This includes a P-wave, Q-wave, R-wave, S-wave, T-wave, and a QRS complex.) I've provided a simplified diagram of an ECG with the corresponding reaction of the heart.

-

Note that each electrical event occurring in the heart’s nerves corresponds to a physical event that occurs consequently in the muscle tissue, and while one part of the heart is contracting, the other portions are relaxing. In this way, the timing of electrical signals is very important in the heart, which makes an ECG a very powerful tool in measuring heart health.

-

For us to record an actual ECG however, many logistical issues come into play such as the size of the signal, the amount of noise coming from the rest of the body, and the amount of noise coming from the environment. To compensate for this, we are designing a circuit that will be composed of 3 parts: a differential amplifier to increase the size of our signal, a low pass filter to eliminate high frequency signals noise, and a notch filter to remove 60 Hz noise that is always present in buildings supplied with AC power. I will describe watch of these steps in detail to you below.

[Image taken from https://courses.lumenlearning.com/ap2/chapter/card...]

Step 2: Gather Your Supplies

For this project you will need:

- 1 large breadboard (having 2 or more will be nicer though)

- 5 general purpose op-amps

(I used the UA741 with +-15 V, just make sure that ones you choose can handle 15 volts otherwise you will need to adjust the values of your passive components and you’ll have to settle for less amplification)

- Resistors

o 2x 165 ohm

o 3x 1k ohm

o 2x 15k ohm

o 2x 33k ohm

o 1x 42k ohm

o 2x 60k ohm

- Capacitors

o 2x 22nF

o 2x 1μF

o 1x 2Μf

- A plethora or jumper wires

- A DC voltage source capable of providing +-15 V

- A function generator and oscilloscope (mainly for troubleshooting)

- At least three sticky electrodes if you plan on recording an actual ECG

- Enough cables to connect all this nonsense

- A firm understanding of circuits, op-amps, and experience with breadboarding.

If you just got a breadboard for your birthday and are looking to try make something cool with it, do at least a few simpler builds before you try this out.

-

Step 3: Build the Differential Amplifier

The differential amplifier is what will amplify our recorded signal to a usable level to be displayed on a scope or a screen. This circuit design will take the difference in voltage from the two input electrodes and amplify it. This is done to reduce noise, as common noise between the electrodes will be eliminated. ECG signal will vary in amplitude depending on the placement of the recording electrodes and the individual, but are typically on the order a few millivolts when recording from the wrists. (While it is not necessary for this setup, signal amplitude can be increased by placing electrodes on the chest, but the trade-off is noise from lung movement.)

-

I've included a schematic of the setup. The circuit in the picture should amplify your signal ~1000 fold. You may need to adjust this depending on the type of op-amp you decided to use. A quick way to adjust this is by changing the value of R1. By cutting the value of R1 in half, you will double the output gain and vice versa.

-

I assume that most of you can translate this circuit onto the breadboard, nonetheless I’ve included a diagram of the breadboard setup to streamline the process and hopefully reduce your troubleshooting time. I’ve also included a picture of the UA741 (or LM741) pinout for your convenience. (for your purposes you won’t need pins 1,5, or 8) The V+ and V- pins on the op-amp will be connected to your +15 V and -15 V supply respectively. -15V is not the same as ground! You can ignore the capacitors on my breadboard. They are bypass capacitors meant to remove AC noise, but in retrospect weren’t worth the effort.

-

I recommend testing each stage as you complete it to troubleshoot. As the circuit shows, you can connect one of the inputs to ground, and the other to a small DC source to check amplification. (make sure you input <15 mV otherwise you’ll saturate the op-amps). If you need to reduce your gain for testing, don’t sweat it, anything above 500-fold gain will be plenty for our purposes. Moreover, if you built your circuit to have a gain of 1000 and it only shows a gain of 800, it isn’t the end of the world, the exact number is non-critical.

-

Step 4: Build the Notch Filter

Now that we can amplify our signal, let’s look at cleaning it up. If you hooked up electrodes to our circuit right now, it would likely have a ton of 60 Hz noise. That because most buildings are wired with 60 Hz AC current causing inevitably large noise signals. To remedy this, we will build a 60 Hz notch filter. A notch filter is designed to attenuate very specific frequencies and leave other frequencies untouched; perfect for getting rid of 60 Hz noise.

-

As before, I’ve included a picture of the circuit schematic, breadboard setup, and my own circuit. As a note, while the notch filter is a relatively easy stage to build, it took the longest for me to get working. My input was being attenuated well, but at 63 Hz instead of 60 Hz, which won’t cut it. If you run into the same problem, I recommend that you change your value of R14. (Increasing resistance of R14 will lower your attenuation frequency and vice versa). If you have a variable resistor box, use it to replace R14, then toy with resistance values to find out exactly what works best, as it will be sensitive to changes in on the order of single ohm. I ended up with a 175 ohm R14, but in theory it works best to match R12.

-

Again, you can test this stage by using a function generator to input a 60 Hz sine wave and record your output on an oscilloscope. Your output should be about -20 dB or 10% the amplitude of the input. As I said before, you can check nearby frequencies for optimization.

-

Step 5: Build the Low-Pass Filter

As mentioned before, another important factor is reducing noise from your body and whatever else that’s zapping the room you’re in. A low pass filter is good at doing this because, as far as signals go, your heartbeat is pretty slow. Our goal with the low-pass filter is to eliminate all signals that contain frequencies higher than your ECG. To do this we need to do designate a “cutoff frequency”. In our case, everything above this frequency we want to eliminate, and everything below this frequency we want to keep. While a heartbeat is occurring on the order of 1 to 3 Hertz, the individual waveforms that make up our ECG are made up of frequencies much higher than this; near 1 to 50 Hertz. Because of this, I chose a cutoff frequency of 80 Hz. Its high enough to keep all the useful components in the signal, but still cuts out the noise from the HAM radio you have in the next room.

-

I don’t have any sage advice on the low-pass filter, it’s very simple compared to the other stages. Similarly to the amplifier, don’t worry about getting a precise cutoff at 80 Hz; this is not crucial and won’t realistically happen. Nonetheless, you should check its output by using a function generator. As a rule of thumb, a sine wave should go through the filter untouched at 10 Hz, and should be cut in half by 130 Hz.

-

Step 6: Hook It Up!

If you’ve made is this far, congrats! You have all the components of an ECG. All that you need to do in is connect them together, slap on the electrodes, and hook the output to the oscilloscope to see your ECG!

-

In case you are unsure of how to put on electrodes, I recommend sticking the input electrodes on your wrists (one on each wrist) and connecting a ground electrode to your leg (the picture may help.) As a reminder, each input electrode should go a positive input on the op-amps in the amplifier. (It is only grounded in the circuit diagram for simulation purposes)

-

Once you're connected, hook up theoutput of the low-pass filter to an oscilloscope and be proud of yourself! Make all your kids come put on electrodes and look at their heartbeats. Heck, make your neighbors come try it out. If you’re feeling extra motivated hook up the output to a microcontroller to calculate heart rate from the single. (You probably want to lower the amplification before you do this, it may fry the board you’re using). Regardless, congrats on the build, and happy making!

[Image taken from https://www.medicwiz.com/medtech/diagnostics/10-ty...]

Share

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Gluten Free Challenge

    Gluten Free Challenge
  • First Time Author Contest 2018

    First Time Author Contest 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

Comments

Ay! Congrats on your first Instructable!