Quantcast
Channel: op amp – Gas station without pumps
Viewing all articles
Browse latest Browse all 68

Instrumentation amp from op amps fine for EKG

$
0
0

As I mentioned in Instrumentation amp from op amps still fails, I’ve been trying to decide whether to have students build an instrumentation amp out of op amps in the circuits course.  I decided that it wouldn’t work for the pressure-sensor lab, because of the large DC offset.  One could calibrate each amplifier, either in software (by recording a a few seconds of 0 pressure difference, and subtracting a constant fit to that region from the data) or in hardware, but I’d rather they had a more straightforward experience where the DC offset was small enough to be ignored.

I conjectured that instrumentation amp built from discrete op amps would work ok for the EKG lab, though, as the EKG already has to deal with much larger input voltage offsets due to differing electrode-skin contact.  So I added a second stage  with a gain of 81 to the instrumentation amp in the previous post with a gain of 19, to get a combined gain of 1539.  I put in the high-pass filter needed to eliminate the DC offset, and a low-pass filter to reduce noise slightly (and make aliasing less of a problem).  The corner frequency is a bit high (60Hz noise is not going to be reduced much), but that may allow a better view of the fast R spike in the EKG waveform.

    The EKG circuit has four modules: a virtual ground (here set to 0.5v), an instrumentation amp, a high-pass filter to eliminate DC bias, and a second-stage non-inverting amplifier with some low-pass filtering.

The EKG circuit has four modules: a virtual ground (here set to 0.5v), an instrumentation amp, a high-pass filter to eliminate DC bias, and a second-stage non-inverting amplifier with some low-pass filtering.

The amplifier worked surprisingly well. I did sometimes have trouble with 60Hz noise, but it did not seem to be any worse than the amplifier based on the INA126P. I can remove the noise by digital filtering, though I’ve only played with that by post-processing the data files, not by designing a notch filter to run in realtime on the KL25Z (something to do when I have more time).

Here are a few traces made with EKG circuit above, feeding into the PTE20-PTE21 differential input on the KL25Z board, recorded using PteroDAQ.

This is lead I, without filtering, showing a rather disturbingly large 60Hz noise signal.

This is lead I (LA–RA), without filtering, showing a rather disturbingly large 60Hz noise signal.

This is lead I (LA-RA), showing how the digital filter cleans up the signal. This was Bessel bandpass filtered to 0.3Hz to 100Hz, followed by notch 57Hz–63Hz, followed by notch 117Hz–123Hz. Each filter was a 5th-order Bessel filter, applied first forward in time then backward in time (using scipy's filtfilt function).

This is lead I (LA–RA), showing how the digital filter cleans up the signal. This was Bessel bandpass filtered to 0.3Hz to 100Hz, followed by notch 57Hz–63Hz, followed by notch 117Hz–123Hz. Each filter was a 5th-order Bessel filter, applied first forward in time then backward in time (using scipy’s filtfilt function).

This is lead II (LL-RA), which for some reason had rather low noise even without filtering.

This is lead II (LL–RA), which for some reason had rather low noise even without filtering.

I noticed that sampling at 360Hz allowed me to see a bit more of the structure of the S and T complex than I’ve seen previously, particularly in lead II, and I can even make out a little bump of a U wave just after the T wave.

I now have to decide whether to have students do the EKG amplifier without an INA126P chip, using only op amps. The design will be fairly heavily constrained, as they’ll need to get it all working on a single MCP6004 chip, but it will justify my spending a bit more time on how instrumentation amps work.

I may redesign the blinky EKG to use a single MCP6004 chip also, which would reduce the price of that substantially.


Filed under: Circuits course Tagged: ECG, EKG, electrocardiogram, instrumentation amp, offset voltage, op amp

Viewing all articles
Browse latest Browse all 68

Trending Articles