Build Your Own ECG Heart Monitor


Our own Hack-A-Day emeritus took some time out from his showgirl pursuits to pass this along. The ECG was built to pad a resume, but it doesn’t make it less useful. Be warned, too much power could stop your heart. If you build one, triple check everything before wiring yourself up. Basically, an electrical differential is generated by the contraction of muscles in the heart. This slight signal is amplified by an op-amp and sampled with an A/D converter.

20 thoughts on “Build Your Own ECG Heart Monitor

  1. Dear god, please be careful with this. If you accidentally get connected to mains the incredibly low impedance offered by the electrodes can easily kill you. At very least have someone with you when you try it after quadruple-super checking it!

  2. An electrical differential is not generatad as the muscles contract; the heart muscle is stimulated by an electrical impulse that is created by Na- and K+ ions in specialized cells within the heart. It is this created impulse and it’s travel through a specialized electrical pathway within the heart that is measured as an ECG.

  3. Dear God! This is the worst ECG design I have ever seen! Reasons:
    -no Patient protection circuit
    -no isolation of the preamp
    -no DC offset handling at all
    -trashy low pass approach instead of using the CMRR of the AD620 (but how could he with this board)
    -horrible 50 Hz (Bosnia!) interference, he has to filter it out in LabView
    I can just recommend not to build this circuit. Its endangering your life in the moment you connect anything from it to: -power supply -PC -laptop. Why do such hacks appear on Hackaday? There was this crazy helmet with holes for LEDs too. Just as stupid as this one.
    He is neither the first one to do it nor is his implementation good. The performance is extremly lousy. Check out this much better made design with proper isolation:
    http://www.cn.stir.ac.uk/eegviewer//preamp/

  4. timberley is right

    With this design you won’t get much more information from the waveform than the pulse count, due to extensive phase distortion of the LPF set to 50Hz and the others. This way you declass the waveform to a happy-jummping green dot on you screen. You may add a treshold beeper and you’ll get The Monthy Python’s “Machine That Goes PING!” ;)

  5. There’s a Ramsey kit for this kind of thing that isn’t half bad (i.e. it basically works and probably won’t kill you) as long as you stick to using it with batteries and don’t attach it to anything line-powered at all.
    It’s pretty crude though and I don’t know if I’d trust an LM324 not to leak juice back through the electrodes. Caveat emptor.

    There was a Scientific American article on how to do this that is the cleanest amateur design I’ve seen:
    http://sciam.com/print_version.cfm?articleID=000C74E4-5172-1C74-9B81809EC588EF21

    Again, be very wary of hooking something like this up to your computer, scope, or any line-powered instrumentation. For this you must have better isolation than Carlson’s design: look at the EEG design posted from the University of Sterling above.

  6. Seriously, this is a horrible, horrible, “hack.” The heart is probably the second most important organ in the body (we’ll say the brain is #1, though even then you really only need a very small section of it to actually live,) and is very complicated. There are reasons that medical devices need FDA approval before they can be used, and have to be inspected 1-4 times a year. (For the record, ECG/EKGs are typically once a year.) One of the most important checks that gets done is the electrical safety check and electrode isolation test. Both of these tests make sure that no current goes from the line into the electrode/outside of machine (ie, into the patient.) This thing has nothing to protect whoever it gets hooked up. Part of me thinks this hack should be removed from hackaday for safety reasons, but the social Darwinist in me says that if someone is dumb enough to build it and hurts/kills themselves with it, even after reading the several warnings posted here, then by all means let him, it will only serve to raise the overall average world intelligence.

  7. wow…
    now how to make/were to buy them electrodes. what are they called?
    also were can i find out about ‘basic’ interpretation of the signal ur heart makes? (by basic i dont mean ‘it goes up when ur heart beats’)
    i love this hack… it so open to improvments… great idea and room left for me to make improvements ;) its an interesting project and its not all done with nothing left for me to do but copy it :D

  8. jeeeeeez, please don’t ever connect any electrical device via low-impedance electrodes placed directly over your heart that could possibly, possibly fail over and apply a voltage across you…seriously, this is a fairly pointless exercise – you can’t calibrate it, so you won’t get clinically significant results, even if you could it won’t be FDA-approved to you can’t use it on people, and real ECG’s aren’t that expensive.
    I’m all for tinkering, but don’t do this one…

  9. Theres a neurofeedback device that measures electrical activity in the brain, as a precaution the data is passed over an optical link, reducing the chance electrocution. Other units communicate over a bluetooth serial port link if you have the money and respect for your own life im sure you could combine one of those features with this hack.

  10. If you’re a research engineer, connecting research animals to line powered devices without isolation is prefectly acceptable. You just need to convince your friendly local IACUC that you most likely won’t harm the animal, say 1 in 10,000 odds.

    Humans are a different matter entirely, though this project is reasonably safe assuming the subject /isn’t/ grounded.

    You can stick your finger in a 115v socket and not feel a thing as long as you are properly ungrounded. I’ve done it. Nothing happened and I couldn’t feel a thing. 0.15 microamps was the fault current, standing on carpet, dry-ish skin, dry air (Arizona), and 5 feet from the walls. The same goes for this project.

    In order to get a serious shock, you need to have current flowing. For that to happen with this circuit alone (no other current paths or grounds), that would require the inputs to the computer’s serial port to have dangerous voltages across pins which would subsequently have to make it through the opamps into the subject. Fairly unlikely, but not impossible. Even with a significant power line leakage current into the ECG system, no shock would be had without another ground return path through the subject.

    If you want to be safe, just run this experiment on a battery powered laptop. Preferably, put the laptop’s powerpack in the next room.

    Sorry for the long response. I deal with these issues daily and there is so much misinformation out there.

    by CKThrop

  11. This is highly dangerous – potentially deadly.

    Ventricular fibrillation (i.e. heart failure) can be triggered by even small currents applied to the chest.

    http://en.wikipedia.org/wiki/Electric_shock

    This is the reason why medical equipment uses isolation e.g. optical.

    See his ECG Chain diagram where it’s labeled “ISOLATED AMPLIFIER”. His isn’t.

    Read some documentation for an AD620A:
    “Proper safeguards, such as isolation, must
    be added to this circuit to protect the patient from possible
    harm.”

    In short: if you do his hack you’re putting your life at risk.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.