Sonsivri

Electronics => General Electronics => Topic started by: TucoRamirez on February 05, 2013, 07:33:36 07:33



Title: ecg conditioning
Post by: TucoRamirez on February 05, 2013, 07:33:36 07:33
hi

I'm thinking about designing a portable ecg unit, but i'm affraid about 2 or 3 dummie's things (after reading i'm still confused btw)0:

1:  Two lead or 3lead testprobe??
2:  If i can use 2 leads for test purposes, wher i must place it in my chest???
3:  why if i put leads on the two corners of my chest even, i only recover a 60 hz amplified and homogeneous signal at the output of the ad8237 ??? ( i followed the schema of the datasheet btw, except that i put 3.3V !!)

Am i doing something bad putting the AI to work at 3.3 ? or there's some conspiration against me each time i use more than 3 opamps in a board?


Title: Re: ecg conditioning
Post by: LabVIEWguru on February 06, 2013, 01:09:51 01:09
Willem Einthoven (21 May 1860 – 29 September 1927) was a Dutch doctor and physiologist. He invented the first practical electrocardiogram (ECG or EKG) in 1903 and received the Nobel Prize in Medicine in 1924 for it. (Today he would be considered a hacker!)

Where to place the electrodes is named after Dr. Einthoven.
Many experimental devices are two lead + ground or three lead + ground.

http://www.n3wt.nildram.co.uk/ECG/
http://medical-dictionary.thefreedictionary.com/Einthoven%27s+triangle

http://www.cisl.columbia.edu/kinget_group/student_projects/ECG%20Report/E6001%20ECG%20final%20report.htm
(nice explanation - shows use of optoisolator to prevent electrocution)

This is very easy to do. Look at Analog Devices website for "Instrumentation Amplifier." I think the AD620 had a very simple ECG circuit that worked very well.

If you have problems with 60 Hz many biomedical circuits used a "Right Leg Drive" circuit. Because of Common Mode rejection of op-amps you could drive the ground (attached to you) with the interfering circuit to cancel it out.

ALWAYS USE BATTERY POWER! Sometimes foolish people use AC to power their circuit, then they die from electrocution and someone finds them later after they start to smell bad and swell up. ALWAYS USE BATTERY POWER for experiments like this. I almost forgot - you will need a bipolar power supply. Two 9 volt batteries (or whatever) should last a long time.

Lastly, I just typed "ECG Circuit" into the search engine and looked at "images." There are many good examples from very simple to very complex.

I hope this helps.


Title: Re: ecg conditioning
Post by: solutions on February 06, 2013, 02:21:45 02:21
You're going to kill yourself/somebody. This is not something you should be messing with, even if it is on a battery. Why?

The questions you were asking about 0.5mA and +/-3V in the other thread, in combination with this question, asked at almost the same time, mean you are taking very great risks in killing someone if you get a circuit fault.

Don't do it.


Title: Re: ecg conditioning
Post by: TucoRamirez on February 06, 2013, 03:05:03 03:05

i see that +/- V  strategy works fine so far but i'm carving my brain about 3.3V and its reliability ^^ ...

And about electrifyting myself
C'mon let me die in a scientific way ^^  (even if i dream to die like a pimp in a party ^^)  !!

btw i tried the electrodes on myself but i get only noise (off course i tried with a signal generator on the amp and i recovered the signal amplified at the output of the first amplifier (instrumentation one/8237) (putting the generator on +/- of the opamp as in the datasheet ...

But putting my epic chest on the circuit ... (yep battery operated! )  i gathered just rubbish :( ...  weird!!!

then i added a double T passive filter and test with generator was quite good ... but 2 lead test was rubish, i get some 60hz spikes (dont care so much)  and a strange 1KHz signal coming from ... outer space???

anyway i will test with the virtual ground coming back to my ... feet ^^  ... maybe i'm filltering like an idiot and losing important signal somewhere

 


Title: Re: ecg conditioning
Post by: Hrdwr_Adct on February 06, 2013, 03:13:10 03:13
Just my two cents

If you know what you're doing it can be done. (some of us know how to design "intrinsically safe" products)

Enjoy

http://www.swharden.com/blog/2009-08-14-diy-ecg-machine-on-the-cheap/ (http://www.swharden.com/blog/2009-08-14-diy-ecg-machine-on-the-cheap/)

I have built the cheap electrodes and they do work......sorta   ::)


But I agree with Solutions...if you have a lot of questions or aren't sure what you're doing you'll probably end up learning the easy way :o, and probably make the bigger mistakes only once. hehe

H_A


Title: Re: ecg conditioning
Post by: Ichan on February 06, 2013, 03:51:09 03:51
1:  Two lead or 3lead testprobe??
2:  If i can use 2 leads for test purposes, wher i must place it in my chest???
3:  why if i put leads on the two corners of my chest even, i only recover a 60 hz amplified and homogeneous signal at the output of the ad8237 ??? ( i followed the schema of the datasheet btw, except that i put 3.3V !!)

1. Two should work, three must be more fun (agree Mr. Solutions?)
2. If the system is good, practically it can be anywhere.
3. Which schematic? If it is Fig. 77 then perhaps you miss the words "Proper decoupling is not shown", how is the pcb layout? 3.3V should be no problem.


But putting my epic chest on the circuit ... (yep battery operated! )  i gathered just rubbish :( ...  weird!!!
then i added a double T passive filter and test with generator was quite good ... but 2 lead test was rubish, i get some 60hz spikes (dont care so much)  and a strange 1KHz signal coming from ... outer space???
anyway i will test with the virtual ground coming back to my ... feet ^^  ... maybe i'm filltering like an idiot and losing important signal somewhere

So your body is very noisy? Too many sins perhaps...  ;D. Seriously, i mentioned before on the other thread human body is very noisy substance, it is a large antenna broadcasting many things like anger, love, hunger, etc...  :o

The Fig. 77 of the datasheet already implement the right leg thing, this one should work but i think it will need low pass filter to follow.

Twin T is a notch filter, not usually used on ECG as it can attenuate the ECG signal, many do this hum filter digitally (FIR and her friends) so it will be easy to tune.

Lastly, search for MSP430 EKG app note - as i remember it is a good reference to learn.

-ichan


Title: Re: ecg conditioning
Post by: TucoRamirez on February 06, 2013, 04:05:40 04:05
I tried to do this :::: see attached ...  maybe i missed some values :'( anyway


Title: Re: ecg conditioning
Post by: Gallymimu on February 06, 2013, 04:48:01 04:48
Traditional right leg drive will certainly make it easier.  As mentioned by others follow proper safety precautions to make this safe.  That said it isn't that hard and was done as a student project for biomedical instrumentation labs at our local university... They wouldn't do it if there was a huge risk. 

You definitely want to use input isolation and a low voltage battery powered system since there is some risk of injury

your measurements will be very sensitive to physical movement.
keep your leads as twisted pairs as much as possible.
60 (or 50 depending on country)Hz notch filter will be a big help.
limiting bandwidth with be much easier, start with lower bandwidth and work up after you get some descent signals
use an instrumentation/differential amplifier
make sure of your positioning of the electrodes to maximize the electric field detected.


Title: Re: ecg conditioning
Post by: solutions on February 07, 2013, 03:19:47 03:19
...and you'll have to explain shaving your legs and chest to your father

(http://s8.postimage.org/t1hfryw05/Hairy_Man.jpg)

i.e. good skin contact is essential. Shaving, sometimes exfoliating the top skin layer, are ways to get a better signal, especially if the subject is being stressed on a treadmill or hamster wheel

http://www.youtube.com/watch?v=q7cZgcQx12w


Title: Re: ecg conditioning
Post by: mare69 on February 07, 2013, 05:27:16 05:27
i.e. good skin contact is essential. Shaving, sometimes exfoliating the top skin layer, are ways to get a better signal, especially if the subject is being stressed on a treadmill or hamster wheel

Not necessarily. Can you imagine self adhesive ECG electrodes on badly burned chest?



Title: Re: ecg conditioning
Post by: Ichan on February 10, 2013, 10:30:48 10:30
I tried to do this :::: see attached ...  maybe i missed some values :'( anyway

Just a quick look on it, are decoupling caps exist on the real circuit? I have a feeling that the circuits around ref input of the IA need to be reworked.

-ichan


Title: Re: ecg conditioning
Post by: Sideshow Bob on February 10, 2013, 12:07:44 12:07
You're going to kill yourself/somebody. This is not something you should be messing with, even if it is on a battery. Why?

The questions you were asking about 0.5mA and +/-3V in the other thread, in combination with this question, asked at almost the same time, mean you are taking very great risks in killing someone if you get a circuit fault.

Don't do it.
Now now...safety is important. But we should not exaggerate. Using baterries like two nine volt cells. And say a laptop computer on batteries will NOT in any way be harmful. Unless your chest is open so the supply voltage can come in contact with the heart.
Another thing TucoRamirez. Do you use proper medical grade electrodes. You should also know that electrodes not kept in an small airtight container will dry out very quickly. And become useless. What kind of electrodes are you using. That can be very important. Also What is the source for your circuit. Any link you can post.
 


Title: Re: ecg conditioning
Post by: solutions on February 11, 2013, 09:43:09 09:43
Wut?

You're saying that a laptop battery cannot deliver 300mA in a fault condition in a home-made circuit where the guy happens to have a 500mA bridge driver nearby on the same board? All you need is some idiot spilling saline into the vents of the enclosure of this widget. He already has a piece of circuitry sending 500mA from a low impedance H-bridge out of the box.

I said FAULT CONDITION - that's what medical design is about - making the improbable, impossible.

"At currents as low as 60 to 100 milliamperes, low-voltage (110-220 volts), 60-hertz alternating current traveling through the chest for a split second can cause life-threatening irregular heart rhythms. About 300-500 milliamperes of direct current is needed to have the same effect."

-"Electrical Injuries." The Merck Manual of Medical Information: Home Edition. Pennsylvania: Merck, 1997.

Current through the chest. Has zero to do with voltage, and everything to do with skin resistance to that nice juicy salty stuff right underneath it, and then the path it takes.


Title: Re: ecg conditioning
Post by: TucoRamirez on February 11, 2013, 10:45:25 10:45
OMG !!

Don't worry, test are stopped till wednesday ... 

electrodes are medical grade ones

anyway i think i'll go back to desktop to check what i did wrong (decoupling Vcc cond are present for each circuit but i still have noise from my body, and a little signal from approx 600ms period like, but i cant recover a big swing signal after amplifying it after the InA... :(  maybe i have to use three electrodes scheme to be ok ... or maybe i'm a cyborg and i'm constating that i have no heart !!  (wtf )





Title: Re: ecg conditioning
Post by: zac on August 26, 2013, 04:44:42 04:44
Wut?

You're saying that a laptop battery cannot deliver 300mA in a fault condition in a home-made circuit where the guy happens to have a 500mA bridge driver nearby on the same board? All you need is some idiot spilling saline into the vents of the enclosure of this widget. He already has a piece of circuitry sending 500mA from a low impedance H-bridge out of the box.

I said FAULT CONDITION - that's what medical design is about - making the improbable, impossible.

Typical body resistance between 2 electrodes is at least 10K ohms and typically more.  ECG electrodes are not designed to be low impedance so typical might be 50K ohms.  It would take a high voltage, certainly more than 9V, to deliver a harmful level of current even if directly coupled to those electrodes.  As long as one avoids AC mains power, there should be no risk.  


Title: Re: ecg conditioning
Post by: solutions on August 26, 2013, 08:35:01 08:35
Spill some saline and get back to me.

The real world is not as benign as you'd like to believe. Unfortunately, it's the idiots who seem to survive, so you have to idiot proof items that MIGHT be deadly.


Title: Re: ecg conditioning
Post by: TucoRamirez on August 26, 2013, 10:10:33 10:10
In order to test and learn, a colleeague broughtme his ekgshield from olimex and seems to work ok.  but their electrodes are not the standard ones.... so i have two updated questions :
1:  how the ecg real cables are wired cuz Igot a cutted one and each electrode has 2 or three wires each !  but the jack has only 3 pins (???)

2:  what about more than 3 probes conditioning??  i mean i can conditionate 2 wires + reference wire with an OPAMP and etc etc but for 4 electrodes + reference, what to do?  do i have to replicate the same sch and just take the diff of the 2 other wires and the reference??

best regards


Title: Re: ecg conditioning
Post by: geconom on August 26, 2013, 10:46:46 10:46
I think the 3 leads go left arm, right arm and either right or left foot (I am not sure) for neutral. Do they not send a manual? Apart from them, in hospital environment, 6 more cables are placed around the heart plus one for the other foot (for a total of 10) but I do not know if Olimex support this.


Title: Re: ecg conditioning
Post by: Sideshow Bob on August 26, 2013, 11:02:59 11:02
Spill some saline and get back to me.

The real world is not as benign as you'd like to believe. Unfortunately, it's the idiots who seem to survive, so you have to idiot proof items that MIGHT be deadly.
This is waffling. As long as the as the stratum corneum and the rest of the epidermis is intact. It will be no danger to do ECG experiment on your self using a lap-top on batteries and 9 volt batteries for the ECG front end. Saline spill or not. As a protective measure you could place some 100K resistors in series with the electrode cables. However such a setup should never be used on any real patients.
@TucoRamirez! Have you done some serching on the sites to the major opamp producers like Analog Devices. The all have some application notes ECG amplifiers setup that you may find useful


Title: Re: ecg conditioning
Post by: intel on August 26, 2013, 11:38:26 11:38


This is a very interesting topic! :)



The linked sites, you may be interested.

For very simple:
http://members.home.nl/zekitez/ecg/diy.html (http://members.home.nl/zekitez/ecg/diy.html)

For electrodes:
http://www.eng.utah.edu/~jnguyen/ecg/long_story_5.html (http://www.eng.utah.edu/~jnguyen/ecg/long_story_5.html) or all http://www.eng.utah.edu/~jnguyen/ecg/ecg_index.html (http://www.eng.utah.edu/~jnguyen/ecg/ecg_index.html)

others:
http://www.diyhappy.com/homemade-ekg (http://www.diyhappy.com/homemade-ekg)

http://www.instructables.com/id/DIY-EEG-and-ECG-Circuit/ (http://www.instructables.com/id/DIY-EEG-and-ECG-Circuit/)

http://www.neozap.com/ (http://www.neozap.com/)






Title: Re: ecg conditioning
Post by: Gallymimu on August 26, 2013, 06:30:53 18:30
Read IEC-61010-1 (medical electronics safety) and you can make it safe.  It's a brisk 700 page read.


Title: Re: ecg conditioning
Post by: LithiumOverdosE on August 27, 2013, 01:45:29 01:45
Do you know where to get that IEC directive?


Title: Re: ecg conditioning
Post by: Gallymimu on August 27, 2013, 02:27:54 02:27
I have a copy but it has customer serialization on each page that I don't know how to remove easily.  Any easy tools for automating that?


Title: Re: ecg conditioning
Post by: TucoRamirez on August 27, 2013, 03:12:22 03:12
700pages read!!!   not this month, i'm doing some works with LayoutXL ^^ and my single neuron for reading books is busy drawing guard rings and placing metal over metal ^^


Title: Re: ecg conditioning
Post by: Gallymimu on August 27, 2013, 04:24:02 04:24
700pages read!!!   not this month, i'm doing some works with LayoutXL ^^ and my single neuron for reading books is busy drawing guard rings and placing metal over metal ^^

:) there is NOTHING more important than safety, best 700 pages you'll ever read!

BTW 700 pages is only Part 1.


Title: Re: ecg conditioning
Post by: Sideshow Bob on August 27, 2013, 08:28:07 08:28
:) there is NOTHING more important than safety, best 700 pages you'll ever read!

BTW 700 pages is only Part 1.
Well you do NOT have to read all 758 pages. Unless you are very Francophile that is

Posted on: August 27, 2013, 09:12:11 09:12 - Automerged

700pages read!!!   not this month, i'm doing some works with LayoutXL ^^ and my single neuron for reading books is busy drawing guard rings and placing metal over metal ^^
So you do not want to read regulations, but still want to create medical equipment. For sure you will not last very long in the medical instrumentation industry :o. Sorry if I am slow but is this just some experimenting or is it something that will be used on real patients


Title: Re: ecg conditioning
Post by: TucoRamirez on August 27, 2013, 01:49:25 13:49
hey i didn't say that i don't want to read it !!!  of course yess!!  But i have other stuff in parallel and i'm waiting for the arrival of the electrodes since 4 weeks ago ... so i soldered my testboard but i can only use the olimex electrodes and.. they  are not good they bounce and move a lot (and they have a telephone cord spiral part that makes a full adventure to put it out of its box!!!)

this what i got with that electrodes attached to my arms and leg... btw


Title: Re: ecg conditioning
Post by: Sideshow Bob on August 27, 2013, 02:20:49 14:20
I have some bits and bobs regarding regulations in the link attached. However this link is only meant for Sonsivri members. So do NOT post this link in other forums. I will keep on eye on how many times the link has been downloaded. Compared to the number of downloads from Rapidshare. If I see a large discrepancy here. I will delete it. If you want to share create your own upload capisce!


Title: Re: ecg conditioning
Post by: TucoRamirez on August 27, 2013, 02:26:47 14:26
capisce Commendatore Roberto !!