Pages: 1 [2]   Go Down
Author Topic: Arduino ECG/EKG Heart Rate Monitor  (Read 17677 times)
0 Members and 1 Guest are viewing this topic.
Boston Suburbs
Offline Offline
God Member
*****
Karma: 16
Posts: 955
I am above your silly so-called "Laws", Mister Ohm.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please do be careful.. one of the many jobs I had over the years was as a "Holter EKG Analyst".  A Holter monitor is a 24-hour ECG, at the time they were recorded to audio cassette tape, these days solid state memory is used.  The job consisted of doing the sampling from the tape, and then software would pre-process about 90% of the data, processing "normal" beats/rhythm out by binning.  That left the remainder to be manually reviewed, whether you were looking at ectopic beats/conduction defects, or simply confirming that the data was bad due to muscular or contact noise.  The Holter recorders themselves were battery powered (for portability mainly), but still used optical isolation for safety reasons.  Particularly if you are attempting telemetry with people who potentially already have conduction/ectopy defects, applying ANY current to the body is just plain dangerous.  Of all the parts of your project, making sure the thing is ironclad safe is the most important thing to spend research time on..

Suffice to say what you are trying to do is very feasible, I did this work nearly fifteen years ago.  Even the computers processing the data off the tapes were 486DX's... I'm wondering if the little Arduino may just have the ability to screen (bin out) normal morphology, it's a matter of pattern recognition of a standard QRS complex, those are easy peaks to grab and don't vary a lot in timing unless you get some really funky Junctional ectopy or a full-on Bundle Branch Block.  Since that's a damn serious condition, just call 911 if you see it and don't worry about it project-wise.  It's important to track P and T outside of the QRS complex, as that's where you will see heart block (PQ interval elongation (I), dissociation (III), and Wenkiebach (II)).  ST interval gives you depolarization and refractory time, from which most ventricular conduction problems can be figured out.

At least that's what they taught us back in the day... immensely oversimplified.  The point is, the pattern recognition may not be out of the number crunching range of Arduino.. your EKG could autoscreen for many arrhythmias easily just by tracking QRS, morphology is a LOT harder but possibly do-able smiley-wink

One more thought- you may want to compensate for and detect external pacing.  The pacing spike is typically an overdrive of the base atrial pacemaker node rate- overpacing by a BPM or two keeps those nasty little atrial ectopics in refractory while the paced beat does the pump work.  The spike itself is what you might need to plan for.  If you're using a threshhold to detect QRS, then the pacing spike (being fast and high voltage, comparatively, to a natural atrial self-pacing P) can be misread as a QRS.  If this isn't ever seeing clinical or pacing use then you can probably disregard the issue.

Good luck and keep posting!
« Last Edit: December 23, 2010, 06:33:12 pm by focalist » Logged

When the testing is complete there will be... cake.

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

don't worry too much about the risk of shock from a ground lead that is not isolated. It is really quite hard to electrocute someone. That being said it is pretty easy today to make a fully isolated instrumentation amp. We were doing that 40 years ago and even then it wasn't impossibly hard. It is worthwhile to use ultra low noise op-amps and keep everything running on a few coin cells for absolute safety. The simplest safety system is to use a wireless connection as some of the forum have suggested. If you go to EEG signals then the noise becomes very important as the signals are 1/10 of the ECG ones.
Logged

Wigan, UK
Offline Offline
God Member
*****
Karma: 19
Posts: 814
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Very interesting.  If you add a pulseox if I think you'd be measuring everything that's easily automated.

Is this for fun or are you aiming at a commercial product?

If it's the latter, it's a great idea but you'll hit problems with medical institutions not wanting to dump their GE or WA dinamaps in favour of your device and running them in tandem is a bit pointless.
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Is this for fun or are you aiming at a commercial product?

I am doing this project for both fun and educational purposes.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am also working on a project like this, though I haven't got my Arduino, yet. I'm just using a sound card for now... by merely touching the exposed wires plugged into my sound card with my fingers and intensive filtering in Audacity, I'm able to clearly detect the "R" spike of the QRS complex, and thus a heartbeat... but nothing else is discernible... I'm working on the amplifier.


It occurs to me that it is quite often that a hobbyist is touching things like exposed wires when messing with circuits... and nobody is very worried about it. But once we're actually measuring a heartbeat, it becomes dangerous?

I think there are many parts of this issue with safety and optocoupling/isolation and why it's perceived and/or actually as risky:

1) Very few accidents have occurred, but because they were caused in hospitals with plenty of people to blame (nurses, doctors, technicians, equipment manufacturers, etc) with lots of money behind them, it becomes a big legal liability problem. Hobbyists typically have no one to blame than themselves, and the rare accident that DOES happen may never be reported or the hobbyist, if they survive, may just brush it off or never even realize the danger they were in versus suing the hospital into the ground for an accident and causing a media sensation, even if the accident causes no (permanent) damage.

2) Early electrical equipment was overall far less safe than modern equipment... Electrocutions in general were far more common (for those with electricity) because of unsafe grounding practices that are now very rare except in antique equipment. Also, vacuum tubes were used for power supplies, amplifiers, etc. Vacuum tubes, even on amplifier circuits, almost always operate at high, dangerous voltages. Electrical wiring may not have been done by licensed professionals at the time, breakers and fuses were not as commonly placed as they are now, etc.... Thus, the need to be careful with ground was probably greater than it is today, although this sort of attitude can lead to complacency.

3) Hobbyists are merely ignorant of the danger that they are in. Also, they may use less capable power supplies, often even just batteries.

4) <conspiracy-theorist-hat>Medical device manufacturers want to keep the medical device market a very expensive market with little competition, even though the basic specifications of many medical devices could be replicated and exceeded by a hobbyist (and thus probably easily mass-produced) for very little money... Medical device manufacturers don't want medical devices to become commodities, which typically have very thin profit margins, so they lobby for stricter and more onerous safety standards, even if the safety isn't actually improved.</conspiracy-theorist-hat>

5) There are, in fact, electrodes attached directly to your skin by necessity, and the better the contact, the better the ECG signal, but also the greater the risk of lethal shock.



That being said, an opto/RF-isolated and battery-powered Arduino ECG would be pretty easy to do, just requires more time and complexity. But once you have that figured out and the design open-sourced, it should be pretty easy for others to replicate (can you do infrared serial with an arduino? it sounds doable, and would be a pretty cheap solution to opto-coupling). Also, you can get a pretty good measure of safety by merely hooking the Arduino into a laptop running on battery, not AC. Problem (mostly) solved!





Anyways, I've also though of adding a SPO2 sensor, a thermometer, and maybe some sort of digital stethoscope (so you could also do a sort of phonocardiogram... though it would take more bandwidth on the serial port, and thus would take more careful coding and more development time)... all in one device. Hook it up to an XBee or Bluetooth shield (or an SD card shield for recording), and you have yourself a very cheap device that can do all sorts diagnostic tests. Such a device, even with all those options, could probably be mass-produced for less than $100 (including bluetooth) and could integrate with cellphones (ubiquitous even among the poor in the third world) and the data shared all around the world with specialists.

I would really like to integrate an ultrasound device, but that is considerably beyond the processing power and/or bandwidth and/or sampling rate of an Arduino. BTW, what is the highest analog sampling rate of any hobby-like chip that is available that has a pretty accessible and high-bandwidth interface to a PC?
« Last Edit: January 07, 2011, 07:35:00 pm by Robotbeat » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If really thin wires (like a few feet of wire-wrapping wire) are used for the electrodes, between the amplifier and the arduino,  and for serial communication with the computer, wouldn't the danger be mitigated somewhat, since the wires are acting as current limiters? Couldn't you put tiny fuses where the electrodes attach to the amplifier, since the electrodes only will have incredibly low currents (nano/picoAmps?) versus dangerous currents (dangerous being 10 milliAmps, potentially lethal being 75 milliAmps or more)?
« Last Edit: January 07, 2011, 07:41:41 pm by Robotbeat » Logged

Humboldt, CA
Offline Offline
Full Member
***
Karma: 2
Posts: 223
Arduino BBB
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is very, very, very cool.
Keep up the good work!

I second (sixth?) the motion of being careful about leaking AC into yourself, it's unpleasant at the best of times and delivering it straight to your heart would be even less pleasant!  (That said, it isn't exactly unnoticeable when you're jiggling around at 60hz!  The tricky part is maintaining muscle control to unhook yourself)
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=24]Wireless data transmission of heart rate using Xbee[/size]

2nd part of my project which basically transmits the measured heart rate using an Xbee.
A second Xbee is connected to the computer via USB.
A simple processing program has then been written to read the data on the serial port and then displays it.



[media]http://www.youtube.com/watch?v=MUj4mVQdTRg[/media]
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 29
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

[size=20]Current status: 15%
-ECG Circuit - prototype completed
-Wireless communication - prototype completed (point to point) Xbee
-Receiver - 10% done curretnly using an Xbee with USB adapter
-Main program on PC - 10% done... can read data from Xbee[/size]

Possible additions:
-temperature monitoring
-improved safety
-low power version
-full ECG waveform version
Logged

Pages: 1 [2]   Go Up
Jump to: