DIY Arduino Based Pulse Oximeter Part I (with video)
I recently completed the first half of my Pulse Oximeter. Already, one can see some wonderful information about one’s heart and blood from just your finger tip. So far, I’ve interfaced to the TSL230 light sensor, takinging readings, and displaying it in a Python based QT gui. It sounds complicated but its not. Its lots of fun. Check out the video to see the graph of my heart beating from light passing through my fingertip.
Part II is very delayed (and may never happen). I hope to have the heart beats detected so that I can calculate the heart rate. Also, I will be taking measurements from both LEDs and comparing them. By doing this, I hope I can extract the oxygen saturation (amount of oxygen in my blood).
Update: Since filming the video above, I implemented the heartbeat detection and heart rate calculation. In the image below, the heart rate is calculated and show in the upper right. Also, the heart beats are automatically detected and annotated with little hearts.
Source Code
git clone https://code.google.com/p/avr-libarduino-pulseoximeter/
- or -
https://code.google.com/p/avr-libarduino-pulseoximeter/

Hey Mike,
Very cool. I’m looking forward to seeing what you come up with on the SPO2 side. This is the first project I’ve seen using TSL230. Can you post some example code for it?
I was also interested in how you are going graphing. Can you point me toward some resources or how-tos?
Very nice. Any chance for a schematic/pinouts or some sample source code?
I used a custom python script that uses PyQt4. I’ll post it soon when I get a chance to pick up where I left off on this project.
Hi, very nice. I’m trying to do something similar. So I would be very pleased if you give me some highlights in the way you found the beats. Have you done an adaptive threshold?
thanks in advance
Hey, I was trying to something almost the exact same. I was wondering if I you could post the code which you are running on your Arduino board. It appears as though you are using this sensor.
I’m having a hard time getting my light sensor to actually find the light values accurately.
I would appreciate the help,
JAM
I wrote a basic peak detector. I did this my the PyQt4 application. Basically, it steps through each value and looks in either direction. If none of the nearby values are higher than it, it assumes it is a peak.
Can you please post the Arduino code for what you are doing? I bought all the required components, but i can’t get the code right.
Thanks!
I just emailed you the code. Let me know if you have any questions.
Hey Mike can you also email me the code as well. I have been having some trouble getting things working correctly.
Thanks a lot!!!
I too am trying to make this work and would really appreciate the code for both the AVR and your PyQt4 program.
Thanks,
Justin
hey, after reading your article i ordered
the parts too.
since yesterday i’m trying to reproduce your work -
without success
is it possible to mail me your arduino code, too?
Thanks,
Steffen
@Steffen
I received your request and will happily send you the code. I meant to yesterday but forgot. I don’t have access to it at the moment. If you don’t get anything by tomorrow, please ping me again.
@mike, could you please send the code to me too? Or post it to your blog?
@mike
Did you ever get around to putting together a part 2 in this series? I couldn’t find anything on the site or YouTube – it would be great if I could see how you ended up measuring both the red and IR wavelengths.
Could you send me the arduino sketch for this?
It would be really fantastic if you either posted the code here or gave me permission to submit it to hackaday for posting (giving you credit, of course).
@mythgarr, this article was already posted on hack a day. No, I did not finish the project. I could not get a satisfactory way to calibrate both the white and red LEDs. I think I would need to more carefully select the LEDs and use a constant current device to set the current for each (instead of just trying to tune them with resistors). I don’t have an arduino sketch because, while I use Arduino hardware, I do not use there software stack. I program in straight C and use GNU toolchain. I’d be happy to share the code if you like.
@mike I meant that it would be great if you could post the source code and part 2, but it sounds like those bits never materialized. I’m shopping around on mouser trying to pick out the best LEDs and detectors for a DIY model, although I did find some fairly cheap (~$40) clip-on oximeters online that I might just tap into using serial or whatever protocol they happen to use internally.
Hi Mike. I am trying to build a pulse oximeter with arduino for a High School Project. Could you please send me the source code?
Dear Mike,
I´m studying about pulse oximeters with arduino to do an University work. Could I to see your code?
Thanks and congratulations for the pulse oximeter.
Hey Mike. I really like your arduino based Pulse Oximeter. I am interested in doing this as well. Do you have the source code to go along with this?
Hi Mike,
I’m a student at NYU trying to make a heart rate sensor. We have gotten readings, but they aren’t accurate enough to be used consistently. Could you perhaps shed some light on the physicality of the sensor and perhaps your code?
Thanks
Hi Mike, I was wondering if you could also send me a copy of your Arduino code and any schematics? Any additional info would be greatly appreciated! Thanks, AM
Hey Mike,
I’m a bioengineering student working on a final lab project for this semester, and my group is also trying to build a pulse oximeter using the arduino microcontroller. We are having some trouble with the coding, however, since none of us have much experience with computer programming. Would it be possible for you to email me the source code?
Thanks
Hello Mike, I am currently constructing this, i have all the parts but do not seem to be getting an accurate reading, i was wondering if you could send me your arduino code.
Thank you:)
Mike, I’ve been doing work with some of the Polar hear rate monitors from sparkfun, and would be interested in trying your methods. Could I take a peek at your code? Great writeup!
Mike, I also would like your code. I have the same parts, but have a hard time getting the heartbeats registered.