Home made ECG - Issues with interference - guru required!

Discussion in 'Electronics & Electrics' started by mhgarage, Nov 12, 2007.

  1. wabbit

    wabbit Member

    Joined:
    Sep 9, 2003
    Messages:
    406
    I meant the 3.5 mm output socket on your ECG. The sound card uses a 3.5 mm stereo input plug also known as a TRS (for Tip, Ring, Sleeve) connector. The body of the plug is called the sleeve and is connected to ground. The tip of the plug is left channel in and the ring in between is right channel in. If you connect it as shown in the schematic, you'll have the ECG ground on the right channel in, which is incorrect.
    I can't tell from the photo of the box interior but have you connected the lid of the box to the circuit board ground.

    [​IMG]
    Click to view full-sized image!
    Hosted by UGBox Image Store
     
    Last edited: Nov 13, 2007
  2. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    Thanks for that. Ground _is_ connected to the sleeve, correctly. The ring isn't connected to anything at all.
    Any other ideas as to how to reduce the interference? Would a low pass filter help? I'm assuming the frequency of the QRS is lower than 50hz!
     
  3. wabbit

    wabbit Member

    Joined:
    Sep 9, 2003
    Messages:
    406
    Quote from "The Biomedical Engineering Handbook", second edition, chapter 13, "Principles of
    Electrocardiography", section 13.2, "Instrumentation":

    "The general instrumentation requirements for the ECG have been addressed by professional societies through the years. Briefly, they recommend a system bandwidth between 0.05 and 150 Hz. Of great importance in ECG diagnosis is the low-frequency response of the system, because shifts in some of the low-frequency regions, e.g., the ST segment, have critical diagnosis value. While the heart rate may only have a 1-Hz fundamental frequency, the phase responses of typical analog high-pass filters are such that the system corner frequency must be much smaller than the 3-dB corner frequency where only the amplitude response is considered."

    If your intended application is general interest and non-clinical, you could probably get away with low-pass filtering with a cutoff of 15-20 Hz.
    The sound card low frequency response would certainly not go anywhere near the recommended minimum.
     
    Last edited: Nov 13, 2007
  4. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    My ECG is definitely for personal use - you'd never get away with trying to hook up a patient to a home made ecg in a chocolate milk tin :p
    Thanks for that information. I'll definitely investigate low pass filters - although they're quite past my current electronics expertise. I assume i would be filtering the audio cable core (i.e. tip)?

    EDIT: I've put together a schematic for this:
    [​IMG]
    This is applied to the core of the audio cable connecting the ECG to the computer. The GND is the shielding of the audio cable, connected to case ground.

    Is this likely to work?
     
    Last edited: Nov 13, 2007
  5. LethalCorpse

    LethalCorpse Member

    Joined:
    Mar 23, 2003
    Messages:
    3,749
    Location:
    Cambridge, Massachusetts
    [​IMG]
    Click to view full-sized image!
    Hosted by UGBox Image Store
    here's a 50Hz notch filter that should help. It will reject the 50Hz hum, whilst not drastically affecting the shape of the wave for other frequencies.
    the 193k can be made with a 150k in series with a 43k. The 9.65k can be made with a 15k in parallel with a 27k.

    [​IMG]
    Click to view full-sized image!
    Hosted by UGBox Image Store
    This one is a 150Hz low pass filter, which will give much better results than your passive filter. It can go right after the notch filter, which can go right after the input amplifier.
    component substitutions:
    160n = 150n || 10n
    240n = 120n || 120n
    68n = 68n
    43n = 10n || 33n
    2k79 = 2k4 --- 390R
    18k1 = 13k --- 5k1
    2k57 = 3k || 18k
    16k5 = 33k || 33k

    These two filters can be built with a single 4-opamp IC, like the TL074 or the OPA4134, and a handful of passive components which should be readily available at your local electronics shop.

    I'm with odje, your input amplifier really ought to be a quality instrumentation amplifier, like the INA114, or the AD627, both available from RS components for <$20.
     
  6. 2xCPU

    2xCPU Member

    Joined:
    Jan 21, 2005
    Messages:
    3,328
    Location:
    Saigon
    You don't have 'too many' earth's causing a loop do you?
    Try disconnecting the earth going to the the sound card and see how it goes.

    2.
     
  7. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    That's all great information thankyou! It's a actually a more complex circuit to filter the output than to build the ECG in the first place - which seems a little odd.

    Unfortunately, i have very little experience working with op amps, so i don't actually know which pins do what - unless that information is answered somewhere else. With the symbol for amplifier (The triangle), what do each of the inputs/outputs mean? Which pins do they correspond to?

    (now you see my problem).

    I'm trying isolation today - and hopefully that'll solve the problem. If not, filter time.
     
  8. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,290
    Location:
    Sydney
    The notch filter may need to be trimmed or use high precision components. The notch filter I made for my ECG at uni had its centre freq at 47Hz instead of 50Hz :( But the quality of the filter was very good, heap of attenuation at the centre frequency and it was very fairly narrow too.
     
  9. LethalCorpse

    LethalCorpse Member

    Joined:
    Mar 23, 2003
    Messages:
    3,749
    Location:
    Cambridge, Massachusetts
    It's pretty easy, once you look at it. The datasheet for the op-amp tells you which pins are which. It'll have a diagram showing the IC with one or several of those same triangle shapes, and the pins they connect to. The IC will also have Vcc and Vss, just positive and negative supply. You connect your circuit's power rails to Vcc and Vss, and connect the op-amps in exactly the same way as they're connected in the circuit, ie + to +, - to - and output (the other end of the triangle) to output. So long as the op-amp IC you pick has enough op-amps on it to do the job (or you get enough of them) and your IC can use the supply voltage that the rest of your circuit is using, it'll just work.

    NB: in your circuit, i believe you've got a VDD/2 point? Connect to this in place of the ground symbol on my circuits.
     
  10. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    There is a VDD/2 point, but it's connected to the normal ground i think. I'll have to check that though.
    I tried the ECG on a laptop, and got a much clearer trace. There is still a little bit of interference, but it's greatly reduced. I'll certainly investigate the low pass filter - will it work without the notch filter?
     
  11. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,290
    Location:
    Sydney
    Yes.

    The low pass filter will get rid of signals which have a frequency greater than the filter's cut off frequency. The notch filter will try and get rid of signals with a particular frequency, 50Hz in this case.

    50Hz noise is very common in instrumentation due to all the mains power cable everywhere.
     
  12. LethalCorpse

    LethalCorpse Member

    Joined:
    Mar 23, 2003
    Messages:
    3,749
    Location:
    Cambridge, Massachusetts
    Yep. And looking at your trace, 50Hz noise is your big issue atm
     
  13. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    Fantastic. Well i'll give it a go. I assume i connect the LHS of your circuit diagram to the ecg, and the RHS to the pc? Also, does software exist that will remove that noise for me so i can see if it cleans up the trace in advance? I remember that an old oscope i had years ago would do that - but i don't have one anymore.
     
  14. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    Great. I'll go with the 4opamp IC and build both at the same time, pending the results of software mitigation.
     
  15. LethalCorpse

    LethalCorpse Member

    Joined:
    Mar 23, 2003
    Messages:
    3,749
    Location:
    Cambridge, Massachusetts
    Test them one at a time though, problems with one will affect the other.
     
  16. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    Thanks. I'll buy the stuff tomorrow and update.
     
  17. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    Ok, These are the components (DSE cat numbers) that i'll go and buy. Hopefully this will work :)
    Questions:
    Does the ground get connected to normal case ground? And also, i assume that the input comes from the leg 7 'tip' output of opamp 3 of the ECG, and goes in next to C1 of the notch filter. The output of the notch filter then goes in next to R1 of the low pass filter. Then, the output of the pass filter goes to the tip of the audio cable.

    Quantity/Component/Can be made from

    2 X 330n 6 X R2400 (.01uf) and 6 x R2360 (.1uf)
    2X 193k 2 X R0628 (150k) and 2 X R0615 (43k)
    2X 9.65k 2 X R0602 (15k) and 2 X R0608 (27k)
    2X 10k 2 X R0598
    1 X TL074CP 1 X Z6034 and IC Holder
    1 X Board

    1 X 2.79k R0583 (2k4 res) and R0564 (390R)
    1 X 18.1k R0601 (13k) and R0591 (5k1 res)
    1 X 68n R3023 (68n)
    1 X 160n R2629 (150n) and R2055 (10n)
    1 X 2.57k R0585 (3k0) and R0604 (18k)
    1 X 16.5k 2 X R0612 (33k)
    1 X 43n R2055 (10n) and and R2325 (33n)
    1 X 240n 2 X R3026 (120n)
     
  18. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,290
    Location:
    Sydney
    Do DSE still sell components, or even have stock of them?
     
  19. OP
    OP
    mhgarage

    mhgarage Member

    Joined:
    Feb 22, 2005
    Messages:
    1,080
    My local does - it's very much a self service thing though. The staff don't know what the components are, but i seem to be the only one who purchases them - hence i know where they all are :)
     
  20. Odje

    Odje Member

    Joined:
    Jun 27, 2001
    Messages:
    2,290
    Location:
    Sydney
    I don't think DSE stores will be restocking components after they run out as its not in line with their plan to become a Hardly Norman type store. Additionally the staff won't know what component has run out let alone what to re-order.
     

Share This Page