0
\$\begingroup\$

I have recently got into electronics. I have access to an Analog Discovery 2 (AD2) kit with signal generator and oscilloscope functions.

I have been trying to teach myself how to use this equipment by building small, simple circuits.My current experiment involves building an electrocardiogram (ECG.)

To implement this circuit, I am using an instrumentation amplifier followed by a bandpass filter. The signal obtained from the Einthoven's triangle input is filtered out after amplification.

The circuit is supplied by the 5V from the AD2:

enter image description here

The pins V1 and V2 correspond respectively to my left and right arm while my right leg is connected to ground.

This is the circuit I built and tried on myself:

enter image description here

I use the LM324's four op amps to implement the instrumentation amplifier and bandpass filter.

After rechecking my circuit several times, here is what my output signal looks like:

enter image description here

I can't seem to understand what is causing my output to look like this.

  • Why is the waveform so inconsistent with the simulation's waveform (electrocardiogram) from this website?
  • How can I fix this issue and obtain a better looking waveform ?
\$\endgroup\$
0

3 Answers 3

3
\$\begingroup\$

As JRE said, you are missing some components common to EMG/ECG amplifiers that are crucial to their correct operation. If you re-implemented that circuit with precision components, it still would not work. I also have some degree of confidence that if you implemented a new circuit that has the necessary modifications, you can get a functional (albiet less performant) amplifier that's still based on non-precision parts.

The three basic components of an EMG/ECG/EEG amplifier are:

  1. Instrumentation amplifier. This serves the purpose of providing gain to your millivolt signal to get it into a 'readable' voltage range, and removing common mode noise. Note that near-field effect 60Hz will not be effectively attenuated by just the common-mode rejection of an instrumentation amplifier.
  2. Filtering. These amplifiers usually have multiple stages of active filters, which implement a comb filter + band pass filter combination. The comb filter in particular filters near-field 60Hz noise and harmonics. If your device is operating in a country that uses 50Hz, you'll need to account for that accordingly.
  3. Input conditioning/DC offset compensation. This is the most subtle, but it is an absolute requirement and likely the main reason you aren't seeing any ECG artifacts at all from your circuit. The human body is under no obligation to produce neuromuscular signals centered at a DC offset which is between the supply rails of your circuit, even with a good electrode ground reference. Usually amplifier circuits have multiple stages of DC bias compensation (RC high pass with DC bias/voltage reference on each electrode input, and active low band-edge high pass on the output). The value you use as your reference depends on how you manage your supply rails; i.e. if you have matched positive and negative supply rails, you can use 0V as your reference, but if you want to go with a monopolar supply you'll need to establish a virtual ground.
\$\endgroup\$
2
\$\begingroup\$

If your goal is to build a real ECG analog front end -- The company I work at as an applications engineer (MaximIntegrated.com) makes ECG Analog Front End chips, MAX30001/MAX30002/MAX30003/MAX30004. I remember when the guy in the next cubicle was developing the bench testing boards for those chips, those required a lot more input filtering. It's a very difficult problem because the heart rate ranges around 50Hz-200Hz, typically 60Hz, with biopotential sensor amplitudes in the microvolts; but the power grid frequency 50Hz/60Hz has much stronger amplitude. Long wires pick up 50Hz/60Hz line frequency, and room lighting at 100Hz/120Hz can even affect some components. There is no chance of making a good ECG AFE with wires on a solderless breadboard, it requires a good PCB layout. Take a look at the MAX30003WING PCB layout as an example of the right way to implement an ECG.

If your goal is just to build an Instrumentation Amplifier circuit (not a real ECG), but you only have a single 5V power supply, you need to use a rail-to-rail op amp.

why not to build RF circuits on breadboard -- Recent reference for "why not to build RF circuits on breadboard"

When to avoid using a breadboard -- https://electronics.stackexchange.com/a/2107/35022

\$\endgroup\$
1
\$\begingroup\$

All your circuit is picking up is interference. Specifically, 60Hz hum and noise from the power lines in your environment.

Have a look here:

enter image description here

The vertical lines in your chart are spaced at 15 milliseconds. The signal repeats at just a little more than that interval. I read it as about 16 milliseconds - that's 60Hz.

  • I have my doubts about how well the LM324 operates on 5V. The output can go to ground, but as far as I can tell the output will always be a few volts below the power rail - call it about 2V when working from a 5V supply.
  • You appear to be powering the circuit from the AD2 itself. That's bad for two reasons. One is that hum from the power lines can "walk" right through the regulator and into your circuit causing hum and noise (like you see.) The more worrying thing is that your circuit has no current limiting between it and you. If something goes wrong with the power supply, you could find yourself on the receiving end of line voltage - 120VAC, since you appear to be in 60Hz land.
  • The signals you are trying to detect are on the level of microvolts. The breadboard itself can easily produce and/or pickup far more noise from the environment than the signal you are trying to detect.
  • Good performance from an instrumentation amplifier requires precision parts. A pack of resistors from Amazon is unlikely to meet those requirements.

I'm not all that great with filters, but I think your low pass filter has a much too high cutoff frequency. I get something like 1.6kHz, which may be entirely wrong. In any case, you need a very low cutoff. Heartbeats are at something like 1 per second. You need more than that to cover fast hearbeats and to catch the sharper edges of the pulses, but you don't need 1600Hz. Either go entirely below 60 Hz, or else include a (very) sharp band stop filter at 60Hz.

It is also possible that you have simply wired something wrong. I do think, though, that this is largely a conceptional problem. Inadequate circuit built of inadequate parts with an inadequate design.

\$\endgroup\$
6
  • \$\begingroup\$ It is said in the AD2 manual that the supply function can be used to perform circuit simulations. Can you elaborate more on why it can be used in my case, or provide a link in your answer please? Im not sure what you are referring to when you say" precision part " but all the blue resistors you are looking at, are in fact precision resistors. \$\endgroup\$
    – Silicon
    Commented Jun 18, 2021 at 15:36
  • \$\begingroup\$ I added another source to power the circuit from another power supply. That does not seem to help much. \$\endgroup\$
    – Silicon
    Commented Jun 18, 2021 at 15:45
  • \$\begingroup\$ Precision as in "0.1%." \$\endgroup\$
    – JRE
    Commented Jun 18, 2021 at 15:53
  • \$\begingroup\$ For your doubt I just read the datasheet for the LM324 and it said that it works pretty fine with 5V. \$\endgroup\$
    – Silicon
    Commented Jun 18, 2021 at 15:53
  • \$\begingroup\$ The datasheet says it works at 5V. It is not rail to rail on the output, though. The output can go down to ground, but the output can never reach 5V. It will always be a couple of volts below 5V - even when the input signal and the amplification say it should be higher. The LM324 can't do higher. \$\endgroup\$
    – JRE
    Commented Jun 18, 2021 at 15:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.