«

»

Print this Post

DIY ECG Machine On The Cheap

Notice

I have simplified and improved my ECG machine design! Check out the new post:

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

Note from the Author: This page documents how I made an incredibly simple ECG machine with a minimum of parts to view the electrical activity of my own heart. Feel free to repeat my experiment, but do so at your own risk. There are similar projects floating around on the internet, but I aim to provide a more complete, well-documented, and cheaper solution, with emphasis on ECG processing and analysis, rather than just visualization. If you have any questions or suggestions please contact me. Also, if you attempt this project yourself I’d love to post your results! Good luck!
–Scott

Background

You’ve probably seen somebody in a hospital setting hooked up to a big mess of wires used to analyze their heartbeat. ecgmanThe goal of such a machine (called an electrocardiograph, or ECG) is to amplify, measure, and record the natural electrical potential created by the heart. Note that cardiac electrical signals are different than heart sounds, which are listened to with a stethoscope. The intrinsic cardiac pacemaker system is responsible for generating these electrical signals which serve to command and coordinate contraction of the four chambers at the heart at the appropriate intervals [atria (upper chambers) first, then the ventricles (lower chambers) a fraction of a second later], and their analysis reveals a wealth of information about cardiac regulation, as well insights into pathological conditions. Each heartbeat produces a similar pattern in the ECG signal, called a PQRST wave. ecg_principle_slow [picture] The smooth curve in the ECG (P) is caused by the stimulation of the atria via the Sinoatrial (SA) node in the right atrium. There is a brief pause, as the electrical impulse is slowed by the Atrioventricular (AV) node and Purkinje fibers in the bundle of His. The prominent spike in the ECG (the QRS complex) is caused by this step, where the electrical impulse travels through the inter-ventricular septum and up through the outer walls of the ventricles. The sharp peak is the R component, and exact heart rate can be calculated as the inverse of the R-to-R interval (RRi). Fancy, huh?

Project Goal

The goal of this project is to generate an extremely cheap, functional ECG machine made from common parts, most of which can be found around your house. This do-it-yourself (DIY) ECG project is different than many others on the internet in that it greatly simplifies the circuitry by eliminating noise reduction components, accomplishing this via software-based data post-processing. Additionally, this writeup is intended for those without any computer, electrical, or biomedical experience, and should be far less convoluted than the suspiciously-cryptic write-ups currently available online. In short, I want to give everybody the power to visualize and analyze their own heartbeat!

The ECG of my own heart:

ecg31

Video Overview

I know a lot of Internet readers aren’t big fans of reading. Therefore, I provided an outline of the process in video form. Check out the videos, and if you like what you see read more!

Video 1/3: Introducing my ECG machine

Video 2/3: Recording my ECG

Video 3/3: Analyzing my ECG

Electrical Theory

Measurement: The electrical signals which command cardiac musculature can be detected on the surface of the skin. In theory one could grab the two leads of a standard volt meter, one with each hand, and see the voltage change as their heart beats, but the fluctuations are rapid and by the time these signals reach the skin they are extremely weak (a few millionths of a volt) and difficult to detect with simple devices. Therefore, amplification is needed.

Amplification: A simple way to amplify the electrical difference between two points is to use a operational amplifier, otherwise known as an op-amp. The gain (multiplication factor) of an op-amp is controlled by varying the resistors attached to it, and an op-amp with a gain of 1000 will take a 1 millivolt signal and amplify it to 1 volt. There are many different types of microchip op-amps, and they’re often packaged with multiple op-amps in one chip (such as the quad-op-amp lm324, or the dual-op-amp lm358n). Any op-amp designed for low voltage will do for our purposes, and we only need one.

Noise: Unfortunately, the heart is not the only source of voltage on the skin. Radiation from a variety of things (computers, cell phones, lights, and especially the wiring in your walls) is absorbed by your skin and is measured with your ECG, in many cases masking your ECG in a sea of electrical noise. The traditional method of eliminating this noise is to use complicated analog circuitry, but since this noise has a characteristic, repeating, high-frequency wave pattern, it can be separated from the ECG (which is much slower in comparison) using digital signal processing computer software!

Digitization: Once amplified, the ECG signal along with a bunch of noise is in analog form. You could display the output with an oscilloscope, but to load it into your PC you need an analog-to-digital converter. Don’t worry! If you’ve got a sound card with a microphone input, you’ve already got one! It’s just that easy. We’ll simply wire the output of our ECG circuit to the input of our sound card, record the output of the op-amp using standard sound recording software, remove the noise from the ECG digitally, and output gorgeous ECG traces ready for visualization and analysis!

Parts/Cost

I’ll be upfront and say that I spent $0.00 making my ECG machine, because I was able to salvage all the parts I needed from a pile of old circuit boards. If you need specific components, check your local RadioShack. If that’s a no-go, hit-up Digikey (it’s probably cheaper too). Also, resistor values are flexible. Use mine as a good starter set, and vary them to suit your needs. If you buy everything from Digikey, the total cost of this project would be about $1. For now, here’s a list of all the parts you need:

  • 1x low voltage op-amp LM358N $0.40
  • 1x 100kOhm resistor (brn,blk,yel) virtually free
  • 1x 1kOhm resistor (brn,blk,red) virtually free
  • 1x 0.1uF capacitor (104Z) virtually free
  • Microphone cable to get from the op-amp to your PC
  • Electrodes 3 pennies should do. ($0.03)

Making the Device

Keep in mind that I’m not an electrical engineer (I have a masters in molecular biology but I’m currently a dental student if you must know) and I’m only reporting what worked well for me. I don’t claim this is perfect, and I’m certainly open for (and welcome) suggestions for improvement. With that in mind, here’s what I did!

img_2694

This is pretty much it. First off is a power source. If you want to be safe, use three AAA batteries in series. If you’re a daredevil and enjoy showing off your ghettorigging skills, do what I did and grab 5v from a free USB plug! Mua ha ha ha. The power goes into the circuit and so do the leads/electrodes connected to the body. You can get pretty good results with only two leads, but if you want to experiment try hooking up an extra ground lead and slap it on your foot. More on the electrodes later. The signal from the leads is amplified by the circuit and put out the headphone cable, ready to enter your PC’s sound card through the microphone jack!

img_2686

Note how I left room in the center of the circuit board. That was intentional! I wanted to expand this project by adding a microcontroller to do some on-board, real-time analysis. Specifically, an ATMega8! I never got around to it though. Its purpose would be to analyze the output of the op-amp and graph the ECG on a LCD screen, or at least measure the time between beats and display HR on a screen. (More ideas are at the bottom of this document.) Anyway, too much work for now, maybe I’ll do it one day in the future.

ECG circuit diagram:

simple_ecg_circuit

This is the circuit diagram. This is a classical high-gain analog differential amplifier. It just outputs the multiplied difference of the inputs. The 0.1uF capacitor helps stabilize the signal and reduce high frequency noise (such as the audio produced by a nearby AM radio station). Use Google if you’re interested in learning exactly how it works.

ECG schematic:

simple_ecg_circuit2

This is how I used my LM358N to create the circuit above. Note that there is a small difference in my board from the photos and this diagram. This diagram is correct, but the circuit in some of the pictures is not. Briefly, when I built it I accidentally connected the (-) lead directly to ground, rather than to the appropriate pin on the microchip. This required me to place a 220kOhm between the leads to stabilize the signal. I imagine if you wire it CORRECTLY (as shown in these circuit diagrams) it will work fine, but if you find it too finicky (jumping quickly from too loud to too quiet), try tossing in a high-impedance resistor between the leads like I did. Overall, this circuit is extremely flexible and I encourage you to build it on a breadboard and try different things. Use this diagram as a starting point and experiment yourself!

The Electrodes:

img_2704

You can make electrodes out of anything conductive. The most recent graphs were created from wires with gator clips on them clamping onto pennies (pictured). Yeah, I know I could solder directly to the pennies (they’re copper) but gator clips are fast, easy, and can be clipped to different materials (such as aluminum foil) for testing. A dot of moisturizing lotion applied to the pennies can be used to improve conduction between the pennies and the skin, but I didn’t find this to be very helpful. If pressed firmly on the body, conduction seems to be fine. Oh! I just remembered. USE ELECTRICAL TAPE TO ATTACH LEADS TO YOUR BODY! I tried a million different things, from rubber bands to packaging tape. The bottom line is that electrical tape is stretchy enough to be flexible, sticky enough not to fall off (even when moistened by the natural oils/sweat on your skin), and doesn’t hurt that bad to peel off.

Some of the best electrodes I used were made from aluminum cans! Rinse-out a soda can, cut it into “pads”, and use the sharp edge of a razor blade or pair of scissors to scrape off the wax coating on all contact surfaces. Although a little unconformable and prone to cut skin due to their sharp edges, these little guys work great!

Hooking it Up

This part is the most difficult part of the project! This circuit is extremely finicky. The best way to get it right is to open your sound editor (In Windows I use GoldWave because it’s simple, powerful, and free, but similar tools exist for Linux and other Unix-based OSes) and view the low-frequency bars in live mode while you set up. When neither electrode is touched, it should be relatively quiet. When only the + electrode is touched, it should go crazy with noise. When you touch both (one with each hand) the noise should start to go away, possibly varying by how much you squeeze (how good of a connection you have). The whole setup process is a game between too much and too little conduction. You’ll find that somewhere in the middle, you’ll see (and maybe hear) a low-frequency burst of noise once a second corresponding to your heartbeat. [note: Did you know that's how the second was invented? I believe it was ] Once you get that good heartbeat, tape up your electrodes and start recording. If you can’t get it no matter what you do, start by putting the ground electrode in your mouth (yeah, I said it) and pressing the + electrode firmly and steadily on your chest. If that works (it almost always does), you know what to look for, so keep trying on your skin. For short recordings (maybe just a few beats) the mouth/chest method works beautifully, and requires far less noise reduction (if any), but is simply impractical for long-term recordings. I inside vs. outside potential is less susceptible to noise-causing electrical radiation. Perhaps other orifices would function similarly? I’ll leave it at that. I’ve also found that adding a third electrode (another ground) somewhere else on my body helps a little, but not significantly. Don’t give up at this step if you don’t get it right away! If you hear noise when + is touched, your circuit is working. Keep trying and you’ll get it eventually.

Recording the ECG

This is the easy part. Keep an eye on your “bars” display in the audio program to make sure something you’re doing (typing, clicking, etc) isn’t messing up the recording. If you want, try surfing the net or playing computer games to see how your heart varies. Make sure that as you tap the keyboard and click the mouse, you’re not getting noise back into your system. If this is a problem, try powering your device by batteries (a good idea for safety’s sake anyway) rather than another power source (such as USB power). Record as long as you want! Save the file as a standard, mono, wave file.

Digitally Eliminating Noise

Now it’s time to clean-up the trace. Using GoldWave, first apply a lowpass filter at 30 Hz. This kills most of your electrical noise (> 30hz), while leaving the ECG intact (< 15Hz). However, it dramatically decreases the volume (potential) of the audio file. Increase the volume as necessary to maximize the window with the ECG signal. You should see clear heartbeats at this point. You may want to apply an auto-gain filter to normalize the heartbeats potentials. Save the file as a raw sound file (.snd) at 1000 Hz (1 kHz) resolution.

Presentation and Analysis

Now you’re ready to analyze! Plop your .snd file in the same folder as my [ecg.py script], edit the end of the script to reflect your .snd filename, and run the script by double-clicking it. (Keep in mind that my script was written for python 2.5.4 and requires numpy 1.3.0rc2 for python 2.5, and matplotlib 0.99 for python 2.5 – make sure you get the versions right!) Here’s what you’ll see!

diy_ecg_sample_trace

This is a small region of the ECG trace. The “R” peak is most obvious, but the details of the other peaks are not as visible. If you want more definition in the trace (such as the blue one at the top of the page), consider applying a small collection of customized band-stop filters to the audio file rather than a single, sweeping lowpass filter. Refer to earlier posts in the DIY ECG category for details. Specifically, code on Circuits vs. Software for noise reduction entry can help. For our purposes, calculating heart rate from R-to-R intervals (RRIs) can be done accurately with traces such as this.

diy_ecg_heart_rate_over_time

Your heart rate fluctuates a lot over time! By plotting the inverse of your RRIs, you can see your heart rate as a function of time. Investigate what makes it go up, go down, and how much. You’d be surprised by what you find. I found that checking my email raises my heart rate more than first-person-shooter video games. I get incredibly anxious when I check my mail these days, because I fear bad news from my new university (who knows why, I just get nervous about it). I wonder if accurate RRIs could be used to assess nervousness for the purposes of lie detection?

diy_ecg_rr_beat_interval

This is the RRI plot where the value of each RRI (in milliseconds) is represented for each beat. It’s basically the inverse of heart rate. Miscalculated heartbeats would show up as extremely high or extremely low dots on this graph. However, excluding points above or below certain bounds means that if your heart did double-beat, or skip a beat, you wouldn’t see it. Note that I just realized my axis label is wrong (it should be sec, not ms). Oh well =o\

diy_ecg_poincare_plot

A Poincare Plot is a commonly-used method to visually assess heart rate variability as a function of RRIs. In this plot, each RRI is plotted against the RRI of the next subsequent beat. In a heart which beats at the same speed continuously, only a single dot would be visible in the center. In a heart which beats mostly-continuously, and only changes its rate very slowly, a linear line of dots would be visible in a 1:1 ratio. However, in real life the heart varies RRIs greatly from beat to beat, producing a small cloud of dots. The size of the cloud corresponds to the speed at which the autonomic nervous system can modulate heart rate in the time frame of a single beat.

diy_ecg_rr_deviation_histogram

The frequency of occurrence of various RRIs can be expressed by a histogram. The center peak corresponds to the standard heart rate. Peaks to the right and left of the center peak correspond to increased and decreased RRIs, respectively. A gross oversimplification of the interpretation of such data would be to state that the upper peak represents the cardio-inhibitory parasympathetic autonomic nervous system component, and the lower peak represents the cardio-stimulatory sympathetic autonomic nervous system component.

diy_ecg_power_spectrum_raw

Taking the Fast Fourier Transformation of the data produces a unique trace whose significance is extremely difficult to interpret. Near 0Hz (infinite time) the trace heads toward ∞ (infinite power). To simplify the graph and eliminate the near-infinite, low-frequency peak we will normalize the trace by multiplying each data point by its frequency, and dividing the vertical axis units by Hz to compensate. This will produce the following graph…

diy_ecg_power_spectrum_weighted
This is the power spectrum density (PSD) plot of the ECG data we recorded. Its physiological interpretation is extraordinarily difficult to understand and confirm, and is the subject of great debate in the field of autonomic neurological cardiac regulation. An oversimplified explanation of the significance of this graph is that the parasympathetic (cardio-inhibitory) branch of the autonomic nervous system works faster than the sympathetic (cardio-stimulatory) branch. Therefore, the lower peak corresponds to the sympathetic component (combined with persistent parasympathetic input, it’s complicated), while the higher-frequency peak corresponds to the parasympathetic component, and the sympathetic/parasympathetic relationship can be assessed by the ratio of the integrated areas of these peaks after a complicated curve fitting processes which completely separates overlapping peaks. To learn more about power spectral analysis of heart rate over time in the frequency domain, I recommend skimming this introduction to heart rate variability website and the article on Heart Rate Variability following Myocardial Infarction (heart attack). Also, National Institute of Health (NIH) funded studies on HRV should be available from pubmed.org. If you want your head to explode, read Frequency-Domain Characteristics and Filtering of Blood Flow Following the Onset of Exercise: Implications for Kinetics Analysis for a lot of good frequency-domain-analysis-related discussion and rationalization.

Encouraging Words:

Please, if you try this don’t die. The last thing I want is to have some kid calling me up and yelling at me that he nearly electrocuted himself when he tried to plug my device directly into a wall socket and now has to spend the rest of his life with two Abraham Lincolns tattooed onto his chest resembling a second set of nipples. Please, if you try this use common sense, and of course you’re responsible for your own actions. I provide this information as a description of what I did and what worked for me. If you make something similar that works, I’ve love to see it! Send in your pictures of your circuit, charts of your traces, improved code, or whatever you want and I’ll feature it on the site. GOOD LUCK!

Fancier Circuit:

If you want to try this, go for it! Briefly, this circuit uses 6 op-amps to help eliminate effects of noise. It’s also safer, because of the diodes interconnecting the electrodes. It’s the same circuit as on [this page].

Last minute thoughts:

  • More homemade ECG information can be found on my earlier posts in the DIY ECG category, however this page is the primary location of my most recent thoughts and ideas.
  • You can use moisturizing lotion between the electrodes and your skin to increase conduction. However, keep in mind that better conduction is not always what you want. You’ll have to experiment for yourself.
  • Variation in location of electrodes will vary the shape of the ECG. I usually place electrodes on each side of my chest near my arms. If your ECG appears upside-down, reverse the leads!
  • Adding extra leads can improve grounding. Try grounding one of your feet with a third lead to improve your signal. Also, if you’re powering your device via USB power consider trying battery power – it should be less noisy.
  • While recording, be aware of what you do! I found that if I’m not well-grounded, my ECG is fine as long as I don’t touch my keyboard. If I start typing, every keypress shows up as a giant spike, bigger than my heartbeat!
  • If you get reliable results, I wonder if you could make the device portable? Try using a portable tape recorder, voice recorder, or maybe even minidisc recorder to record the output of the ECG machine for an entire day. I haven’t tried it, but why wouldn’t it work? If you want to get fancy, have a microcontroller handle the signal processing and determine RRIs (should be easy) and save this data to a SD card or fancy flash logger.
  • The microcontroller could output heart rate via the serial port.
  • If you have a microcontroller on board, why not display heart rate on a character LCD?
  • While you have a LCD on there, display the ECG graphically!
  • Perhaps a wireless implementation would be useful.
  • Like, I said, there are other, more complicated analog circuits which reduce noise of the outputted signal. I actually built Jason Nguyen’s fancy circuit which used 6 op-amps but the result wasn’t much better than the simple, 1 op-amp circuit I describe here once digital filtering was applied.
  • Arrhythmic heartbeats (where your heart screws-up and misfires, skips a beat, double-beats, or beats awkwardly) are physiological (normal) and surprisingly common. Although shocking to hear about, sparse, single arrhythmic heartbeats are normal and are a completely different ball game than chronic, potentially deadly heart arrhythmias in which every beat is messed-up. If you’re in tune with your body, you might actually feel these occurrences happening. About three times a week I feel my heart screw up a beat (often when it’s quiet), and it feels like a sinking feeling in my chest. I was told by a doctor that it’s totally normal and happens many times every day without me noticing, and that most people never notice these single arrhythmic beats. I thought it was my heart skipping a beat, but I wasn’t sure. That was my motivation behind building this device – I wanted to see what my arrhythmic beats looked like. It turns out that it’s more of a double-beat than a skipped beat, as observed when I captured a single arrhythmic heartbeat with my ECG machine, as described in this entry.
  • You can improve the safety of this device by attaching diodes between leads, similar to the more complicated circuit. Theory is that if a huge surge of energy does for whatever reason get into the ECG circuit, it’ll short itself out at the circuit level (conducting through the diodes) rather than at your body (across your chest / through your heart).
  • Alternatively, use an AC opto-isolator between the PC sound card and the ECG circuit to eliminate the possibility of significant current coming back from the PC.
  • On the Hackaday post, Flemming Frandsen noted that an improperly grounded PC could be dangerous because the stored charge would be manifest in the ground of the microphone jack. If you were to ground yourself to true ground (using a bench power supply or sticking your finger in the ground socket of an AC wall plug) this energy could travel through you! So be careful to only ground yourself with respect to the circuit using only battery power to minimize this risk.
  • Do not attempt anything on this page. Ever. Don’t even read it. You read it already! You’re sill reading it aren’t you? Yeah. You don’t follow directions well do you?

SAMPLE FILTERED RECORDING:

I think this is the same one I used in the 3rd video from my single op-amp circuit. [scottecg.snd] It’s about an hour long, and in raw sound format (1000 Hz). It’s already been filtered (low-pass filtered at 30Hz). You can use it with my code below!

CODE

print "importing libraries..."
import numpy, pylab
print "DONE"

class ECG:

    def trim(self, data,degree=100):
        print 'trimming'
        i,data2=0,[]
        while i<len(data):
            data2.append(sum(data[i:i+degree])/degree)
            i+=degree
        return data2

    def smooth(self,list,degree=15):
        mults=[1]
        s=[]
        for i in range(degree): mults.append(mults[-1]+1)
        for i in range(degree): mults.append(mults[-1]-1)
        for i in range(len(list)-len(mults)):
            small=list[i:i+len(mults)]
            for j in range(len(small)):
                small[j]=small[j]*mults[j]
            val=sum(small)/sum(mults)
            s.append(val)
        return s

    def smoothWindow(self,list,degree=10):
        list2=[]
        for i in range(len(list)):
            list2.append(sum(list[i:i+degree])/float(degree))
        return list2

    def invertYs(self):
        print 'inverting'
        self.ys=self.ys*-1

    def takeDeriv(self,dist=5):
        print 'taking derivative'
        self.dys=[]
        for i in range(dist,len(self.ys)):
            self.dys.append(self.ys[i]-self.ys[i-dist])
        self.dxs=self.xs[0:len(self.dys)]

    def genXs(self, length, hz):
        print 'generating Xs'
        step = 1.0/(hz)
        xs=[]
        for i in range(length): xs.append(step*i)
        return xs

    def loadFile(self, fname, startAt=None, length=None, hz=1000):
        print 'loading',fname
        self.ys = numpy.memmap(fname, dtype='h', mode='r')*-1
        print 'read %d points.'%len(self.ys)
        self.xs = self.genXs(len(self.ys),hz)
        if startAt and length:
            self.ys=self.ys[startAt:startAt+length]
            self.xs=self.xs[startAt:startAt+length]

    def findBeats(self):
        print 'finding beats'
        self.bx,self.by=[],[]
        for i in range(100,len(self.ys)-100):
          if self.ys[i]<15000: continue # SET THIS VISUALLY
          if self.ys[i]<self.ys[i+1] or self.ys[i]<self.ys[i-1]: continue
          if self.ys[i]-self.ys[i-100]>5000 and self.ys[i]-self.ys[i+100]>5000:
              self.bx.append(self.xs[i])
              self.by.append(self.ys[i])
        print "found %d beats"%(len(self.bx))

    def genRRIs(self,fromText=False):
        print 'generating RRIs'
        self.rris=[]
        if fromText: mult=1
        else: 1000.0
        for i in range(1,len(self.bx)):
            rri=(self.bx[i]-self.bx[i-1])*mult
            #if fromText==False and len(self.rris)>1:
                #if abs(rri-self.rris[-1])>rri/2.0: continue
            #print i, "%.03f\t%.03f\t%.2f"%(bx[i],rri,60.0/rri)
            self.rris.append(rri)

    def removeOutliers(self):
        beatT=[]
        beatRRI=[]
        beatBPM=[]
        for i in range(1,len(self.rris)):
            #CHANGE THIS AS NEEDED
            if self.rris[i]<0.5 or self.rris[i]>1.1: continue
            if abs(self.rris[i]-self.rris[i-1])>self.rris[i-1]/5: continue
            beatT.append(self.bx[i])
            beatRRI.append(self.rris[i])
        self.bx=beatT
        self.rris=beatRRI

    def graphTrace(self):
        pylab.plot(self.xs,self.ys)
        #pylab.plot(self.xs[100000:100000+4000],self.ys[100000:100000+4000])
        pylab.title("Electrocardiograph")
        pylab.xlabel("Time (seconds)")
        pylab.ylabel("Potential (au)")

    def graphDeriv(self):
        pylab.plot(self.dxs,self.dys)
        pylab.xlabel("Time (seconds)")
        pylab.ylabel("d/dt Potential (au)")

    def graphBeats(self):
        pylab.plot(self.bx,self.by,'.')

    def graphRRIs(self):
        pylab.plot(self.bx,self.rris,'.')
        pylab.title("Beat Intervals")
        pylab.xlabel("Beat Number")
        pylab.ylabel("RRI (ms)")

    def graphHRs(self):
        #HR TREND
        hrs=(60.0/numpy.array(self.rris)).tolist()
        bxs=(numpy.array(self.bx[0:len(hrs)])/60.0).tolist()
        pylab.plot(bxs,hrs,'g',alpha=.2)
        hrs=self.smooth(hrs,10)
        bxs=bxs[10:len(hrs)+10]
        pylab.plot(bxs,hrs,'b')
        pylab.title("Heart Rate")
        pylab.xlabel("Time (minutes)")
        pylab.ylabel("HR (bpm)")

    def graphPoincare(self):
        #POINCARE PLOT
        pylab.plot(self.rris[1:],self.rris[:-1],"b.",alpha=.5)
        pylab.title("Poincare Plot")
        pylab.ylabel("RRI[i] (sec)")
        pylab.xlabel("RRI[i+1] (sec)")

    def graphFFT(self):
        #PSD ANALYSIS
        fft=numpy.fft.fft(numpy.array(self.rris)*1000.0)
        fftx=numpy.fft.fftfreq(len(self.rris),d=1)
        fftx,fft=fftx[1:len(fftx)/2],abs(fft[1:len(fft)/2])
        fft=self.smoothWindow(fft,15)
        pylab.plot(fftx[2:],fft[2:])
        pylab.title("Raw Power Sprectrum")
        pylab.ylabel("Power (ms^2)")
        pylab.xlabel("Frequency (Hz)")

    def graphFFT2(self):
        #PSD ANALYSIS
        fft=numpy.fft.fft(numpy.array(self.rris)*1000.0)
        fftx=numpy.fft.fftfreq(len(self.rris),d=1)
        fftx,fft=fftx[1:len(fftx)/2],abs(fft[1:len(fft)/2])
        fft=self.smoothWindow(fft,15)
        for i in range(len(fft)):
            fft[i]=fft[i]*fftx[i]
        pylab.plot(fftx[2:],fft[2:])
        pylab.title("Power Sprectrum Density")
        pylab.ylabel("Power (ms^2)/Hz")
        pylab.xlabel("Frequency (Hz)")

    def graphHisto(self):
        pylab.hist(self.rris,bins=20,ec='none')
        pylab.title("RRI Deviation Histogram")
        pylab.ylabel("Frequency (count)")
        pylab.xlabel("RRI (ms)")
        #pdf, bins, patches = pylab.hist(self.rris,bins=100,alpha=0)
        #pylab.plot(bins[1:],pdf,'g.')
        #y=self.smooth(list(pdf[1:]),10)
        #x=bins[10:len(y)+10]
        #pylab.plot(x,y)

    def saveBeats(self,fname):
        print "writing to",fname
        numpy.save(fname,[numpy.array(self.bx)])
        print "COMPLETE"

    def loadBeats(self,fname):
        print "loading data from",fname
        self.bx=numpy.load(fname)[0]
        print "loadded",len(self.bx),"beats"
        self.genRRIs(True)

def snd2txt(fname):
    ## SND TO TXT ##
    a=ECG()
    a.loadFile(fname)#,100000,4000)
    a.invertYs()
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphTrace()
    a.findBeats()
    a.graphBeats()
    a.saveBeats(fname)
    pylab.show()

def txt2graphs(fname):
    ## GRAPH TXT ##
    a=ECG()
    a.loadBeats(fname+'.npy')
    a.removeOutliers()
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphHRs();pylab.subplots_adjust(left=.1,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_Heart_Rate_Over_Time.png");
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphFFT();pylab.subplots_adjust(left=.13,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_Power_Spectrum_Raw.png");
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphFFT2();pylab.subplots_adjust(left=.13,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_Power_Spectrum_Weighted.png");
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphPoincare();pylab.subplots_adjust(left=.1,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_Poincare_Plot.png");
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphRRIs();pylab.subplots_adjust(left=.1,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_RR_Beat_Interval.png");
    pylab.figure(figsize=(7,4),dpi=100);pylab.grid(alpha=.2)
    a.graphHisto();pylab.subplots_adjust(left=.1,bottom=.12,right=.96)
    pylab.savefig("DIY_ECG_RR_Deviation_Histogram.png");
    pylab.show();

fname='publish_05_10min.snd' #CHANGE THIS AS NEEDED
#raw_input("\npress ENTER to analyze %s..."%(fname))
snd2txt(fname)
#raw_input("\npress ENTER to graph %s.npy..."%(fname))
txt2graphs(fname)

NEW:

Salil notified me that he used a similar concept to create an ECG machine using some fancier circuitry to eliminate noise with hardware rather than rely on software. Way to go Salil! Here’s a video of his project: http://youtu.be/uV8UyEQxVII

About the author

Scott W Harden

Scott Harden has had a lifelong passion for computer programming and electrical engineering, and recently has become interested in its relationship with biomolecular sciences. He has run a personal website since he was 15, which has changed names from HardenTechnologies.com, to KnightHacker.com, to ScottIsHot.com, to its current SWHarden.com. Scott has been in college for 10 years, with 3 more years to go. He has an AA in Biology (Valencia College), BS in Cell Biology (Union University), MS in Molecular Biology and Microbiology (University of Central Florida), and is currently in a combined DMD (doctor of dental medicine) / PhD (neuroscience) program through the collaboration of the College of Dentistry and College of Medicine (Interdisciplinary Program in Biomedical Science, IDP) at the University of Florida in Gainesville, Florida. In his spare time Scott builds small electrical devices (with an emphasis on radio frequency) and enjoys writing cross-platform open-source software.

Permanent link to this article: http://www.SWHarden.com/blog/2009-08-14-diy-ecg-machine-on-the-cheap/

142 comments

  1. Filipe YaBa Polido

    Excelent!
    Keep up the good work!
    What about brain waves?! I would like to monitor my alpha/etc states too :D

  2. Scott

    There’s an open EEG project which seeks to do just that. Check out http://openeeg.sourceforge.net/doc/

    1. Michael Ahmadi

      Hello Scott,
      You have a very creative mind. I am not sure what stage of your career you are at, but if you like to expand your creative mind to solve many patients’ problems, you can call me at 513-680-0633. We are a group of medical doctors and PhD engineers got together to achieve just that.

      Give me a call if you can.

      Michael

  3. wael

    verygood article

    i’ll try this project as soon as i can , just hopt it gives me more correct output than my all brevious projects .

    but as i can see here , the picture in this article doesnt show the ideal ECG pattern , P-QRS-T you know , whay is that ?

    another quis : how can i improve such a project to become a 12-leads ECG ?

    thanx for sharing :)

  4. Scott

    The P wave is probably lacking due to imperfect placement of the leads. Moving the leads around your chest changes the shape of the trace. http://www.swharden.com/blog/images/filtering.png recorded on a different day shows the P-QRS-T waves nicely.

    As far as creating a 12-lead ECG, just repeat the process 12 times! The trouble is getting it into the PC. Sound cards only allow 2 channel inputs (right, left). Search the page for the word “microcontroller”. If you use a microcontroller to analyze the data, I’ll bet you can switch it rapidly between leads, recording voltages as you go, and dumping the data (voltage for each lead) directly to the PC in text format through the serial port. There are many ways you could do it, but that’s an easy one.

  5. Scott

    Also remember that this is a single op-amp circuit, designed only to accurately assess R-to-R intervals, which it does well. For detailed visualization of the small features (such as the image I just linked to), build the 6-op-amp version.

  6. Graeme

    I read somewhere that ECG signals are “chaotic”, in the sense that weather is, the butterfly effect and all that.
    I heard of a research project that was measuring the “fractal dimension” of ECG signals in an attempt to get an early warning of heart problems. IIRC, too regular a heartbeat can be bad news!

    Would be interesting to do that kind of analysis of your ECG data :-)

  7. Andrew

    You don’t know of any way to do this same thing with an EEG do you? That would be amazing!

  8. Leon

    Exelent work!

    Arduino (www.arduino.cc) could be platform to go further.

  9. Cameron

    Please don’t do this without the opto isolator, it’s potentially lethal. You’re putting electrodes on your heart and providing a direct electrical connection to your pc (which is on mains power and could short). It’ll be the best $2 insurance policy you ever bought.

    1. Dillon Chaffey (Chafflube)

      It also wouldn’t hurt to disconnect your laptop (if you are using one) from the mains socket. As this will not just reduce the potential for your heart to come into contact with mains voltage, but it may reduce some noise from the mains socket. Even though this noise may be minor, it could adversely affect your readings.

      Absolutely fantastic post, by the way, mate. I will be sure to build this on my next day off! Please keep great posts like these coming! They are very much appreciated.

  10. Scott

    Andrew: Open EEG project for brain waves: http://openeeg.sourceforge.net/doc/

    Leon: Yeah, but why waste a whole development board when a single $2 AVR could handle it? Check out my “microcontrollers” category.

    Cameron: agreed. But… again… how would that be different than plugging headphones in your computer?

  11. charles

    Awesome tool. Nice job.

    What program did you use to create the diagrams and the circuit?

    1. Scott

      Inkscape! http://www.inkscape.org/

  12. Occamboy

    Ditto on the earlier isolation comment. The same conductive path that allows you to measure signals coming from the heart could just as easily conduct electricity *into* the heart. Less than a milliamp of current injected through the heart can cause cardiac arrest. This is not trivial stuff.

    ECGs need to be electrically isolated from the mains and hazards in very specific ways. If you don’t know how to do this, then I strongly urge you to not to experiment with this.

  13. Liz

    Wow… that’s amazingly cool. Thanks for sharing the idea and the plans with everyone!

  14. eric

    wtf?! THIS IS INCREDIBLE. i am building one right now!! might throw a PIC on it and let it use the usb data as well as power :D

  15. Anonymous

    Wow. You’ve got a huge Q wave. You’ve had that looked at, right?

  16. jim

    Hi, excellent work on self-tracking. but do you know a cheap way (budge around 50-100) to make a eeg machine? An eeg is very useful in terms of introspection and mediation

  17. Free Domain Analysis

    My friend sent me this URL in an email, she said that I’d really enjoy your post.

    Peace!

  18. Trackback - Free Internation Call >> How to make free international call

    ,[...] http://www.swharden.com is one nice source of information on this subject,[...]

  19. Danny

    Is there a schematic to make a safer home-made ECG with opto isolator as suggested?
    it is a great article, thanks, though I’m still trying to get the signal from the ckt.

  20. Ganesh

    Hi, its an excellent work. we are doing project on same topic,but we want to implement it on mobile phone so can you help us to achieve the same. Waiting for your reply…..

  21. joyce

    COULD I KNOW IF AN OPTOISOLATOR IS REQUIRED FOR THIS.IF SO.WHICH WOULD BE THE BEST TO BE IMPLEMENTED?I AM USING A 3 LEAD SYSTEM FOR MY CIRCUIT.ISNT OPTO ISOLATION A MUST…

  22. RJ

    ECG application example in an AD appnote: http://www.analog.com/static/imported-files/data_sheets/AD620.pdf

    Page 15.

  23. eathan

    Hey I just soldered most of the circuit together (the simple one). Though I’m not sure if/how it will work. I grabbed the only op amp that radioshack had. 741 op amp. I’m not sure if this is interchangeable with yours. Before I hook up to battery power, I wonder if you could explain? Also, is it possible to use a 9v batter instead. Why or why not? and how would i go about grabbing usb power? Obviosly I’m a little green with electronics. Thanks so much. this project is very cool and I’m glad you shared it.

    E

  24. Jdog

    i think this idea you have is inspirational no a better way to describe it would be genious and the idea for using the voice recorder is good also that could work as well you should try it it is the same principle as the holter monitor used by cardiologist to diagnose arrhythmias in the home setting try it and remember keep moving forward

  25. william rufus

    Dear sir,

    This is to inform you that i am interested in buying these medical products

    from your company,viz,

    (1) EKG MACHINE

    (2) PATIENT MONITOR

    (3) DEFIBRILLATOR MACHINE

    I will like to have their price and to know their availability in stock so as to
    enable us tell you how many quantities we are purchasing per one.

    Your quick response will be highly appreciated.

    Thanks
    Williams

  26. Scott

    I can get you an EKG machine for $200, a patient monitor for $150, and a defibrillator machine for $300. All of these devices will be made from parts reclaimed from old TVs, Styrofoam, and likely some popsicle sticks.

  27. Filipe

    Hi

    I love this project and I try make it but this not work :(

    I try make the 1º circuit example with lm358 but I only see pulse on osciloscope when I conect to the leds and signal generator…

    to make the leads I have gym bike heart beat contacts (I think it is better)

    you have an idea to help me?

    if you can, add me on msn filjoa@hotmail.com I like very much make an project like that.

    best regards,
    Filipe Abrantes

  28. hesham

    hi i am a student at the last year at the faculty of engineering- Assiut University-Egypt
    Our project is ECG i downloaded Gold wave & Python
    I tried to Run the script on python on win 7 & on Linux but it doesn’t work
    can you help me
    I hope you are serious
    I am waiting for your reply

  29. hesham

    Dear sir i forgot to tell you that i made the circuit and it works properly now but needs a good notch filter please help me to do it on python
    I am waiting for your reply
    Eng Hesham

  30. vivek

    good work dude….but the soundcard n goldwave dont pick up things under 20 Hz (or do they??)….n most f useful ecg signal is under 20 hz….so how does it work

  31. hesham

    so what is the solution ? thx for yr attention.

  32. hesham

    dear sir i have some problems using python one of them it stops working during excuting and a run time error appaers and the figures doesnit appear please help me ……

  33. hesham

    waiting for your replay

  34. Biolyons

    Very concerned looking at things like this – as a senior Clinical Engineer I can tell you of a condition known as microshock where currents of just 40mA can do damage to your heart – DONT build something like this without complete electrical isolation of the patient leads – a quality optoisolator on each patient lead is a minimum. FYI commercial units have to be able to withstand 500v being placed on the back end without breaking through to the leads.

  35. ian roberts

    Sir I am an electrical dunce with a heart arrythmia problem and a pacemaker inserted for syncope (low blood pressure) attacks. I live in Indonesia with relatively poor medical resources locally. I am absolutely in awe of your capability and of course would love to build this device for home monitoring and recording but truly I find it too daunting. I may task a local smart kid to try it. Thanks so much for a fascinating article. Well done.

  36. Muni Sakya

    We are a team of doctors and engineers join hands together to serve the under privileged and underserved people of the remote rural part of our country called NEPAL. So far we have examined 120 patients of different diseases and your article and somple ECG schematics can serve our general need towards the state of the hearts of the cardio patients.
    Please accept our hearty thanks towards basic treatment on ECH/EKG that will atleast show the general condition of the hearts of the poorest of the poor people of NEPAL.

    WE love to build one and use asap.

  37. Anonymous

    Excellent article… Really exciting. Hope to try it soon.

  38. Bobby

    I’ve tried building this but it won’t work; I did however act as an antennae as mentioned in your youtube video. I had the capacitor connected at the time but maybe incorrectly , which is entirely possible since I’m not too familiar with schematics and implementing them. Thanks for the wonderful article tho.

  39. Bobby

    I just noticed too, that the station I heard was spanish. The guy was advertising their station, 105.something.

    I live in Orange County, California. Did we hear the same station? O_o???

  40. linliehhann

    I just build fancy lm324 version and used oscilloscope softare and free ekg software, it just come out as commercial ecg, just try to use right leg device to reduce interference I am looking for 12 lead ecg for poor country,amazing guide!

  41. rahimie

    Hi,

    i would like to know how to set up live mode in the goldwave software?

  42. Dider

    Hi,

    I tried the simple version with just 1 op-amp but i get nothing, really noting.
    How can this work if the op-amp cant float? How can you get an AC signal if the op amp only is powered from 0 tot 5V and not from -2,5v to 2,5v?

    Does somebody got this schematic working?

    Thanx in advance

  43. Anonymous

    hahahahahahahahahahahaha heheheheheheheh ;) :) :P

  44. Anonymous

    wat are yu lol about hehehehehehehehehehehe >:( :lol

  45. sensor headset

    . The George Greenstein Institute approached me to create a class. The first thing I wanted to do was finally explore the EEG machine. The idea of using quantifiable information, gleaned from the brain itself, representing it in a variety of manners — from purely aesthetic to powerful data visualization — got my mind humming with possibilities. Directly interfacing with the individual experience of perception is a terrain I had not yet been able to directly explore. Through open source hardware I was finally in a position to begin experimenting with how my own mind responds to stimuli. In addition, the format of taking the research directly to a classroom for further development amongst a background of many interests offered new possibilities for refining the technology. . This is my first comment. Your blog has been very useful for me and it provides very good content and too informative,.

  46. Enric G. Torrents

    Dear all,

    as new honorary consul of the hispanoasiatic chamber of commerce Hispasia I am promoting the implementation of open science devices in university and schools labs, specially in those of deprived areas unable to afford regular, commercial ones. I am looking for an EEGs designs ready for distribution either as a pre-made kit or a DIY one, reliable and precise enough to be both a learning and a research tool.

    Please get in touch with me with feedback on the proposal and ideas on other open-science devices I could propose to the institutions.

    Many thanks for your attention,

    Enric G. Torrents


    Honorary Consul – Hispasia (hispanoasiatic chamber of commerce)
    Scientific Affairs Delegate – Seyde / Lawyers and consultants
    Via Augusta, 4 (piso) Badalona
    08911 Barcelona Spain

  47. mostafa

    its wenderfull i am from iraq but i living in uae dubai i like your machine thanks and look forword to you

  48. Gabriel

    Hi, your blog is really great and i loved the projects posted. I’m trying to build an ECG analog circuit to print the waves on the pc screen as you did, but using a microcontroller. At first, I ll use an Arduino board to develop an then update it just for an avr microcontroller.

    I wanna WARNING you guys, that we need galvanic isolation for the patient, otherwise a small current (such as mA) can provide a microshock (as mentioned above). Answering your question, the headphone is different because there isn’t a directly electrical connection to your body. In this case, the current goes to speakers that moves mechanical waves trough the air (sound) to your ear.

    You can provide a safer circuit using optoisolators between the signal that will goes to pc and the pc (or making it wireless). The Op Amp is characterized by having a large input impedance, and, with a 9V top, the current that could go to patient is insignificant (uA or less). If you try to use a right leg drive (RLD) just put a resistor (at least 1M) between the output of the amplifier and the patient. Also use the diodes to prevent any large tension on the leads.

    As soon as I get something to publish, you will hear about here. Thanks for the ideas.

  49. Uttam Dutta

    If I make lm324 fancy version with potable LCD oscilloscope how will be tthe dispaly, (I do not use any software) , can any body answer

  50. phillip

    Great stuff mate. I hope you are on our side. One thing though, I think a second is 1/6min which is 1/60 hour= 1/24 day= 1 earth rotation etc etc or something like that. cheers

  51. darren

    Hi,

    I tried to make this amplifier circuit but the scematic is very hard to follow.

    Also it doesnt tell you how to wire the stereo socket (least i dont think so) – the socket has 3 pins but there are only 2 outputs?

    Anyone think they could draw a digram of this on a breadboard so i can see exactlly how to wire it.

    I really want an ecg machine lol

    Thank you

    Timez

  52. darren

    Im not even getting the heatbeat on the live test that you do before you record :(

  53. Darren

    I do get lots of noise when i touch the + lead tho – but as i say cant pick up the heatbeat signal at all? – anyone? (maybe its cos im making the wires that attach to the electrodes too long – i cant find sheilded wire anywhere – only audio cable – i cant use that for electrode leads tho right? because they have 3 wires inside?

    Please someone help – or im gonna have to give up on this one because it wont work for me.

  54. Lydia Eule

    dear sir,
    I tried and built a device ust as described here. I followed your schematics to the very best, same with that bit of software. But I found it dysfunctional. the software truly produced some graph, seemingly like a ecg, but it went on doing so with the trodes off-skin, well, even with power cutoff on the actual device. I did some testing of the whereabouts of errors and possible flaws in my work, but found every part funcioning and in the right place. still the graph written in another try, even on another computer. what I found out : this bit of software does detect and graph an “input” on the computer’s audiodevice. It simply shows no input of a user’s heartbeat but that of the computer’s hard disk. in work, most computers I ever experienced do some HDD operation on runtime. this seems to give a little decaly of voltage in the main system and is detected by your software. why it happens almost only with some plug in the microphone-jack, I don’t know. but that’s just my findings. maybe I still made an error when building the aforesaid device and didn’t find it, but ich checked 4 times every part of it.
    greetings
    die eule

  55. Frank Abbing

    Dear mr. Harden,

    I built the Nguyen version of the circuit. After some checking and double checking it works very well. I found the free oscilloscope by mr. Zeitnitz very useful when troubleshooting.
    I record the signal as a WAV with 8000 samples/second (far to many samples, but this is a standard sampling rate) We have 50 Hz mains here, so most of the noise is 50 Hz. One mains cycle is 8000/50=160 samples, by using the average of these 160 samples the mains noise automatically disappears. No other filtering is needed to get a very reasonable ECG picture.

    Frank

  56. beats headphones

    Monster Beats by dre headphones produces an individual intense level of comfort. This kind of class of monster beats goods, which includes monster music by dr dre studio room, are constructed of poor substance that produce a hearing sense probably considering the none of the major depression due to headsets. Thus if you can be sporting monster beats by just dr dre studio headphones, you’re feeling the selected music, not just the individual headsets. And monster beats as a result of dr dre studio using ultra-soft breathable components retains a large reputation, both in the lifetime of workshops and among shoppers.

  57. Blair

    It is usually difficult to get skillful individuals on this topic, nevertheless, you sound like you are aware of exactly what you are preaching about! Many thanks

  58. Maris

    Hi there I discovered your webpage by mistake when i was searching Yahoo for this subject, I need to say your page is absolutely valuable I also love the layout, it is wonderful!

  59. free one month xbox live codes| free xbox live codes | free xbox accounts | free xbox codes | xbox accounts

    I?ve read several excellent stuff here. Definitely worth bookmarking for revisiting. I wonder how a lot attempt you set to create any such wonderful informative website.

  60. Mike

    Cool post, thanks. I am currently working professionally on a Defibrillator Tester and did some research into ECG for the project. That, and occasional weird beats (PVC?) I notice have piqued my interest in self-monitoring. I have a pretty decent USB Audio Mixer I have previously used to record ECG – hand to hand, but not in acceptable quality. After reading your post I think I should try the pennies; maybe it can give a better SNR.

  61. Antonia

    Great addict of this blog, a considerable number of your articles or blog posts have definitely helped me out. Looking forward to up-dates!

  62. Ozella

    This is exactly a little something I must do more research into, i appreciate you for the posting.

  63. Héctor

    Hi I am glad to see this awesome project is very interesting, i will do it for a project of my school, if i can make it i will share my results, but i have a doubt about how did you do the communication between the circuit and the PC using the sound card, there is some help you can give me about that or any webpage where i could see it

    well thanks for the project and i send you grettings from Mexico

  64. Eli

    Scott,

    What are the specifications on the diodes for the second amplifier circuit with the 2 LM324s?

    Also, how easily adaptable to manual oscilloscope measurement would this be? i.e. would it be as easy as splicing off the headphone jack and wiring to the inputs with appropriate trigger settings?

    I’ve also read elsewhere that use of insulated headphone or audio cord would also reduce digital or transmission noise. Would this seem practical?

  65. Sean

    hi, Thanks for the awesome DIY. I’m interested in making this circuit but I have a minimal knowledge in this subject. Is that the first circuit you used in the youtube videos? or is it the last (complicated!) one?

  66. online dubai gold price

    It’s really a nice and helpful piece of information. I am satisfied that you just shared this useful info with us. Please keep us up to date like this. Thank you for sharing.

  67. Skyrim Farming Videos

    I do agree with all the ideas you have presented in your post. They are really convincing and will definitely work. Still, the posts are too short for novices. Could you please extend them a little from next time? Thanks for the post.

  68. Axim

    Hi dears I am trying to take real time and continuous signal from 3rd ckt and analyze that in real time Using matlab. if someone Have any idea please share….Thanks.

  69. Seat@hotmail.com

    There are undoubtedly lots of particulars like that to take into consideration. That’s a excellent indicate mention. We provide the ideas above because common motivation however clearly there are concerns like the 1 a person bring up exactly where the most thing is going to be employed in honest excellent faith. I don?capital t determine if guidelines have emerged close to such things as that, but I am certain that that your job is actually clearly recognized as a reasonable game. But computer systems are a mature technology, so when purchasing a laptop computer you can change the specifications associated with whatever gear you’re searching at to suit your requirements.

  70. Noel

    Love the new design. I enjoyed this article. Many thanks for this marvelous post.

  71. Ambrose Guillory

    Hey there! Quick question that’s completely off topic. Do you know how to make your site mobile friendly? My website looks weird when browsing from my iphone 4. I’m trying to find a template or plugin that might be able to resolve this issue. If you have any recommendations, please share. Thank you!

  72. Sam

    You have in the diagram for the complex 6-op amp a 5 volt power supply. On the linked website he uses a 9 volt power supply. Am I missing something?

  73. click here for your christmas card

    It is perfect time to make some plans for the future and it
    is time to be happy. I’ve read this put up and if I may just I want to recommend you few attention-grabbing things or advice. Perhaps you can write subsequent articles relating to this article. I desire to read even more things approximately it!

  74. Adam

    Hi Scott!
    I have made a “copy” of your great procejct, but mostly it makes my angry ;)
    Can you tell my please what can I do against two of my problems:
    - sometimes im reciving a local radio station in place of heart beat,
    - I’m losing the signal very often (by recording), and then it is very difficult to get it back
    I hope for an answer.
    Thank you.

    1. Aadil Shah

      Placing a 1nf ceramic across the feedback resistor (100KΩ) of the opamp might help to prevent it from picking up a radio signal. Also, keeping the leads from the contacts to the opamp as short as possible is important to reduce stray signals.
      You could use shielded cables as well. (more expensive)

  75. shantimoy karak

    dear sir,,it is very good n useful project,,,,,,one question is ,if it can be used to
    cheking a patient,,?

  76. Asim

    Hi
    I made Fancier Circuit: but I have a problem I have
    doubt about three
    Electrodes.
    Please tell me where these electrodes(B,E1,E2) are placed. On both
    hands or chest…

  77. Asim

    Hi
    I made 3rd Circuit: but i don’t no where to place these three
    Electrodes.
    Please tell me where these electrodes(B,E1,E2) are placed. On both
    hands or chest…

  78. Axim

    Hi
    I made 3rd Circuit: but i don’t no where to place these three
    Electrodes.
    Please tell me where these electrodes(B,E1,E2) are placed. On both
    hands or chest…

  79. Charlie

    Hi, i want to ask you some questions. I want to use this ECG to measure the Voltage on skin during moving other muscles, such as arm biceps. I’ll need to register the motion of 6 muscles in total. This last circuit shows nice amplifing schematics, but what with B electrode? For me i need only one for all these 6 electrodes. May you help me, also with suggesting solutions?

    The other thing is, how to use this data by AVR. The signals in the included page are preetty clear, by i dont know how to measure this voltage by e.g. ATmega8 :/ ANy suggestions?

    You propably get curious about what i want to do. It;s just extraordinary control system for my robo arm, in future maybe for arm-exoskeleton. I reallly need some help, I’m good in programming on PC (C++, PHP) but i have really basic knowledge on electronics :)

  80. Nelda J. Crandall

    How can the Russians feel concerning being the opposing/terrorist team in video games?

  81. Phil

    You really make it seem so easy with your presentation but I find this topic to
    be really something which I think I would never understand.
    It seems too complex and extremely broad for me. I’m looking forward for your next post, I will try to get the hang of it!

  82. abdulhamed

    I was very impressed with the idea and method of use, I want to help you to complete the project

  83. Bob

    Sweet, Thanks Scott. Had this up and running in about 10 minutes! Great proof of concept!

  84. Pat

    Scott-

    Thanks so much for this post- brilliant!

    I wonder if you might have any suggestions regarding the following. I have a printout of my ECG taken at my doctor’s office. Do you know of any software that I could upload the image to and have it spit out the meanings of the peaks/valleys/patterns/frequencies/etc.? For example, it might tell me that I have a possible RV conduction delay, etc.

    Any help is appreciated- thanks again!

    Peter

  85. Thaddeus Watson

    Hello there, just become alert to your blog via Google, and found that it’s truly informative. I am gonna be careful for brussels. I’ll appreciate when you continue this in future. Lots of other people will likely be benefited from your writing. Cheers!

  86. wolf

    can I use a NTE928M instead of the LM358N?

  87. Prabhat Adhikari

    Hi there,

    We are a group of doctors and engineers starting a telemedicine project in villages of Nepal.
    Among different other medical instruments, we are also in need of some EKG machines.
    And, we were looking for a way to build an ECG machine on our own from the scratch. Somehow, we landed upon your website.

    Your work is truly inspirational and informative.
    We will try to follow your flowchart to make an ECG machine.
    Thank you so much.

    And, if you have some time to spare, it will be our pleasure to have your opinion in some of our projects.

    with regards,
    Prabhat Adhikari

  88. guest

    Why don’t you use a phantom power source from microphone connector?

  89. anwesa roy

    u’r awesome :) :) :) :)

  90. Genesis Montney

    That software to handle your internet site is called . Try searching on the internet.

  91. http://www.bellacupcakecouture.com/

    I as well as my buddies ended up digesting the excellent advice
    on your website and then instantly I had a horrible suspicion I never
    thanked the blog owner for them. My young boys became consequently glad to read
    through them and have in effect surely been taking advantage of these things.
    Thanks for getting well considerate and for figuring out certain excellent guides most people are really desirous to discover.

    My personal sincere apologies for not expressing
    appreciation to you sooner.

  92. Paul A Grant

    Thanks Scott for putting all that good stuff online. If I don’t find a better system on the web quickly, I will follow your good instructions. I love your arrhythmia charts (eg Poincare) but will have to get familiar with the software you use.

    BUT, I am worried about your lost P-wave. Either you have AF (like me) or there is an important defect in your system. Atrial fibrillation is the most serious common arrhythmia because it results in small clots being shed from the heart into the brain or lungs. AF sufferers that don’t take an anticoagulant like Warfarin are very likely to suffer strokes or pulmonary embolii. AF is characterized by a missing P-wave (and irregular beats). For people like me that are practically symptom-less and can pop in and out of AF, a home ECG that reliably shows the P-wave when it is present will be a godsend.

    Thanks again, Paul

  93. Anonymous

    I´m a retired man and I very interesting in your project. I promised my self to carry out very soon. According schematic it shall work
    without any problem. by the way , I say it will works because I worked as a engineer during 35 year in Philips Medical System and I see circuitry look like good, but… sound cards do not permit DC current and during “u” and “t” phase of ECG is almost DC and so impossible to reach computer and so… display ECG graft .
    Please, answer me if I´m wrong
    Thanks in advance for you help

    franvaqumore@gmail.com

  94. qpooqbfsgh

    rmttatxibsefo, gohnlhgthk

  95. Scott W Harden

    NEW AND IMPROVED VERSION OF THIS DEVICE:
    http://www.swharden.com/blog/2013-04-14-simple-diy-ecg-pulse-oximeter-version-2/

  96. Anonymous

    Hi,

    Thanks for putting up this project! I’m actually currently testing out a similar circuit but I can’t seem to get GoldWave to accept frequencies lower than 20Hz. Please helpp

    Thanks

  97. Anonymous

    Thanks for the upload Scott!

    On GoldWave, I have A LOT of noise as you said when none of them are in contact with the skin. There’s still quite a bit of noise when I touch 1 of the electrodes but when I attach the other one I essentially get nothing. I’m certain that I’m using the same circuit.

    Please help! Any advice would be great!

  98. Bedava slot oyna

    It?¦s really a great and helpful piece of information. I?¦m satisfied that you simply shared this useful information with us. Please stay us informed like this. Thank you for sharing.

  99. mouse click the next page

    Thanks a bunch for sharing this with all of us you really
    understand what you are talking about! Bookmarked.
    Kindly additionally talk over with my website =). We could have a hyperlink alternate arrangement between us

  100. top moscow hotel

    Its such as you read my thoughts! You seem to grasp so much about this, such as you wrote the ebook in it or something.
    I think that you could do with a few p.c. to pressure the
    message home a little bit, however other than that, that is fantastic blog.

    An excellent read. I will definitely be back.

  101. игровые автоматы играть

    Some genuinely nice and utilitarian info on this website, too I conceive the design contains fantastic features.

  102. pear phone

    They attract, engage and indulge people from all regions to fulfil
    one target of theirs and that is to be entertained.
    The most exciting feature is the new browser, which handles web pages in
    a much better way. ll be able to access the Web portal during the call.

  103. Reynaldo

    Really useful, looking onward to visiting again.

  104. penny stocks to watch next week

    Hi there, I think your web site might be having web
    browser compatibility problems. When I take
    a look at your site in Safari, it looks fine however when opening in I.
    E., it’s got some overlapping issues. I simply wanted to give you a quick heads up! Besides that, wonderful blog!

  105. relevant website

    Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your
    point. You clearly know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something
    enlightening to read?

  106. エアジョーダン

    Wonderful items from you, man. I’ve bear in mind your stuff prior to and you’re simply too fantastic.
    I really like what you have obtained right here, certainly like what you are saying and the way in which through which you are saying it.
    You make it entertaining and you still take care of
    to stay it sensible. I can not wait to read far more from you.
    This is actually a terrific website.

  107. Ezra Zeegers

    My spouse and I absolutely love your blog and find most of your post’s to be exactly I’m looking for. can you offer guest writers to write content available for you? I wouldn’t mind composing a post or elaborating on many of the subjects you write in relation to here. Great web site!

  108. Dale Barocio

    wonderful points altogether, you simply won a new reader. What may you suggest about your submit that you made a few days in the past? Any certain?

  109. Moon Routte

    I must point out my respect for your kindness in support of women who actually need help with this one content. Your personal commitment to getting the message all-around has been particularly beneficial and have without exception empowered many people like me to arrive at their ambitions. Your personal insightful publication indicates so much to me and somewhat more to my colleagues. Best wishes; from each one of us.

  110. a

    This website is great 0674ff27c247fbcd7b06693660ff728b

  111. a

    This website is great e57b3fd10e7b39a02d35134f0798125d

  112. Callum

    Hey!
    I’ve just build the circuit and i have everything correct, but im not getting the heart beat signals? I’m getting signals that sound like heart beats, but there not. Even if i dont attach the electrodes to my chest, goldwaves records stuff that sounds like heart beats, but there not. it goes like 2 beat, then it could go 4-5 beats, there all random.. Someone please help me :( I really want this to work :(

  113. wood flooring

    I was wondering if you ever considered changing the structure of your
    site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or
    two images. Maybe you could space it out better?

  114. lectures recommandées

    Certainly this can be irritating, but it is the part of doing business and you have to get used to dealing with it.
    Building Construction: Reduce heating and cooling needs.
    US Department of Defense, Defense Information Systems Agency.

  115. Jon

    I’m trying to build an ECG using your schematics, but with AD620 and python.
    It’s not so easy, but I will give you an update soon hopefully

    Nuclearrambo’s website and videos were deleted!

  116. mcm カバン

    louis vuitton バッグ 新作

  117. super real

    The staff is going to be who provides that experience, so it really
    is up to the manager to effectively communicate and connect to those providing hospitality super real the problem of low salaries in public
    service practice and high student debt continues to
    be compounded through the ”astronomical boost in salaries for starting lawyers inside best firms,” she added.

  118. Naser Sarir

    Hir Scott
    I intersted to your site and your experiment.
    I try to bild ECG with Lm358 and also 3 of ic741 with 3 stage of Lm324 as your circuits shown on your site but I diden’t get truth.
    I worked with Scop and GoldWave Osiliscop program and i have no any problem to get a graphic from my sound card.
    I thik that I do not know, how can I use the Electrods on my body or somthing else.
    would you please guide me to complite my step.
    thank you

  119. micheal

    Hi Scott

    this is crazy, I’m great thanks full for your kindness tutor

    best regard
    MichealGT

  120. online marketing agencies buffalo

    Generally, a well-designed websites can entice a
    lot of guests but then, online marketing strategies and search
    engines should be applied so that the website can be easily found by the people.
    Word of mouth programmes capture, interpret and measure
    a huge range of unprompted online conversations about a brand.
    One of the things the bakery we used as our model, My Little Taste of Italy, does is to network
    effectively both online and off.

    Feel free to visit my site online marketing agencies buffalo

  121. Jason

    The P-wave in your own ECG is absent. Do you have something like atrial fibrillation going on, or is that a consequence of the design?

  122. replacement cartridge filters

    You know thus considerably in terms of this subject, produced me individually believe it from a lot of various angles. Its like men and women don’t seem to be interested unless it’s one thing to do with Girl gaga! Your individual stuffs excellent. At all times care for it up!

  123. esther

    I have tried to copy the simple ECG circuit again and and again, however it does work as MR. Scott’s does.
    Anyone one can make it successfully? Would you please take a photo on your real circuit? Thanks a lot.

  124. Hymer

    Woah this particular weblog is great i love reading through the articles you write. Keep on the great! You recognize, lots of individuals are searching circular with this facts, you may assist these people enormously.

  125. Saifuddin

    hello

    Is MATLAB code available for given code?

  126. Micheal L. Bartels

    I

  127. Executive Travel Marshalswick

    excellent points altogether, you simply won a new reader.

    What may you recommend about your publish that you made a
    few days in the past? Any positive?

  128. http://www.youtube.com/watch?v=lMLpy9keLGg

    Sie wissen, ich denke nicht, dass ich dagegen verlieren
    will. Aber Sie können nicht Würde Sie gern Geschlecht
    mit Ihnen, Sie als mein D zu haben. Es pflegte, für eine schwarze Person ungesetzlich zu sein,
    sich zu verheiraten eine syrische Frau ist wirklich preiswert.
    Ja, Sie kommen online seit mehr als 8 Wochen ohne Benachrichtigung nicht, Sie werden wissen, was Rücksicht Ah
    ah ah ah ah ist, tun Sie es nicht! Mein Gott Ja, was Dem nicht erlaubt wird, weil Kunden zum
    Gespräch dem Herrn nicht zahlen würden.

  129. Alexander

    Hi! Great stuff! I have absolutely no experience in electrical engineering, just some basic physics back in high school and undergrad, but I found this very easy to follow. Is there a way to transmit the signal via Bluetooth?

  130. abhirup

    did u use a 3.5 mm female jack to connect the output of the ecg amplifier to the pc????did u use a 3 pole male or a 4 pole male for the microphone cable????Please reply as i’m planning to do this project.

  131. arun tayal

    What does this b pin means here

  132. Chastity

    I think wɦаt yoս wrote wаs very logical. But, consider this, suppose
    уoս wrote a catchier post title? ӏ mеan, I don’t ԝish to telll ƴоu how
    to run your website, howevеr suppose уou added a title tօ maƴbe get folk’s attention?
    Ӏ meaո DIY ECG Machine Օn The Cheap

  133. AndreaJames

    Hi all, here every person is sharing these kinds of know-how, so it’s nice to read this website, and I used to go to see this blog daily.
    machine design firm

  134. http://www.delay1.delaynews.com

    With the latest study from PEW Research stating that 95%
    of teens have access to the Internet, 80% of kids have cell phones and 48%
    have data plans, providing a safe cyber-space should be a priority for all parents.
    Advertisers all over the place, advertising everything underneath the sun.
    It’s probably some mix of the two, so I have to give
    him props for not going too far in either direction.

  135. Muhammad Waleed Khan

    Dear Scott,
    can I get a more closer view of your circuit I am still a student learning these stuff so please help me out.

  136. cookies by design coupon code

    Link exchange is nothing else but it is simply placing the other
    person’s weblog link on your page at suitable place and other
    person will also do same for you.

  137. Jacklyn

    This article is truly a nice one it helps new the web
    people, who are wishing for blogging.

  138. where do you get warts from

    Hpv in fact , aren’t far more than not cancerous
    growths of your skin that could in regards to
    from being a popular infectivity. The virus that could be honest would be the mankind papillomavirus (Warts), another
    Genetics hsv that could be multiply by two trapped,
    similar to the DNA simply by itself. Herpes locates on its own is
    within a finish on the epidermis and imitations at remarkably
    normal-looking self. There are certainly adjustable versions of HPV that a be the source of various types of warts.
    A certain amount of Warts subtypes have likewise risks of bydureon to result in
    cervical cancer tumors, and other other completely unknown a
    variety of wart-related many forms of cancer,
    advisors they are not that experts claim conventional.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>