Some experiments with the Electrocardiogram (ECG) circuitry in the St Jude Pacemaker Monitor Heart Rate Analyser.
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.
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?
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.
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.
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.
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.
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.
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.
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
Of course a low-pass filter, sorry.
BTW, even the P wave can be seen.
50 Hz notch filter might be the way to go?
EDIT: And of course, battery-power it in the middle of nowhere!
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.
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!
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?
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.
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!
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.
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.
Hmm, did you ever try pressing the wrist straps to opposite sides of your heart?
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)
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.
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?
Dave, you already have a suitable filter, the Stanford Research Systems unit.
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