Skip to content

Building an Electrocardiograph I

September 1, 2007

After the biofeedback experiments a few weeks ago, I started thinking about a more flexible way to measure raw heart rate data.  I am interested in more control of data sampling in order to make signal processing and analysis easier.

Fortuitously, the last issue of Make has a short article on page 157 on the topic of DIY electrocardiographs.  So off we go…

I first decided to go with the instrumentation amplifier built from three 741 op amps as described in the article.  I added the simple resistance-capacitance filter recommended in the article, got some conducting 3M Red Dot electrode pads and hooked the whole think up to the USB Bit Whacker for data collection (see Accelerometer from a few days ago.).

What were the results? Well, a qualified "it worked," but this needs some work.

The amplifier.  We need a gain of about 1000 to get the signal in the range of the A/D capabilities of the UBW (0-5V, 10 bits resolution). And we need high fidelity differential amplification of the inputs. This is called the common-mode rejection ratio (CMMR).  We need a CMMR of 100,000:1 (~100dB).  Here is the schematic:

instrumentation amp schematic

I added the recommended RC amplifier to the output to clean up the signal a little.

Here are some photos of the construction process. The circuit is point-to-point wired on a proto board and the whole think is mounted in a small aluminum case. The basic circuit is only a few components so it didn’t take long to build.

instrumentation amplifier construction

The amplifier is powered by two 9v batteries to provide +/-9V for the op amps.  This means the output signal varies from something like -8 to +8 volts. Feeding the A/D of the UBW a signal between 0-5V is going to require some adjustments.  I added two 10K ohm potentiometers for null offset to I1 and I2.  (I now think this was a naive mistake because these have to be set very nearly equal for the amplifier to work.) I also added a 500 ohm gain adjust potentiometer in place of the 200 ohm fixed resister recommended.

testing instumentation amplifier

When I tested the amplifier with DC input signals, I grounded one input and varied the input at the other with a simple voltage divider.  This didn’t expose any of the weaknesses of my design decisions. The null offset adjustment worked well. The test showed a gain of 1000 was easy to attain and that the amplifier produced a nice looking linear response.

So I closed up the case and was off to measure my heart beats.

finshed amplifier

Contact pads.  I started with some home-grown copper electrodes.  While I did get a small signal–intermittently–this wasn’t going to work. To the Internet to buy the real thing from 3M.

I attached my new amplifier to the UBW analog input channel and modified my Python script ( from the accelerometer experiment to capture data on one channel every 10 ms.  Here are the results:

heart rate data

And some detail…

detail plt

It is clear that external signals are swamping the desired heart beat signal.  It also may be the case that the amplifier-A/D combination is so poorly matched that there is some distortion of the data.

What to do different:

* Shorten the input leads–they seem to be acting as large antennae to the 60 Hz AC line frequency
* Build a better filter (active)
* Build/buy a more robust instrumentation amplifier
* Use a smarter method to translate the output to the required A/D voltage range
* Best of all, have this experience

2 Comments leave one →
  1. September 23, 2011 4:12 pm

    I’ve just stumbled across your project. I’ve also been trying to build an ECG, and I quite like your circuit. I like it because you’re using 741 and I have a bunch of those, unfortunately I’ve been told several times that these aren’t appropriate for an ECG. And I believe them.

    However, I don’t want to buy other components, i’ve got enough already!
    So the reason I’m writing to you is that, I’ve built the same circuit as you with the exception that mine doesn’t work…
    To start with I have a negative output from the Instrumentation Amplifier (IA).
    The first stages of I1 and I2 are very unstable and bizarre output voltages.
    Are these all problems you encountered?
    Did you have any other issues?
    How reliable was your reading?

    Galvanic dude



  1. Instrumentation Amplifier for ECG

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: