Simple DIY ECG + Pulse Oximeter (version 2)

UPDATE: An improved ECG design was posted in August, 2016.
Check out:

Of the hundreds of projects I’ve shared over the years, none has attracted more attention than my DIY ECG machine on the cheap posted almost 4 years ago. This weekend I re-visited the project and made something I’m excited to share!  The original project was immensely popular, my first featured article on Hack-A-Day, and today “ECG” still represents the second most searched term by people who land on my site. My gmail account also has had 194 incoming emails from people asking details about the project. A lot of it was by frustrated students trying to recreate the project running into trouble because it was somewhat poorly documented. Clearly, it’s a project that a wide range of people are interested in, and I’m happy to revisit it bringing new knowledge and insight to the project. I will do my best to document it thoroughly so anyone can recreate it!

The goal of this project is to collect heartbeat information on a computer with minimal cost and minimal complexity.  I accomplished this with fewer than a dozen components (all of which can be purchased at RadioShack). It serves both as a light-based heartbeat monitor (similar to a pulse oximeter, though it’s not designed to quantitatively measure blood oxygen saturation), and an electrocardiogram (ECG) to visualize electrical activity generated by heart while it contracts. Let’s jump right to the good part – this is what comes out of the machine:

That’s my actual heartbeat. Cool, right? Before I go into how the circuit works, let’s touch on how we measure heartbeat with ECG vs. light (like a pulse oximeter).  To form a heartbeat, the pacemaker region of the heart (called the SA node, which is near the upper right of the heart) begins to fire and the atria (the two top chambers of the heart) contract. The SA node generates a little electrical shock which stimulated a synchronized contraction. This is exactly what defibrillators do when a heart has stopped beating. When a heart attack is occurring and a patient is undergoing ventricular fibrillation, it means that heart muscle cells are contracting randomly and not in unison, so the heart quivers instead of pumping as an organ. Defibrillators synchronize the heart beat with a sudden rush of current over the heart to reset all of the cells to begin firing at the same time (thanks Ron for requesting a more technical description).  If a current is run over the muscle, the cells (cardiomyocytes) all contract at the same time, and blood moves. The AV node (closer to the center of the heart) in combination with a slow conducting pathway (called the bundle of His) control contraction of the ventricles (the really large chambers at the bottom of the heart), which produce the really large spikes we see on an ECG.  To measure ECG, optimally we’d place electrodes on the surface of the heart. Since that would be painful, we do the best we can by measuring voltage changes (often in the mV range) on the surface of the skin. If we amplify it enough, we can visualize it. Depending on where the pads are placed, we can see different regions of the heart contract by their unique electrophysiological signature. ECG requires sticky pads on your chest and is extremely sensitive to small fluctuations in voltage. Alternatively, a pulse oximeter measures blood oxygenation and can monitor heartbeat by clipping onto a finger tip. It does this by shining light through your finger and measuring how much light is absorbed. This goes up and down as blood is pumped through your finger. If you look at the relationship between absorbency in the red vs. infrared wavelengths, you can infer the oxygenation state of the blood. I’m not doing that today because I’m mostly interested in detecting heart beats.

For operation as a pulse oximeter-type optical heartbeat detector (a photoplethysmograph which produces a photoplethysmogram), I use a bright red LED to shine light through my finger and be detected by a phototransistor (bottom left of the diagram). I talk about how this works in more detail in a previous post. Basically the phototransistor acts like a variable resistor which conducts different amounts of current depending on how much light it sees. This changes the voltage above it in a way that changes with heartbeats. If this small signal is used as the input, this device acts like a pulse oximeter.

For operation as an electrocardiograph (ECG), I attach the (in) directly to a lead on my chest. One of them is grounded (it doesn’t matter which for this circuit – if they’re switched the ECG just looks upside down), and the other is recording. In my original article, I used pennies with wires soldered to them taped to my chest as leads. Today, I’m using fancier sticky pads which are a little more conductive. In either case, one lead goes in the center of your chest, and the other goes to your left side under your arm pit. I like these sticky pads because they stick to my skin better than pennies taped on with electrical tape. I got 100 Nikomed Nikotabs EKG Electrodes 0315 on eBay for $5.51 with free shipping (score!). Just gator clip to them and you’re good to go!

In both cases, I need to build a device to amplify small signals. This is accomplished with the following circuit. The core of the circuit is an LM324 quad operational amplifier.  These chips are everywhere, and extremely cheap. It looks like Thai Shine sells 10 for $2.86 (with free shipping). That’s about a quarter each. Nice!  A lot of ECG projects use instrumentation amplifiers like the AD620 (which I have used with fantastic results), but these are expensive (about $5.00 each). The main difference is that instrumentation amplifiers amplify the difference between two points (which reduces noise and probably makes for a better ECG machine), but for today an operational amplifier will do a good enough job amplifying a small signal with respect to ground. I get around the noise issue by some simple filtering techniques. Let’s take a look at the circuit.

This project utilizes one of the op-amps as a virtual ground. One complaint of using op-amps in simple projects is that they often need + and – voltages. Yeah, this could be done with two 9V batteries to generate +9V and -9V, but I think it’s easier to use a single power source (+ and GND). A way to get around that is to use one of the op-amps as a current source and feed it half of the power supply voltage (VCC), and use the output as a virtual ground (allowing VCC to be your + and 0V GND to be your -). For a good description of how to do this intelligently, read the single supply op amps web page. The caveat is that your signals should remain around VCC/2, which can be done if it is decoupled by feeding it through a series capacitor. The project works at 12V or 5V, but was designed for (and has much better output) at 12V. The remaining 3 op-amps of the LM324 serve three unique functions:

STAGE 1: High gain amplifier. The input signals from either the ECG or pulse oximeter are fed into a chain of 3 opamp stages. The first is a preamplifier. The output is decoupled through a series capacitor to place it near VCC/2, and amplified greatly thanks to the 1.8Mohm negative feedback resistor. Changing this value changes initial gain.

STAGE 2: active low-pass filter. The 10kOhm variable resistor lets you adjust the frequency cutoff. The opamp serves as a unity gain current source / voltage follower that has high input impedance when measuring the output f the low-pass filter and reproduces its voltage with a low impedance output. There’s some more information about active filtering on this page. It’s best to look at the output of this stage and adjust the potentiometer until the 60Hz noise (caused by the AC wiring in the walls) is most reduced while the lower-frequency component of your heartbeat is retained. With the oximeter, virtually no noise gets through. Because the ECG signal is much smaller, this filter has to be less aggressive, and this noise is filtered-out by software (more on this later).

STAGE 3: final amplifier with low-pass filter. It has a gain of ~20 (determined by the ratio of the 1.8kOhm to 100Ohm resistors) and lowpass filtering components are provided by the 22uF capacitor across the negative feedback resistor. If you try to run this circuit at 5V and want more gain (more voltage swing), consider increasing the value of the 1.8kOhm resistor (wit the capacitor removed). Once you have a good gain, add different capacitor values until your signal is left but the noise reduced. For 12V, these values work fine. Let’s see it in action!

Now for the second half – getting it into the computer. The cheapest and easiest way to do this is to simply feed the output into a sound card! A sound card is an analog-to-digital converter (ADC) that everybody has and can sample up to 48 thousand samples a second! (overkill for this application) The first thing you should do is add an output potentiometer to allow you to drop the voltage down if it’s too big for the sound card (in the case of the oximeter) but but also allow full-volume in the case of sensitive measurements (like ECG). Then open-up sound editing software (I like GoldWave for Windows or Audacity for Linux, both of which are free) and record the input. You can do filtering (low-pass filter at 40Hz with a sharp cutoff) to further eliminate any noise that may have sneaked through. Re-sample at 1,000 Hz (1kHz) and save the output as a text file and you’re ready to graph it! Check it out.

Here are the results of some actual data recorded and processed with the method shown in the video. let’s look at the pulse oximeter first.

That looks pretty good, certainly enough for heartbeat detection. There’s obvious room for improvement, but as a proof of concept it’s clearly working. Let’s switch gears and look at the ECG. It’s much more challenging because it’s signal is a couple orders of magnitude smaller than the pulse oximeter, so a lot more noise gets through. Filtering it out offers dramatic improvements!

Here’s the code I used to generate the graphs from the text files that GoldWave saves. It requires Python, Matplotlib (pylab), and Numpy. In my case, I’m using 32-bit 2.6 versions of everything.

# DIY Sound Card ECG/Pulse Oximeter
# by Scott Harden (2013)

import pylab
import numpy


data = numpy.array(raw,dtype=float)
data = data-min(data) #make all points positive
data = data/max(data)*100.0 #normalize
times = numpy.array(range(len(data)))/1000.0
pylab.xlabel("Time Elapsed (seconds)")
pylab.ylabel("Amplitude (% max)")
pylab.title("Pulse Oximeter - filtered")

Future directions involve several projects I hope to work on soon. First, it would be cool to miniaturize everything with surface mount technology (SMT) to bring these things down to the size of a postage stamp. Second, improved finger, toe, or ear clips (or even taped-on sensors) over long duration would provide a pretty interesting way to analyze heart rate variability or modulation in response to stress, sleep apnea, etc. Instead of feeding the signal into a computer, one could send it to a micro-controller for processing. I’ve made some darn-good progress making multi-channel cross-platform USB option for getting physiology data into a computer, but have some work still to do. Alternatively, this data could be graphed on a graphical LCD for an all-in-one little device that doesn’t require a computer. Yep, lots of possible projects can use this as a starting point.

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

LET ME KNOW WHAT YOU THINK! If you make this, I’m especially interested to see how it came out. Take pictures of your projects and send them my way! If you make improvements, or take this project further, I’d be happy to link to it on this page. I hope this page describes the project well enough that anyone can recreate it, regardless of electronics experience. Finally, I hope that people are inspired by the cool things that can be done with surprisingly simple electronics. Get out there, be creative, and go build something cool!


78 thoughts on “Simple DIY ECG + Pulse Oximeter (version 2)

  1. Hi Scott, very interesting project, I’m thinking about testing it out once cleared of all my deadlines… I’ve noticed, however, that specs for LM324 (for example here allows operating from single supply voltage in the range of 3V to 30V. So I’m still not quite understand why we need to use the virtual ground? As the ground reference to the signal?..
    Thank you and best regards,
    Mac Ha

    • Mac, indeed the chip can operate as single supply, but there are advantages of using a virtual ground. It is touched on in this page:

      Briefly, the easiest way to design high-gain op-amp stages is to use +VCC, -VCC, and feed the small input signals near 0V (GND). By using a single supply with virtual ground, we have -VCC (0V), virtual ground (6V), and +VCC (12V). If we treat the virtual ground as ground, and feed it very small signals (decoupled through a series capacitor), the op-amp does an excellent job of amplifying it. The primary advantage is that, although the circuity is identical to that requiring +6V and -6V, with the virtual ground a negative power supply is not needed.

  2. Hello Steve.

    I’ve been checking you projects (well, mostly the first ecg and the pulse oximeter) and let me say I’m a big fan of yours!
    I’d love to make the pulse oximeter for my analog electronics class, but I have a few questions about the scheme:

    1. In the virtual ground, where is the upper 100k R conected? Is it connected to Vcc?
    2. What about R’s value in the phototransistor’s collector? (Rc)
    3.Wich phototransistor should I use?

    Thanks a lot, I hope i didn’t bother you too much.

    I’ll let you know how it went!

    • 1.) Yes, connected to VCC. Since both Rs are the same value, the voltage divider takes the voltage to 1/2 of VCC. Thus, virtual ground becomes VCC/2

      2.) The phototransistor R depends on what phototransistor you use. Also, different Rs will change the sensitivity of the output. Experiment (perhaps with a potentiometer) to find an R you like. 10k seems like a good value, but it’s quite flexible.

      3.) My exact phototransistor is which I purchased on eBay 10 for $3 (free shipping). Pretty much any phototransistor will do. If it’s an IR phototransistor, it will only respond to IR light (like that coming out of a TV remote control), but I’m not sure how it would work for pulse. It might actually work really well for pulse detection if you use an IR led.

      Keep in touch, let me know of your progress!

  3. Scott, It’s good that the circuit does so well measuring pulse – but you really should take the term “Oximeter” out of the description. You make it clear in the text that this is not an Oximeter, and that it doesn’t try to be one, but the misleading term is in the title, in the writeup and in the Hack-a-Day article that I followed a link in to get here.

    What would be nice to see would be a followup design that did use differential absorption at different optical wavelengths to produce a genuine oximeter – a real black art.

    I like your clothes peg finger grip. You can also use earlobes for sensing and even the wall of your mouth! (Clip with one jaw insid mouth and the other on your cheek. You’d probably want a clip with less spring power :-).


    Russell McMahon

    • Thank you for the tip! I added the words “photoplethysmograph” and “photoplethysmogram” to the bolded text, which I hope further clarifies (to Google if nothing else) what it is officially referred to as.

      I agree that a true pulse oximeter would be useful, and one is in the works! I’m using a ubiquitous ATMega48’s analog-to-digital inputs to read the output of LM234-amplified signals and sending the data a few hundred times a second to the PC via RS-232 into an FTDI USB interface chip. Coupled with some graphing software I wrote with Python and Qt, it graphs (A) red absorbency, (B) infrared absorbency, and (C) the difference between the two. It’s not finished yet, but it’s certainly a stab in that direction doing it at minimal cost/minimal complexity. Thanks for the encouragement!

  4. Scott-

    Your design is very elegant, using very common components which is terrific. In your replies you mention you are using an ATMega for your upcoming project. You may want to use the Arduino code from my web page
    The limitation with older Arduino’s is the slow FTDI, that limits your communication rate to about 100 Hz and the 10-bit ADC. In these respects your technique of using the 44 kHz and 16-bit audio port has big advantages. My software allows the microcontroller to oversample the data, for example you could sample the data at 1600 Hz and transmit it at 100 Hz. You will get better precision (square root law). I provide sample oscilloscope software in the XCode, Processing, Lazarus and Matlab languages. You will get much better USB bandwidth with a 32u4 device that has in-built USB (Arduino Leonardo or Teensy 2). However, I suggest the ARM-based Teensy 3 that has terrific bandwidth and theoretically 16-bit ADC (about 14 bit in reality). My code works with both AVR and ARM CPUs (you need to specify the device in the first few lines), and uses interrupts for precise timing.

    By the way, your data suggest that the op-amps are sufficient for ECG, and your design is very elegant. For advanced users, the following pages shows how to use an instrumentation amplifier for EMG (using an audio port) and much smaller and lower frequency EEG (using an Arduino):

  5. Hi again, just a little confused, I’m not that well versed in electronics, so excuse me for my obvious stupid question. But when using as ECG with electrodes, do both leads go to the same input? Or does one go to the VG and one to IN?

    Also would it be possible to combine the data from both ECG and pulse oximeter to cancel out noise further?

  6. This is a cool little project. I’m going to have to give it a try.

    I ran some simulations and it looks like, if you’re going to run it at 5V, a 0.1u input cap is needed instead of the 0.22u. And a 0.1u decoupling cap at the non-inverting input of the virtual ground op-amp would help to protect that part of it from power supply fluctuations.

  7. Just an addendum to what I wrote. The 0.22u input cap may work with a 5V supply if the input signal is small enough. If the first stage shows clipping then drop the cap down in size.

  8. can you put up a board diagram for the ECG and the pulse oximeter circuit??? It would be really helpful. Is this the same ecg circuit that you posted using two lm324s. ???

  9. One more question, will using a battery powered mobile audio recorder or laptop make the circuit safer to use? Regarding any potential life threatening current over your chest?

  10. I’m very much a novice to circuits, but I’d love to assemble this. I have all the components to put it together, but I’m a deer in the headlights when it comes to reading schems. Is there any way to get some hi def pics of the physical circuitry to get a better idea of the connections?

  11. Hello. I have a doubt regarding output potentiometer: the idea is simply to reduce voltage? what about current? Because with ohm’s law, the current must raise through the potentiometer (and directly to the sound card), am i right?

  12. Hey great post!

    I was wondering where exactly you place the leads. I know you said to put them in an armpit-chest configuration but can you post a good diagram for exactly where to do 2-lead placement. There’s not much I can find on the web but it would be a GREAT help since this step is the hardest

    • The fairly common positioning for routine monitoring of a surface ECG would be known as Lead II. This places the negative electrode on the right arm (shoulder or wrist) or right torso above the clavicle. The positive electrode should be placed on the left leg (thigh or above the ankle) or left flank/abdomen just above the waist.

      If you look up Einthoven’s Triangle you’ll find examples of the other common “Limb Lead” positions, and more likely you’ll want to look at Mason-Likar positioning to make monitoring more convenient with respect to electrode positioning (“ambulatory monitoring”).

  13. An excellent post. I am building my own Pulse Oximeter based on Op-amps and arduino, still lots to do. The only issue I have is with the post title as you mention you are building a heart/pulse monitor and not an Oximeter. Anyway, well done, excellent write up.

  14. I’ve used a small EKG project like this as a lab exercise in my Applied Circuits class. I’ve also done some little PC boards to do “blinky EKGs”.

    See, for example

    I never had any luck with op-amp-only designs like the one here, and have had much better luck using instrumentation amps. The INA126P is only about $2.50.

  15. Hey Scott,

    Superb ECG design man. Simple and reproducible DIY project. Reading through the comments on here, you mentioned back in April of this year that you were working on an actual Pulse Oximeter design using the NIF and Red LED combo. I’m very curious to know if you have made progress on that design.

  16. HI Scott,
    Thanks a lot for those detailed explanations.
    I tried the original ECG version but wasn’t able to make it work properly (actually it gives the same signal if I disconnect the batteries…).
    I was looking forward to trying this new version but the technical part seems even less documented that in the first one. I can’t find references to the parts or their name (except for the op-amp) and there’s no clean diagram of the circuit. Moreover, the hand-made drawing doesn’t explain how to turn the pulse-meter into an ECG machine as said in the video.

    I’m a third year medical student from Europe, I’ve only basic skills in electronic, soldering and stuff but I really want to build something that works because of my interest for electrophysiology. Your work is wonderful but could be even better with those details.

    Anyway, thanks again!

  17. Dear Scott
    nice design! I just finished the rebuild of your optical pulsemeter. I wonder if one ‘just’ detects the movement which is induced by the bloodpressure change, as extremely slight twitches induce a much stronger but similar signal. I will play around with a 300 mW 638 nm laser and light up my finger like a christmas tree to see whether physical contact to the sensors is necessary or not.

  18. Hi Scott,

    I was wandering if you can help me with a project I have.
    I need to design a pulse oximeter like the one you published but I want it to be an embedded system using a microcontroller. You know the finger clip connected to the board and the LCD will show the heardbeads and the oxygen ect…

    Looking forward for your reply


  19. Hello Scott,
    My group and I are working on our senior project. We need to measure the output from a pulse oximeter. Then we will take that output and use it as a input for a pump. We made a circuit consisting of Low pass filters and amplifiers. I was wondering if you know how we can measure the output.
    Thank You

  20. Hi Scott,

    Wow its just amazing how u can build all this.
    I am planning on making an oximeter as well using ATMEGA32 microcontroller. This microcontroller uses 5V of power so I am thinking I will have to buy an O2 sensor that operates within 5V.

    I am unable to find any O2 sensor like that ;(
    also I dont understand with signal conditioning I will have to use (filters, op amps etc) while connecting to the microcontroller.

    Please help and please reply asap.
    Looking forward to your reply.

  21. DearScott:

    Wish you all the best on your career! That said, have you ever build a triggering attached to a shunt? Specifically I am using a 100 Amp shunt (50mV full scale) and I am looking to build a trigger that goes high to release a latching relay, a kind of circuit breaker, but one that set/resetable using a momentary toggle switch (mom. up to latch a relay, mom. down to release it) and that limits the current across the shunt to 100 amps which if exceeded, opens a relay that drives a high current contactor. I was considering using two opAms such as a 741’s one to provide signal gain and the other to be used as a comparator that will set the trip threshold, i.e. if the high limit is 50mV (amplified 20x to say 1 voltP, then any signal higher then the preset voltage of 1 volt will provide a sink of the output that pulls down the base of an NPN transister which in turn is inverted by coupling its output to ground and the emitter to the base of the second NPN and also a current limited 12v power supply. The idea is that the second NPN transister will pass through the closed contacts of a latched relay before driving the relay’s releasing coil. Any thoughts?

  22. Very neat, and you could likely clean it up further with a high pass filter of ~1 Hz, which should be satisfactory for routine/ambulatory monitoring. If you’re using lower quality electrodes a bandpass filter of 1 Hz / 21 Hz should be sufficient. Simple skin prep with an alcohol pad and a towel can improve your signal as well (the skin/electrode interface is a common cause of interference).

    I noticed some commentators on Youtube were wondering about the amplitudes of your P-waves with this project, which is likely due to the lead position you chose (the uncommon qRs configuration certainly reflects the positioning). Positioning of the negative electrode closer to the head of your sternum and the positive electrode just to the right of your xiphoid process would enable closer inspection of the P-waves for your viewers (this is a variant of Sir Thomas Lewis’ atrial lead). The standard Lead II positioning of electrodes may also help in this endeavor.

    Lastly, the Bundle of His actually rapidly conducts electrical signals from the AV Node out to the bundle branches and finally into the Purkinje fibers in the ventricles. It is the different myocardial tissue in the AVN itself which slows conduction just long enough to allow the atria to better fill the ventricles before the ventricles receive their message to contract. I think it would also be better to change “Heart Attack” for “Sudden Cardiac Arrest”, as there are numerous other causes of ventricular fibrillation unrelated to myocardial infarction.

    Very impressed by the project, and I think I’m going to have to attempt this on my RPi at home!

  23. why in the image are 5 capacitors and 2 potentiometers? in the scheme there are only 3 capacitors and 1 pot .

    I have tried to mount it and it seems my phototransistors don’t conduct .

  24. Why a capacitor of 0.22uF? I have put one and i don’t understand why I put a led in the output of the capacitor and can’t see light , but if i don’t put the capacitor , then i see the led’s light.

  25. Hi, scott, i doing project named as design a pulse co-oximeter with the use of digital signal processor, i here ask one important doubts pulse oximeter circuit only i used apply the mathematical computation over observed electrical parameters(that are observed from sensors similar your finger clip) in the way if possible to obtain the 3 or 4 parameters of pulse co-oximeter.!

  26. Hi,Scott, I’m working with a pulse oximeter project for my bachelors in electronics and telecom. This post of yours is very helpful regarding the same. But i would like to know whether the above mentioned project be extended as a Pulse oximeter..? And if yes then what changes should be made in the design or the code. Will you be able to help me with it.

  27. I am new to this area, your works are real cool… i was thinking about implementing this… but got a bit confused… how do i use the sound card…could you be a bit more elaborate?

  28. Hi would you mind sharing which blog platform you’re using?
    I’m looking to start my own blog soon but I’m having a hard time
    deciding between BlogEngine/Wordpress/B2evolution and
    Drupal. The reason I ask is because your design seems different then most blogs and I’m
    looking for something unique. P.S My apologies for getting off-topic but I had to ask!

  29. Hello, Scott!

    I am working on my senior project for BMET, and we’re building an electric bike that will take the rider’s pulse via pulse grips mounted on the handlebars and we’re trying to figure out which op-amp would be best to use for the ECG circuit. I’ve heard LM324, LF353N, INA121, etc. What would you recommend?


  30. Hello Scott
    I am trying your projet.But not ok now.
    1.finished circuit
    2.downlad and instralled Goldwave5
    3.Record Ecg
    4.filter band pass under 40Hz
    What must i do next stage
    I want to run your ECG on android oscilloscope

  31. Hi,

    You said that you want to do a real oximeter, and you´re very close, cause you only have to repeat the same circuit with an IR light and do a simple processing with both signals, wich is (IR data/ (Red data + IR data)) x 100 and that’s your percentage off blood saturation.

  32. if you run on low voltage batteries with no ac driven power supply , then there is no danger of injury . AC is to be feared because even small currents can leak into the thorax and mess with that nice normal sinus ryhthm you show on your post . Great work , keep it up .

  33. Has anyone tried to make this using a 5V supply? The phototransitor I am using runs off 5V and I am having issues trying to work out some of the cap and resistor values

  34. hi scott ,

    currently i am involving into this project on blood oximeter which base on an1525a. could you provide me a sample code of how to calculated the spo2 and heart pulse.

  35. Hi Scott, very nice project!

    I’m trying to create your ECG hardware, but is not working for me.
    Please, could you send to me the full detail circuit?

    To see the heart beat in the oscilloscope, I’m using a RC filter cutting in 2Hz (120BPM).
    My normal BPM is close from 70.

    I’m using LM342N to amplificate 100 times the original signal.

    What I’m doing wrong?
    I’m will be grateful by the full circuit of ECG (Heart Beat).


  36. Hi Scott

    I’m having troubles connecting the output to the usb soundcard. In the picture seems like you use a capacitor, i don’t understand why. I think a more detailed explanation will help me very much.


  37. Dear mr. Harden,
    Yours is a truly awesome project, and l’ll have a fling at recreating it with a small modification. Although I’ve always been interested in electronics and built quite some radios (from Crystal Brush to Super Het) as a boy, this is now more than 60 years ago, and I haven’t kept up.
    The reason I want to build an EGC Recorder is that I really need it. I’m suffering from a typical and frequent old age problem called Atrial Fibrillation. Moreover, I belong to those patients who are often without symptoms, especially when an attack occurs at night and is of short duration.
    So I need to know what happened during the night. A single channel ECG suffices because fibrillation is always accompanied by heart racing. Long term monitoring is either horrendously expensive – in the medical sector, or you pay for it with handing over your most sensitive data to people like “Endomondo” or “Runtastic”.
    In comes your DIY ECG detector. The main problems with long term recording are saving the data and then transporting them to the PC. Using an Atmel or Arduino is way over my head, and I’ve come up with a different solution – maybe: My wife had at some time need of a Dictaphone but not anymore. The thingy has a Micro-SD chip for storage amounting to nearly one week’s capacity.
    I plan to output the OpAmp’s signal to the Dictaphone, and from there, using the phone jack, to the PC – as a kind of acoustic coupler (communication device from the stone age). Signal levels will have to be adapted to the diverse devices, of course.
    Could you please tell me what you think about my idea, and if it could work? Or am I inventing the wheel anew?
    Thanking you in advance for your response, I have the honour to remain yours sincerely,
    Jan the Fossil

    Dear mr. Harden,
    Yours is a truly awesome project, and l’ll have a fling at recreating it with a small modification. Although I’ve always been interested in electronics and built quite some radios (from Crystal Brush to Super Het) as a boy, this is now more than 60 years ago, and I haven’t kept up.
    The reason I want to build an EGC Recorder is that I really need it. I’m suffering from a typical and frequent old age problem called Atrial Fibrillation. Moreover I belong to those patients who are often without symptoms, especially when an attack occurs at night and is of short duration.
    So I need to know what happened during the night. A single channel ECG suffices because fibrillation is always accompanied by heart racing. Long term monitoring is either horrendously expensive – in the medical sector, or you pay for it with handing over your most sensitive data to people like “Endomondo” or “Runtastic”.
    In comes your DIY ECG detector. The main problems with long term recording are saving the data and then transporting them to the PC. Using an Atmel or Arduino is way over my head, and I’ve come up with a different solution – maybe. My wife had at some time need of a Dictaphone but not anymore. The thingy has a Micro-SD chip for storage amounting to nearly one week’s capacity.
    I plan to output the OpAmp’s signal to the Dictaphone, and from there, using the phone jack, to the PC – as a kind of acoustic coupler (communication device from the stone age). Signal levels will have to be adapted to the diverse devices, of course.
    Could you please tell me what you think about my idea, and if it could work? Or am I inventing the wheel anew?
    Thanking you in advance for your response, I have the honour to remain yours sincerely,
    Jan Willem E. Roberts


  38. hey,
    I’m going to exhibit your project as a mini course outcome of the subject “Linear Integrated Circuit”. It would be of great help if you could list out the components required for the pulse oximeter. If the LM324 can be substituted with any other IC of op-amp, that would be helpful.