EEVblog #660 - Electrocardiogram (ECG) Experiments - Page 1
Forum section: electronics / general

author: EEVblog
author_rank: Unknown
timestamp: September 05, 2014, 07:24:45 am
content: Some experiments with the Electrocardiogram (ECG) circuitry in the St Jude Pacemaker Monitor Heart Rate Analyser.

author: bktemp
author_rank: Super Contributor
timestamp: September 05, 2014, 08:19:14 am
content: 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.

author: moemoe
author_rank: Regular Contributor
timestamp: September 05, 2014, 08:47:42 am
content: 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?

author: Someone
author_rank: Super Contributor
timestamp: September 05, 2014, 09:22:15 am
content: Quote from: bktemp on September 05, 2014, 08:19:14 amMeasurement trend plot on a scope could quickly decode those, but on the Agilent DSOX/MSOX scope the feature isnt available in roll mode.

author: EEVblog
author_rank: Unknown
timestamp: September 05, 2014, 09:37:24 am
content: Quote from: bktemp on September 05, 2014, 08:19:14 amI 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.

author: EEVblog
author_rank: Unknown
timestamp: September 05, 2014, 09:39:18 am
content: Quote from: Someone on September 05, 2014, 09:22:15 amYeah. Haven't looked into if the Tek MDO can do it.

author: owiecc
author_rank: Frequent Contributor
timestamp: September 05, 2014, 09:43:32 am
content: 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.

author: Andy Watson
author_rank: Super Contributor
timestamp: September 05, 2014, 10:41:35 am
content: Quote from: moemoe on September 05, 2014, 08:47:42 amExactly! 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.

author: rs20
author_rank: Super Contributor
timestamp: September 05, 2014, 12:11:57 pm
content: Quote from: bktemp on September 05, 2014, 08:19:14 amI 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.Quote from: owiecc on September 05, 2014, 09:43:32 amYeah, this would be easy and fun to decode!Quote from: Andy Watson on September 05, 2014, 10:41:35 amThe 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.

author: DrSchweizer
author_rank: Newbie
timestamp: September 05, 2014, 12:19:36 pm
content: Hi DaveAgain just a medical feedback from a cardiologistThe signal you found is a perfect ECG, all you need is a high-pass filterYou can see the QRS complex and the T wave that follows it (see attached image).great video!-Schlomo

author: DrSchweizer
author_rank: Newbie
timestamp: September 05, 2014, 12:21:37 pm
content: Of course a low-pass filter, sorry.BTW, even the P wave can be seen.

author: babysitter
author_rank: Frequent Contributor
timestamp: September 05, 2014, 12:34:58 pm
content: 50 Hz notch filter might be the way to go?EDIT: And of course, battery-power it in the middle of nowhere!

author: Andy Watson
author_rank: Super Contributor
timestamp: September 05, 2014, 12:40:16 pm
content: Quote from: rs20 on September 05, 2014, 12:11:57 pmLiving 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.QuoteYes!

author: bktemp
author_rank: Super Contributor
timestamp: September 05, 2014, 12:47:00 pm
content: Quote from: rs20 on September 05, 2014, 12:11:57 pmI 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?

author: rs20
author_rank: Super Contributor
timestamp: September 05, 2014, 12:59:41 pm
content: Quote from: bktemp on September 05, 2014, 12:47:00 pmAn 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.

author: xchip
author_rank: Regular Contributor
timestamp: September 05, 2014, 01:31:08 pm
content: 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!

author: EEVblog
author_rank: Unknown
timestamp: September 05, 2014, 01:33:13 pm
content: Quote from: bktemp on September 05, 2014, 12:47:00 pmYes, 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.

author: EEVblog
author_rank: Unknown
timestamp: September 05, 2014, 01:35:23 pm
content: Quote from: xchip on September 05, 2014, 01:31:08 pmYes, 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.

author: nitro2k01
author_rank: Frequent Contributor
timestamp: September 05, 2014, 02:47:46 pm
content: Hmm, did you ever try pressing the wrist straps to opposite sides of your heart?

author: xchip
author_rank: Regular Contributor
timestamp: September 05, 2014, 03:19:37 pm
content: 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)

author: coppice
author_rank: Super Contributor
timestamp: September 05, 2014, 03:57:22 pm
content: 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.

author: Maxlor
author_rank: Frequent Contributor
timestamp: September 05, 2014, 11:33:23 pm
content: 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?

author: German_EE
author_rank: Super Contributor
timestamp: September 06, 2014, 08:46:24 am
content: Dave, you already have a suitable filter, the Stanford Research Systems unit.

author: SolarSunrise
author_rank: Regular Contributor
timestamp: September 07, 2014, 05:30:04 pm
content: Quote from: EEVblog on September 05, 2014, 01:35:23 pmMake 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

author: nixfu
author_rank: Unknown
timestamp: September 08, 2014, 02:45:42 pm
content: 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

author: d
author_rank: Newbie
timestamp: November 27, 2014, 12:03:40 am
content: Curious to see what FFT mode on the scope would have looked like at 21:45.