Hacker News new | past | comments | ask | show | jobs | submit login
Do-it-yourself EEG, EKG, and EMG (erkutlu.blogspot.com)
200 points by davidsmith8900 on Nov 14, 2013 | hide | past | favorite | 41 comments



I have been working with EKG on and off for ten years. I helped with this briefly: http://www.neozap.com/freeECG.htm I would love it if someone could produce a more 'rounded' piece of software.

I really love my 12-lead ECG machine I got for £10. It prints using thermal paper, and has an audio output that I put into the laptop mic input. It's not dangerous at all so you shouldn't be afraid. Sticky electrodes can be had for very little on ebay.

Happy to help others with their experiments.


That's really cool. Where did you get your ECG machine? I'd be interested in getting one if its that cheap.


good old ebay. It is a Nihon Kohden machine. comes in a brown briefcase. It's old enough not to have an lcd screen, but with the output going into a laptop, it is possible to record your ecg readout. sticky electrodes are by Ambu blue (x50 for £5 on ebay).


There are some really good cheap prosumer level EEG devices on the market now, for example the Avatar EEG (http://avatareeg.com/) and a few of the Emotiv devices.

I've been working on a side project (https://octopusmetrics.com) that allows you to connect these devices to your computer to record, visualize and analyze your EEG data in the browser. I think it's great that there are people out there thinking about how to do this more cheaply as it'll bring _real_ EEG devices into the price range where it'll be more available to hobbyists.


There are lots of useful applications which should prove at least harmless, if not even beneficial.

For example with an EEG sensor you can do neurofeedback training to improve attention, which has been shown to help with ADHD and even epilepsy, among other things. For this purpose, the Neurosky Mindwave Mobile with its low price tag and bluetooth interface is certainly a better choice than any homegrown amplifier.

For EMG, besides controlling something, feedback training is also possible. For example when EMG sensors are attached to your shoulder muscles you can teach yourself to actually relax them. The computer can then alert you to unconscious tension building up, during typing for example.

I don't know if ECG (I think that's the correct English spelling) has been shown to be useful in biofeedback, but the trainability of heartrate is well known.


Regarding EEG, that's what we're working on at Three Pound. We're providing tools for mindfulness based stress reduction paired with consumer EEG devices like the NeuroSky Mindwave Mobile http://threepound.com


If you're interested in playing with EEG, you might want to also check out the new Emotiv Insight headset:

http://www.kickstarter.com/projects/tanttle/emotiv-insight-o...


Very interesting. You may also want to look into Bitalino http://www.bitalino.com it's an Arduino like approach to playing/hacking with biomedical signals, at a fraction of the cost this kind equipments usually has.


I have been under the impression that doing this kind of thing is not that difficult (as explained here) but somewhat "dangerous" in that if you get the wiring at all wrong and accidentally apply even a small amount of current you can confuse the heart and get it to damage itself. I do not see any paragraphs here of "dire warning" or even any specific mentions of parts of this process being dangerous, just a comment that "it seems to me almost impossible that anybody could injure themselves", which I'm finding strange ;P.

Here is a much older article from 2003; it begins with a dire warning.

http://www.eng.utah.edu/~jnguyen/ecg/ecg_index.html

> This device requires you to strap electrodes across your chest. This is inherently dangerous. Both because of the pain caused by sticky tape pulling hairs out of a person's body and also because even small currents can kill. Do not attempt this experiment unless you fully understand the potential problems with this device.

Here is another article from 2007; again, it begins with a dire warning.

http://web.archive.org/web/20070324054626/http://www.e-dsp.c...

> Before I continue to explain what I did, I would like to WARN you! 500mA (miliAmps) on 220V will completely destroy your nervous system (so run it from battery supply), check everything twice and you are responsible for it on you own.

In this article from 2013, there is a rather extensive back/forth paragraph ;P.

http://www.swharden.com/blog/2013-04-14-simple-diy-ecg-pulse...

> If you’re worried about electrical shock, or unsure of your ability to make a safe device, don’t attempt to build an ECG machine. For an ECG to work, you have to make good electrical contact with your skin near your heart, and some people feel this is potentially dangerous. Actually, some people like to argue about how dangerous it actually is, as seen on Hack-A-Day comments and my previous post comments. Some people have suggested the danger is negligible and pointed-out that it’s similar to inserting ear-bud headphones into your ears. Others have suggested that it’s dangerous and pointed-out that milliamps can kill a person. Others contest that pulses of current are far more dangerous than a continuous applied current. Realists speculate that virtually no current would be delivered by this circuit if it is wired properly. Rational, cautionary people worried about it reduce risk of accidental current by applying bidirectional diodes at the level of the chest leads, which short any current (above 0.7V) similar to that shown here. Electrically-savvy folks would design an optically decoupled solution. Intelligent folks who abstain from arguing on the internet would probably consult the datasheets regarding ECG input protection. In all cases, don’t attach electrical devices to your body unless you are confident in their safety. As a catch-all, I present the ECG circuit for educational purposes only, and state that it may not be safe and should not be replicated There, will that cover me in court in case someone tapes wires to their chest and plugs them in the wall socket?


No real danger for EEG if powered from an isolated laptop.

ECG can cause safety issues if there is a significant current across the sensor leads, but even that is unlikely unless the completely wrong resister values used and the person hypothetically has a heart condition.

Disclaimer: I'm not a physician, neurosurgeon or lawyer. I did however design and repair EEG systems.


You are incorrect. This circuit can potentially apply unsafe currents across the patient. A standard medical biopotential measurement circuit will have single-point failure protection to prevent conditions like this. This is required by standards like EC11, EC13, and 60601. Those systems are extremely safe.

Most hobbyist designs, like the one in this article, do not have such protection. Indeed, for this particular circuit, a simple static discharge, as might happen when you're applying the electrodes after walking over carpet, can fry the input amplifier, connecting it to the power rails. ESD (and, indeed, defibrillation -- which is about a thousand times more energy than ESD) protection would be present and required in any medical biopotential amplifier, even unrelated to the single-point protection described above.

If the ESD failure happens to short out to power rails, your current will be your power rails divided by your electrode impedance. This distribution is described in EC11/EC13 (although electrode technology has improved since the days when those tests were done, so impedance is even lower). Even with the ancient electrodes in EC11/EC13, you would get unsafe currents some of the time. With modern electrodes, you would get unsafe currents much of the time.

I've seen dozens of circuits for home EEG/ECG/EMG. Almost all of them, including this one, are a deathtrap. They will work okay most of the time. At some point, someone's going to kill themselves.

Disclaimer: I am not a physician, but I've designed ECG circuits all the way through safe, successful human trials.


Your talking potentially "unsafe" vs somewhat likely hazard.

Most of the "danger" comes from poor isolation. The skin resistance is too high for EEG to cause major problems. I realize the actual standards have requirements that are detailed and somewhat strict.

The difference is that ECG has sensors that can directly put current through the path to the heart so the risk is higher if there is a worse-case ESD latchup. 5mA is enough to stop a heart in certain conditions.

EEG isn't ECG or EMG and have different characteristics even though they seem vaguely similar.

PS. My contact info is in my profile.


Skin resistance is quite low. You are thinking skin-electrode impedance. That is generally high enough to be safe, but with modern electrodes and luck, it can get somewhat low too. 5v 1k 5mA would not be unreasonable.


Do you know any hobbyist design that can be built safely?


Sure. Have your entire kit powered by a AA batteries. Any connection to the outside world should be either radio-only (wifi/bluetooth) or optical. That way, there's no electrical path that can carry current from a device that's plugged into the wall to your body. In the worst case, you'll have a pair of AA batteries tied to your body, which should be a negligible risk.


AA batteries are a negligible risk when you touch metal with skin. That resistance is very high. Resistance inside your body is much lower -- 100 ohms is typical. If you were to get 0.5v between you arms, you could get unsafe currents.

With electrodes, the current can be /much/ greater than touching metal wires with a finger. Single-digit kilo ohms is typical. The big ECG paddles are tens of ohms, probably.

Another way to think about it -- have you ever felt even a 24v battery? No. Now You know that 9v tingling on your tongue? That's saliva and a tiny contact area. Now think of a large patch of engineered electrolyte can do.


> [..] and the person hypothetically has a heart condition.

That alone is a massive problem - how do you know? Most people only discover things like this when things start going wrong. And if you make things go wrong, then you risk doing even more damage. I've never had any of the tests done professionally, but I imagine there is a certain amount of assessment that takes place before the tests are even conducted.


There is quite a bit of current in a laptop battery, enough to stop a heart.


But I believe that what kills you is the voltage and not the current.


Actually it is the current.


Apparently it is not that simple to conclude, yeah the current burn tissues but you need certain amount of voltage to break the human body resistance:

http://www.allaboutcircuits.com/vol_1/chpt_3/4.html


Here's an article from analog devices (who make the AD620 used in the article) http://www.analog.com/library/analogdialogue/archives/37-11/...

It has some background as well as an example circuit with a discussion of safety and isolation issues which is a bit more in-depth than the posted article.

For the posted schematic: at least put some current limiting resistors on the electrode leads.


Could be good for practising meditation - learning to not be influenced by auditory influences. I love my old jumble sale £10 ecg machine. I would love it if someone made a more 'rounded' software. Something useful for medical diagnostics.

Free ECG software: http://www.neozap.com/freeECG.htm

Neuralfeedback training: http://vimeo.com/69318799


Thats really interesting and would add another dimension to these "self monitoring" devices but i am skeptical as too much self monitoring can do more harm than good.

DIY EEG/EMG can be used for alot of interesting applications though, if you want to play around with "mind controlling" things ;)


I'm a physician and I agree. Obtaining data is the easy part, interpreting the data is the hard part. If you want solve interesting problems that's where you should look.


Yes my immediate concern was that GP clinics could be inundated with the worried well who simple couldn't tell the difference between an 8K and an 80K resistor. However, I doubt many people will actually go ahead and build one of these and, quality control aside, the article does show just how relatively simply some of these devices can be made.

Generally though it does rather seem that there is going to be an increase in the amount of data that patients bring to clinic; what may appear to be little more than silly iPhone apps today might well become the important monitor tools of tomorrow. My guess is that this will create opportunities for online analysis startups to perform data triage an initial review, turning the data into something more valuable.


But you need the data first, where better to get it than yourself?


In a larger sample, but it's usually more expensive. That being said, self experimentation is fun. Very fun :-).


If I could just control paredit with my face muscles, I think I'll be happy.

Edit: To be clear, there will be no actual barfing or slurping involved.


Wink left or right to open and close the parentheses :-).


This reminds me of the AliveCor device, which excites and frustrates me. I'm excited because I'm hopeful that when such monitoring becomes dirt cheap and unobtrusive, people might find conditions earlier and have a better chance to treat them. I'm frustrated because in the U.S. it currently requires a prescription from a doctor to buy one. This feels like regulatory nonsense to me. It seems like an obviously low risk that this could do any harm.

I'm a bit hopeful it will go on sale in some other country soon that doesn't require a prescription and I can have one shipped to me.


I got one for free for a demo and while it was interesting, I can't think of a good use case. A single lead ECG is not useful for much more than heart rate, and there are already many interesting ways to get that ( light sensor on phone ) that i dont know if it has much more utility from extra hardware. Perhaps if you have lqts, it can flag it but otherwise very very few usecases.


Misinterpreted knowledge could be more harmful then ignorance (as any hypochondriac would know), but that's not the case here - I'm really looking forward to trying to build something like this.

It's nice to see DIY moving from blinking lights to really useful and serious areas.


Last time I had an EMG involved 45 minutes of a doctor poking needles into me to measure current. Moderately uncomfortable, and does not seem feasible to do on oneself. I assume this one just involves an electrode on the skin? Is that even going to do anything?


Most difficult part of "personal EEG" going forward seems to be the pasting of the electrodes to the front and back of the scalp and the chest. In hospital, someone else does that for you.


EEG is an electroencephalography and measures electrical activity of the brain. Why would you put the electrodes on your chest for that?

I've had a few EEGs and there was never any on the chest. Proper placement would seem to be an issue.


You are right. The proper acronym is ECG.

I guess you've never had a polysomnography. There are electrodes placed on the scalp, chest and leg.


Dr House should be both delighted and worried by this. We are seeing the flowering of an age where sophisticated medical diagnosis is just a (well regulated and tested) app / dongle away. From on chip chemical analysis to home brew EEG the things that say a child born today in Africa will see connected to them will astound you and I.

I hope it it makes the difference between the infrastructure it has taken to build to get care within our reach and the less infrastructure available / needed in different corners of the world.


Projects like this suggest to me there is a combination of collusion and bs from the FDA driving up the cost of medical equipment in this country, as well as blocking innovation.


Having worked in the pharma industry, I can attest that there is no shortage of extreme risk aversion at the FDA. That being said, we just had an article here where someone claimed to have created a spreadsheet in pure javascript for some absurdly low number of lines of code. When you read through that thread there are all sorts of people pointing out that this isn't a real spreadsheet by any stretch. It merely looks like one, but is missing some pretty complex and necessary stuff. I would submit that what you see here is the medical device equivalent. There are no safety mechanisms, the system doesn't monitor itself for failure, there's no characterization of the limits of the system in various conditions, etc... That's fine because it's a hobbyist setup. But let's not kid ourselves about what it takes to have a reliable device that works in a hospital setting under a multitude of environmental conditions.

Things didn't end up the way they are by accident. The current situation is the result of decades of medical devices and interventions killing people because of faulty design. It's not unlike the situation with the FAA and airlines.


Nice innovation! But I still prefer the physicians to do it in case I would need to have an EEG, EKG or EMG in the future. Great info though!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: