Author Topic: EEVblog #660 - Electrocardiogram (ECG) Experiments  (Read 16712 times)

0 Members and 1 Guest are viewing this topic.

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
EEVblog #660 - Electrocardiogram (ECG) Experiments
« on: September 05, 2014, 07:24:45 am »
Some experiments with the Electrocardiogram (ECG) circuitry in the St Jude Pacemaker Monitor Heart Rate Analyser.

 

Offline bktemp

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: de
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #1 on: September 05, 2014, 08:19:14 am »
It looks like the analog signal is beeing digitised before it goes over the optocoupler using some simple pwm, pdm or fm modulation. Using digital signals the optocoupler is more linear than in analogue mode. This signal could be read directly by the microcontroller but it is probably much easier to add a lowpass filter to convert it back to analogue and then use the adc.

It could be interessting to power the circuit using the original isolation transformer using a signal generator and probing the (restored analogue) signal at the output of the optocoupler to see if it makes a difference. Since even the esd mat influenced the measurements, maybe the direct connection to the power supply or the scope disturbed the signal. The direct connection to gnd probably adds a too large common mode noise signal. Beeing completely isolated it is uneffected by common mode signals.
A teardown of the isolation transformer could also be interessting. Since this isolation barrier is larger than in the medical grade power supply I presume even more insolation stuff with low capacity between the windings.
« Last Edit: September 05, 2014, 08:48:47 am by bktemp »
 

Offline moemoe

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #2 on: September 05, 2014, 08:47:42 am »
You're talking about your "isolated power supply" all the time, but in fact you're creating a ground reference through your oscilloscope, dont you?
https://github.com/maugsburger/
Breadboard Adapters featured in EEVBlog #573 on Tindie
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 4527
  • Country: au
    • send complaints here
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #3 on: September 05, 2014, 09:22:15 am »
It looks like the analog signal is beeing digitised before it goes over the optocoupler using some simple pwm, pdm or fm modulation. Using digital signals the optocoupler is more linear than in analogue mode. This signal could be read directly by the microcontroller but it is probably much easier to add a lowpass filter to convert it back to analogue and then use the adc.
Measurement trend plot on a scope could quickly decode those, but on the Agilent DSOX/MSOX scope the feature isnt available in roll mode.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #4 on: September 05, 2014, 09:37:24 am »
It could be interessting to power the circuit using the original isolation transformer using a signal generator and probing the (restored analogue) signal at the output of the optocoupler to see if it makes a difference.

I doubt I'd ever get a usable ECG signal out of it.
Seems like pushing brown stuff up a hill with a pointy stick with this design.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #5 on: September 05, 2014, 09:39:18 am »
Measurement trend plot on a scope could quickly decode those, but on the Agilent DSOX/MSOX scope the feature isnt available in roll mode.

Yeah. Haven't looked into if the Tek MDO can do it.
 

Offline owiecc

  • Frequent Contributor
  • **
  • Posts: 315
  • Country: dk
    • Google scholar profile
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #6 on: September 05, 2014, 09:43:32 am »
Simple f2v converter should do the trick. Dave, can you post a csv file with few second of LED signal? This can be easily decoded in MATLAB or sty similar.
« Last Edit: September 05, 2014, 09:46:10 am by owiecc »
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #7 on: September 05, 2014, 10:41:35 am »
You're talking about your "isolated power supply" all the time, but in fact you're creating a ground reference through your oscilloscope, dont you?
Exactly! Aside from the safety issues, you are also be introducing a huge common-mode signal into the input amplifiers. If you're going to ground reference the amplifier you will need to go to a three electrode system to stand any chance of getting a decent signal.
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #8 on: September 05, 2014, 12:11:57 pm »
It looks like the analog signal is beeing digitised before it goes over the optocoupler using some simple pwm, pdm or fm modulation.

I suspect FM (i.e., the comparator circuitry is implementing a voltage-to-frequency converter). It can't be PWM because the width looks to be 50%, and the frequency isn't steady; and it clearly isn't PDM.

Simple f2v converter should do the trick. Dave, can you post a csv file with few second of LED signal? This can be easily decoded in MATLAB or sty similar.

Yeah, this would be easy and fun to decode!

You're talking about your "isolated power supply" all the time, but in fact you're creating a ground reference through your oscilloscope, dont you?
Exactly! Aside from the safety issues, you are also be introducing a huge common-mode signal into the input amplifiers. If you're going to ground reference the amplifier you will need to go to a three electrode system to stand any chance of getting a decent signal.

The other interesting question is -- if my lab supply isn't medical grade, am I really technically safe touching my PCBs with both hands? It seems strange to be mentioning the special isolation measures taken by medical grade power supplies, then just pointing at a Rigol and saying "that's isolated, no problems there". I'm not actually fussed; a lightning strike while I'm holding a PCB is less likely than a fatal car crash by a long way probably, but it's interesting to consider.
 

Offline DrSchweizer

  • Newbie
  • Posts: 5
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #9 on: September 05, 2014, 12:19:36 pm »
Hi Dave

Again just a medical feedback from a cardiologist

The signal you found is a perfect ECG, all you need is a high-pass filter

You can see the QRS complex and the T wave that follows it (see attached image).

great video!

-Schlomo
 

Offline DrSchweizer

  • Newbie
  • Posts: 5
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #10 on: September 05, 2014, 12:21:37 pm »
Of course a low-pass filter, sorry.

BTW, even the P wave can be seen.

 

Offline babysitter

  • Frequent Contributor
  • **
  • Posts: 893
  • Country: de
  • pushing silicon at work
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #11 on: September 05, 2014, 12:34:58 pm »
50 Hz notch filter might be the way to go?

EDIT: And of course, battery-power it in the middle of nowhere!  :-DD
I'm not a feature, I'm a bug! ARC DG3HDA
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2084
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #12 on: September 05, 2014, 12:40:16 pm »
The other interesting question is -- if my lab supply isn't medical grade, am I really technically safe touching my PCBs with both hands?
Living is risky, you have to find the right balance! When I worked with similar equipment in a medical environment we used to distinguish between touching and attaching. Casually touching is less risky (due to poor electrical contact and the possibility of breaking the contact, possibly by involuntary action) than attaching electrodes. Any equipment that had "patient applied parts" had to have full medical grade power-supplies and appropriate isolation clearances.

Quote
It seems strange to be mentioning the special isolation measures taken by medical grade power supplies, then just pointing at a Rigol and saying "that's isolated, no problems there".
Yes!

 
 

Offline bktemp

  • Super Contributor
  • ***
  • Posts: 1616
  • Country: de
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #13 on: September 05, 2014, 12:47:00 pm »
It looks like the analog signal is beeing digitised before it goes over the optocoupler using some simple pwm, pdm or fm modulation.

I suspect FM (i.e., the comparator circuitry is implementing a voltage-to-frequency converter). It can't be PWM because the width looks to be 50%, and the frequency isn't steady; and it clearly isn't PDM.
I thought something like the signal you get out of a 555 when feeding a signal into its control pin: It is neither PWM, nor FM nor PDM. It is something in between. It changes frequency and also changes the duty cycle.
If it is FM, then it makes no sense to me why converting it back to analogue and using the adc. It would be much easier to measure the frequency directly with the dsp. Or is the adc not used for ECG at all?
 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #14 on: September 05, 2014, 12:59:41 pm »
It looks like the analog signal is beeing digitised before it goes over the optocoupler using some simple pwm, pdm or fm modulation.

I suspect FM (i.e., the comparator circuitry is implementing a voltage-to-frequency converter). It can't be PWM because the width looks to be 50%, and the frequency isn't steady; and it clearly isn't PDM.
I thought something like the signal you get out of a 555 when feeding a signal into its control pin: It is neither PWM, nor FM nor PDM. It is something in between. It changes frequency and also changes the duty cycle.
If it is FM, then it makes no sense to me why converting it back to analogue and using the adc. It would be much easier to measure the frequency directly with the dsp. Or is the adc not used for ECG at all?

An f2v converter isn't all that difficult to do, so implementing frequency measurement with a f2v converter + adc is not entirely ridiculous. But I agree that it might be a funny mix of things; we can be fairly certain that at least the frequency was changing though.
 

Offline xchip

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #15 on: September 05, 2014, 01:31:08 pm »
Hi guys,

I was able to get my ECG with just a differential amplifier and an op-amp. The data is displayed using Xoscillo, a software that makes your arduino work as an 'oscilloscope'

http://codinglab.blogspot.be/2013/07/my-heartbeat.html?

I hope this helps Dave get the ECG signal on his scope! :)
Cheers!

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #16 on: September 05, 2014, 01:33:13 pm »
I thought something like the signal you get out of a 555 when feeding a signal into its control pin: It is neither PWM, nor FM nor PDM. It is something in between. It changes frequency and also changes the duty cycle.

Yes, it's base frequency was changing all over the shop. Didn't get a chance to look at what was generating it, it seemed to be based somewhat on the probe effects, less the effect of the heart beat which seemed to modulate the already random wobble.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #17 on: September 05, 2014, 01:35:23 pm »
I was able to get my ECG with just a differential amplifier and an op-amp.

Yes, I already had plans to do this, and make my own probes and gel. I have a tube of AD623's lying around.
I remember playing around with ECG amps back in the early 90's.
« Last Edit: September 05, 2014, 01:40:22 pm by EEVblog »
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 843
  • Country: 00
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #18 on: September 05, 2014, 02:47:46 pm »
Hmm, did you ever try pressing the wrist straps to opposite sides of your heart?
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 

Offline xchip

  • Regular Contributor
  • *
  • Posts: 58
  • Country: es
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #19 on: September 05, 2014, 03:19:37 pm »
In my rudimentary tests, just holding the electrodes with my hands was enough to show the big peak in the oscilloscope. To get the full wave I did have to put the +/- electrodes in my shoulders. (My leg was ground)

Online coppice

  • Super Contributor
  • ***
  • Posts: 8642
  • Country: gb
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #20 on: September 05, 2014, 03:57:22 pm »
Somewhere downstream of the signal Dave found should be one after some serious 50Hz filtering. There might also be some serious <0.5Hz filtering to minimise muscle noise. He probably needs to do a better job of attaching the scope, so its ground doesn't mess things up. After that there will see a nice ECG waveform. You can already see the elements of it mixed up with the 50Hz. Opto couplers can be very linear, but the HCT74 and the modulated square wave signal you saw does seem to indicate they modulated the signal in some way to pass it across to the DSP.

Putting anything with impedances above a few 100k ohms on a static dissipative mat is asking for trouble. The extent to which they affect things may be puzzling if you look at the material resistance, but consider that charges dissipate across the surface of those mats pretty quickly. Charge will flow across the mat from any charged metal on a board which touches it. I'm surprised Dave was not well experienced with this. The static dissipative benchtops, which do not need a separate mat on top, seem to be much worse than the mats for upsetting impedance electronics laid on their surface.
 

Offline Maxlor

  • Frequent Contributor
  • **
  • Posts: 565
  • Country: ch
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #21 on: September 05, 2014, 11:33:23 pm »
The ECG signal at TP6 looks fine to me. After a 40Hz lowpass, you'll see a good signal, as DrSchweizer mentioned already. What you've seen on the scope is pretty much what I've seen for all the 2-electrode implementations I've examined. Yours actually seems rather good, DC stability and amplitude consistency is excellent.

I'm curious how they implement that filter. All implementations I've seen use a software filter, because you need a high filter order for good results (block 50Hz hum, but nothing at 30Hz and below in order to get good fidelity on the QRS complex), so its probably cheaper to do it in software. Then again, there are a large number of components on that board, maybe they do have some filtering on the board?
 

Offline German_EE

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: de
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #22 on: September 06, 2014, 08:46:24 am »
Dave, you already have a suitable filter, the Stanford Research Systems unit.

Should you find yourself in a chronically leaking boat, energy devoted to changing vessels is likely to be more productive than energy devoted to patching leaks.

Warren Buffett
 

Offline SolarSunrise

  • Regular Contributor
  • *
  • Posts: 93
  • Country: ua
  • Hi there!
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #23 on: September 07, 2014, 05:30:04 pm »
I was able to get my ECG with just a differential amplifier and an op-amp.

Yes, I already had plans to do this, and make my own probes and gel. I have a tube of AD623's lying around.
I remember playing around with ECG amps back in the early 90's.

Make your own gel and use boring Ag-Cl electrodes? That's no fun for an Engineer like you Dave... Why not take a step further and make active electrodes? Active Electrodes have a buffer circuitry built right on the electrode, thus you don't need gels like conventional Passive Electrodes to lower the skin impedance.

Check this research article here: www.isn.ucsd.edu/pubs/wh2010.pdf
« Last Edit: October 06, 2016, 01:46:29 pm by SolarSunrise »
 

Offline nixfu

  • Supporter
  • ****
  • Posts: 346
  • Country: us
Re: EEVblog #660 - Electrocardiogram (ECG) Experiments
« Reply #24 on: September 08, 2014, 02:45:42 pm »
This reminds me that I have always wanted to try the Ramsey Electronic ECG kit that can be connected up to your oscilloscope.

http://www.ramseyelectronics.com/Ramsey-Electrocardiogram-Heart-Monitor-Kit/dp/B00B1GFFH0
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf