Monitor your heartbeat with a webcam and a flashlight

After seeing some heart rate monitor apps for Android which use the camera and flashlight features of the phones, [Tyson] took on the challenge of coding this for himself. But he’s not using a smart phone, instead he grabbed a headlamp and webcam for his heat rate monitor.

To start out he recorded a test video with his smart phone to see what it looks like to cover both the flash LED and camera module with his thumb. The picture is mainly pink, but there’s quite obviously a color gradient that pulses with each gush of blood through his skin. The next task was to write some filtering software that could make use of this type of image coming from a webcam. He used C# to write a GUI which shows the live feed, as well as a scrolling graph of the processed data. He took several tries at it, we’ve embedded one of the earlier efforts after the break.

Comments

  1. snowrail says:

    You shouldn’t need the extra lamp for this. I have an app on my iPhone that watches my face to tell me my pulse quite accurately. I have others that work my illuminating my finger using the built-in flash/light. They work extremely well. It’s funny because I actually just posted about using them on my blog totally coincidentally.

    Here are a pair of screenshots: http://www.zentastic.com/blog/wp-content/uploads/2012/05/heartbeat.gif

    • mike says:

      which app is that?

      • snowrail says:

        Just search for “heart beat” and you will find dozens, many of them free.

        In terms of what I can vouch for personally, the one that uses your face is called “What’s my heart rate” (by ViTrox Technologies) and the other two I have installed that us the lamp/finger are both called “Heart Rate” (one by “CMG Research” and the other by “Modula d.o.o.”)… All of those are free also.

      • snowrail says:

        And those apps I just mentioned are the iPhone ones. I have one on my Android Tablet (Acer Iconia) as well but I don’t have that with me so I can’t tell you the specific one.

      • mike says:

        so far, the only one i can get working is HeartScan which uses the mic

        pretty much all of the camera based ones dont work, but i’ll try What’s my heart rate and the others next

      • snowrail says:

        I haven’t tried the mic based ones… I can’t imagine they would be accurate. The three I listed, at least on my new iPhone, work beautifully and are very accurate. The one on my android tablet is accurate as well. If they’re not working for you, try again, you may be doing something wrong. If you’re trying the finger+light+cam ones and they’re not working, it might be a pressure issue — pressing too hard will cut off the bloodflow, and too light and there’s too much noise in the signal to get a read. Just a light even pressure works best.

  2. Isaac says:

    His final product which is actually really accurate:

  3. conundrum says:

    This probably works due to the small infrared content of incandescent white light, and the inherent sensitivity of most cameras to infrared.
    If you were to take the filter off a cheap webcam as I did and redo the experiment the resulting change in brightness should be more evident.

    Nice hack BTW, wonder if it would also be able to test for SpO2 with differential switching of infrared and visible LEDs on sequential frames?
    The commercial disposable sensors use a pair of LEDs with a thermal feedback element (to keep wavelengths constant) and a calibrated silicon diode.

  4. conundrum says:

    Come to think of it, a nice hack to Mr Cheap Laptop would be to build a microhub in single chip form) and add TWO webcams.
    Both of them have the IR filter removed, but
    due to the offset 3-D is quite possible.

    Only works if the webcams “play nice” ie slightly different models but identical formats.

    I found the best way to get these filters off is to carefully unscrew the lens, don safety goggles and carefully take wire cutters and squeeze where that little red filter is.
    If you are lucky it will pop off intact without damage to the lens so it can be recycled.

    Full 3-D screen laptop mod coming soon :-)

  5. AussieTech says:

    If you are going to start modding the camera surely it would be more practical to simply use an optical sensor which doesn’t have a built in system to automatically adjust the exposure of the image tending to suppress exactly what you are looking for?

  6. Kris Lee says:

    Can you measure blood pressure by this too?

  7. Julia Mossbridge says:

    Hi there —

    I do research on, among other things, psychophysiology at Northwestern University.

    I have three questions for you:
    1) would you consider sharing your best algorithm with me for X dollars?
    2) if so, what is X?
    3) you mention in your videos that your heart rate is moving all over — FYI, this is what healthy heart rates do. For people who are not overly stressed, the heart rate should follow a sinewave pattern…it only stays the same over time when people are stressed out, or in certain pathological conditions like PTSD or anxiety disorder. So congrats!

    Take care and thanks for considering it,

    Julia

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,050 other followers