ECG/ DC Offset

Thread Starter

jdp323

Joined Apr 7, 2013
2
I'm doing an ECG project where I've built most of the front in circuit and once finished I want to sample with an ADC and then either plot or calculate heartbeat from.

Set up
This is the set up right now. Its running off two 9 volt batteries in series for positive and negative voltage. The diff amp's gain is set to 125 and the non inverting op amp is set to 19.5. This gives me a signal around -1 to 3.5 V's.

ECG wave
This photo is when the gain was a little higher for testing but shows the general wave.

The problems, I'm having are that the signal "moves"; its not always centered around 0. This is an example of when it drifted down Then I only have the peaks being read by the ADC. The second problem is the negative part of the wave. I've tried to add in a DC offset by a voltage divider on the output but just lose my signal. Any idea why the signal moves besides noise and only being a 3 lead electrode and more importantly can someone tell me what I need to do to add some DC offset to this configuration.

I'll either be using the arduino's or the mbed's ADC to sample the signal. Any help is greatly appreciated!
 

kubeek

Joined Sep 20, 2005
5,794
I think that the 0.03Hz high pass is a problem, as it basically makes the system take 30 seconds to correct the change in dc offset. Wouldn´t say 5hz be a more appropriate value?
The offset can easily be set by instead of grounding the 5.1M resistor you connect it to a potentiometer divider that sets the desired dc level, with a cap to ground on the viper. Or a simple resistor divider for a set offest.
 
Last edited:

#12

Joined Nov 30, 2010
18,224
Low frequency limit of .03HZ? Get rid of that 5 meg resistor and get into real world numbers for frequency. You're practically begging a temperature induced offset drift in the first stage to perpetuate into the second stage.

Capacitive coupling intentionally centers the waveform across the zero line. This is how you do a DC offset such that the offset is not amplified but the AC component is.
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
The problem is, a high pass filter causes undershoot after the QRS complex. A 5Hz filter is WAY too high. See the attached simulation.

Many commercially available instrumentation amps (e.g., INA118 fig. 9) have application schematics for EKG amps with DC common-mode feedback, which should eliminate the drift. Other inamps have variations on this circuit. I would not try to reinvent the wheel.
 

Attachments

t06afre

Joined May 11, 2009
5,934
Hi Jdp323
If you go to web site for the major producers of electronics and search for ECG you will find a lot stuff like these
http://focus.ti.com/pdfs/vf/medeq/in...plications.pdf
http://www.ti.com/lit/an/slyt226/slyt226.pdf
In the last application note(both actually ;) ). Note how the make use of an tntegrator. To make a DC coupled AC amplifier.
Also try
http://www.analog.com
In Some of the circuits, they may have used exotic components. But use the design principals. We may help finding replacement ICs.
The recommended bandwidth for ECG is 0.01 to 250Hz. But if you only are looking for heart beat measurements. You can perfectly well set your lower bandwidth to 1Hz. As you will be using the R wave, and the interval between R waves.
 

Thread Starter

jdp323

Joined Apr 7, 2013
2
Thanks for all the great replies.

As for the reason I chose the .03Hz filter is that I'm using Analog's AD620 for the instrumentation amp. I'm was somewhat following their suggested set up, I'm going to try adding in the leg driven circuit for DC Common mode feedback to see if it will help with drift as suggested!
Capture.JPG

Capacitive coupling intentionally centers the waveform across the zero line. This is how you do a DC offset such that the offset is not amplified but the AC component is.
Thanks for showing me the correct way.

Low frequency limit of .03HZ? Get rid of that 5 meg resistor and get into real world numbers for frequency. You're practically begging a temperature induced offset drift in the first stage to perpetuate into the second stage.
What are the real world numbers? In circuits theory it was just use fc = 1/2piRC and plug and chug for values you want.

Hi Jdp323
If you go to web site for the major producers of electronics and search for ECG you will find a lot stuff like these
http://focus.ti.com/pdfs/vf/medeq/in...plications.pdf
http://www.ti.com/lit/an/slyt226/slyt226.pdf
In the last application note(both actually ). Note how the make use of an tntegrator. To make a DC coupled AC amplifier.
Also try
http://www.analog.com
In Some of the circuits, they may have used exotic components. But use the design principals. We may help finding replacement ICs.
The recommended bandwidth for ECG is 0.01 to 250Hz. But if you only are looking for heart beat measurements. You can perfectly well set your lower bandwidth to 1Hz. As you will be using the R wave, and the interval between R waves.
I'll look into this! Thanks for the great links!
 

#12

Joined Nov 30, 2010
18,224
Real world numbers?

Let's see, whose heart beats at .03 Hz? "The usual heart rate of large whales is from 10 to 30 beats per minute." Nope. Still too fast for .03 Hz.

Better question: Considering that most of the information is in the fast movements, what is the slowest movement I might want to see? Something that takes a whole second of conduction? That would set your time constant at 1Hz or 1 second.
You can decide or you can use the excellent circuits that are DC coupled and offset by integration that T06 was telling you.
 

Ron H

Joined Apr 14, 2005
7,063
Real world numbers?

Let's see, whose heart beats at .03 Hz? "The usual heart rate of large whales is from 10 to 30 beats per minute." Nope. Still too fast for .03 Hz.

Better question: Considering that most of the information is in the fast movements, what is the slowest movement I might want to see? Something that takes a whole second of conduction? That would set your time constant at 1Hz or 1 second.
You can decide or you can use the excellent circuits that are DC coupled and offset by integration that T06 was telling you.
Here is what a 1Hz high pass filter does to the QRS complex.

EDIT: I gotta confess that I totally missed post #6.:(
The feedback to a leg is probably the solution to the drift problem.
I also see that this is where the .03Hz HPF came from.
 

Attachments

Last edited:

t06afre

Joined May 11, 2009
5,934
Here is what a 1Hz high pass filter does to the QRS complex.

EDIT: I gotta confess that I totally missed post #6.:(
The feedback to a leg is probably the solution to the drift problem.
I also see that this is where the .03Hz HPF came from.
This is a more realistic simulation. And in order to cope with some drift. And given that we are only looking for HR measuremnts. A 1 Hz high pass filter will be more capable to handle drift problems. At least to some extent. But well by using the instrumentation amplifier as DC coupled AC amplifier You will not have far less problems with filter distortion.
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
This is a more realistic simulation. And in order to cope with some drift. And given that we are only looking for HR measuremnts. A 1 Hz high pass filter will be more capable to handle drift problems. At least to some extent. But well by using the instrumentation amplifier as DC coupled AC amplifier You will not have far less problems with filter distortion.
But my point is, I don't think the filtered waveform is acceptable for much, other than measuring pulse rate, and you don't need an ADC for that.

How did you create those waveforms?:)
 

t06afre

Joined May 11, 2009
5,934
But my point is, I don't think the filtered waveform is acceptable for much, other than measuring pulse rate, and you don't need an ADC for that.

How did you create those waveforms?:)
I used an ECG simulator made in Labview for those. So the filtering was digital. In this case I used a second order bessel hi-pass filter 1 Hz. 500Hz sample rate
 
Top