Introduction: Homebrew Arduino Pulse Monitor (Visualize Your Heartbeat)

Picture of Homebrew Arduino Pulse Monitor (Visualize Your Heartbeat)
Movies look cool with those EKG (electrocardiogram), the one that beeps and detects heart activities. A few months ago, we had to shoot a hospital scene for our school project. We needed an EKG instrument. To keep the movie authentic, we didn't want to fake the readings so we made the next best thing, a pulse monitor. Since my dad is a doctor he gave me some advice to design the pulse monitor. 



Let me clarify this to you. This project works and can actually monitor your pulse. Due to the lack of research and experimentation, the homebrew pulse monitor cannot be used for medical purposes. 

What Can You Do With It?
You can make a lie detector/ polygraph and tell who's lying or not. When a person lies, you'll notice a sudden change on the graph.

What Does This Guide Include? 
- Arduino Codes & Processing 2 Codes
- Steps on making a pulse sensor
- The Virtual Graphing Software
- Schematic Diagrams

What Do I Need To Make This Project?
- A Grippy Clothes Hanger
- Clear/ Bright Red LED
- LDR (Light Dependent Resistor)

Future Questions:
Why isn't mine working? For some reason LDRs (light dependent resistors) are not standard in resistance ratings. You'll need a some tweaking to pull off the project, it may require experience with Arduinos and electronics.

This project is inspired by Make Magazine's pulse monitor although my version didn't use a LM324 Op-Amp chip. Their tutorial will work on my setup. 

Make: Full Tutorial
Programming Stage:

Step 1: Find the Perfect Colthes Hanger

Picture of Find the Perfect Colthes Hanger

This project works best with rubber padded hangers. Luckily "Marks & Spencer" gives away these hangers for free.

Step 2: Cut the Clips

Picture of Cut the Clips

Cut the clips off the hanger with a pair of heavy duty shears. 

Step 3: Disassemble the Clip

Picture of Disassemble the Clip

Get your multitool and disassemble the clip.

Step 4: Drill Holes

Picture of Drill Holes

Drill a hole on the exact center of the clip's rubber pads.

Step 5: Install the LDR

Picture of Install the LDR

Bend the LDR's leads then mount them in place. Finally use hot glue to keep the LDR from moving. 

Step 6: Install the LED

Picture of Install the LED

Get your led and use superglue to keep it intact with the clip. Also, you might want to add a resistor to protect the LED from getting busted. 

Step 7: It Doesn't Work

Picture of It Doesn't Work

You'll barely get a reading. If yours doesn't work, use this circuit to amplify the readings. D1 is just an indicator and not the red LED that's used to light up your thumb. It's best If you use a 10k trimmer resistor for R3 rather than a fixed value resistor. 

Step 8: Wire Them Up!

Picture of Wire Them Up!

Follow the diagram above. PCB/ perfboards are not necessary. Wires would do just fine!

Step 9: Download the Softwares

Picture of Download the Softwares

Processing 2 is the graph/ monitor software that will visualize your data while the Arduino IDE is for uploading the arduino sketch. You'll need both to run the project. Click on the links below to download them. 

Arduino 1.0.5 IDE:click here!
Processing 2 IDE:click here!

Step 10: The Codes

Picture of The Codes

Run these codes on the proper IDE. If the processing 2 codes shows an error, change tho port number (found in the codes).



//Arduino Codes:

void setup() {
  Serial.begin(9600);
}
void loop() {
  Serial.println(analogRead(0));
  delay(50);
}


//Processing 2 Codes:

import processing.serial.*;
    Serial myPort;
    int xPos = 1;
    float oldHeartrateHeight = 0;

    void setup () {
    // set the window size:
    size(1000, 400);
    frameRate(30);

    // List available serial ports.
    println(Serial.list());

    // Setup which serial port to use.
    // This line might change for different computers.
    myPort = new Serial(this, Serial.list()[0], 9600);

    // set inital background:
    background(0);
    }

    void draw () {
    }

    void serialEvent (Serial myPort) {
    // read the string from the serial port.
    String inString = myPort.readStringUntil('\n');

    if (inString != null) {
    // trim off any whitespace:
    inString = trim(inString);
    // convert to an int
    println(inString);
    int currentHeartrate = int(inString);

    // draw the Heartrate BPM Graph.
    float heartrateHeight = map(currentHeartrate, 0, 1023, 0, height);
    stroke(0,255,0);
    line(xPos - 1, height - oldHeartrateHeight, xPos, height - heartrateHeight);
    oldHeartrateHeight = heartrateHeight;
    // at the edge of the screen, go back to the beginning:
    if (xPos >= width) {
    xPos = 0;
    background(0);
    } else {
    // increment the horizontal position:
    xPos++;
    }
    }
    }

Step 11: Learn to Use It!

Make Magazine has a similar project that works exactly the same. I got the codes from them so video should explain the programming procedure. 

Make Magazine's Full Version:


Programming Stage:
This video will explain on how to use both IDEs.

Comments

Timofte Andrei (author)2014-04-25

now, you can use this example to make a device that can be attached on the wrist and can monitor the hearth rate every second and can log everything on an SD card. :D

ASCAS (author)Timofte Andrei2014-04-25

Brilliant! And I'll also add a loud alarm when the sensor detects an irregular pulse rate. It's good for people who have a heart condition.

amorarun (author)ASCAS2014-04-27

Good 'ible...
btw loud alarm to indicate irregular pulse rate for people with heart condition!!?!!
Something subtle should be fine.. Perhaps a light or a vibration motor??

Timofte Andrei (author)amorarun2014-04-29

you need a lower pitch sound to alert events. light can also be a problem for people with heart condition.

MahmoudS42 made it! (author)2017-10-20

What is the problem ?!!

Manuel SebastianB1 (author)2017-08-28

Hola, el Monitor serie tiene que ejecutarse mientras funciona el Process? Porque en el process no me funciona cuando activo el Monitor serie. Me sale Port Busy, cuando activo el Process sin el arduino me funciona bien pero no me grafica nada

ya me grafica, instale el Process 2.1 en vez del 3.0

ZoltanG3 (author)2016-10-11

nice idea!

GRama95 (author)2016-06-07

Hi,
What is the problem with my processing ?((
please help me

psyberjock (author)GRama952016-08-24

I think you're in the Matrix. Umm... you could try taking the red pill.

MollyM17 (author)2015-10-08

Hey! We are a few students, with no tinkering experince, who want to bulid a drawing machine that draws a diagram of pulses. Do you have any tips on how to tranform the pulse data on the computer into movements of a robot arm?

CrisHooker30 (author)2015-07-23

Hate to break it to you polygraph are not used to detect lies they are an intimidation tool.

rohit kashyap (author)2015-07-08

Hello, your project is really good.

I made the sensor and it works well.

The problem is that when I run the Processing sketch, the window appears but it does not display any waveform..!

Please Help...

birnbaum (author)2015-04-04

Can i also use it also at the wrist?

mahnoor gul (author)2015-03-03

processing 2 is showing compatibility issues on my PC. I've windows 8.1 installed on it.

mahnoor gul (author)2015-03-03

processing 2 is showing compatibility issues on my PC. I've windows 8.1 installed on it.

SaarishtT (author)2015-02-06

Arduino IDE Serial Monitor shows a reading around 450. Can't be possible.

SaarishtT (author)2015-02-06

Arduino IDE Serial Monitor shows a reading around 450. Can't be possible.

arombouts (author)2014-12-15

Hey, I want to use this for a project, but I need to see a bpm, is it possible to make it display a bmp, and a graph of the bpm over an interval?

shannon.kai.9 (author)2014-08-29

how to change the port number?

metalix (author)2014-06-27

Umm, where's the diagram

Jan_Henrik (author)2014-05-04

Awesome, have to try it!

kyokorn (author)2014-04-30

Hi the LDR the value is 2 Mohms or 10 Mohms? BR

hunter999 (author)2014-04-27

Now that, is what I call awesome! Thanks for sharing :-)

ufang (author)2014-04-25

black UNO is pretty cool how did u get it

ASCAS (author)ufang2014-04-25

It's a clone. I got it form Alexan, an electronic store here in the Philippines.

ufang (author)ASCAS2014-04-27

oh when i open it i just found the black uno picture show in the main page but no entrance to check the items and no way to place my order. however i turn to google it and got the similar one named sainsmart. i'm not sure it's the one because it's difference. i don't know. the core?

marcoboers (author)2014-04-22

Your setup doesn't work because of wrong wiring, as far as I can see from image in step 7, you should use the LDR in a voltage devider. In you're case the resistance changes but because there is no voltage devider the only thing changing is the amount of current flowing in the analog input of the arduino. You should do it as follow: +5V - LDR -node Vo with line to analog input, and a resitor going to ground. So when the resistance of the LDR changes the ratio of the resistance changes and therefore the voltage at Vo and your analog input changes with results in difference in reading from the arduino. For the resistance needed you should probably try measure the resistance of LDR and take a resistor around that value, or try some values for best results. Don't go to low because then you wille get a current from the 5v to ground and you want to keep that small.

Thom Kouwen (author)marcoboers2014-04-24

Quite simple to fix without the external resistor, it can be done in software. Just enable the pull-up, or in this case, the pull-down resistor, these are build in. You can google, but if I'm correct you can do this : digitalWrite (-an input-, HIGH); to enable the internal pull-up

Mr. E (author)Thom Kouwen2014-04-25

You would need a pull down for the schematic shown, even then A CDS and red led will never give that square trace. That is from an IR led and photo transistor most likely.

Thom Kouwen (author)Thom Kouwen2014-04-25

I am going to correct myself. The atmega only has internal pull-up's, so this setup can indeed not work, as pointed out by two other people already, considering the software is a copy of MAKE's, that's going to require editing aswell.

Mr. E (author)2014-04-25

This project simply does not work , as pointed out by Marcoboers 3 days ago. The traces shown are not from this project but just copied from the Make project (as is just about everything else).

agis68 (author)2014-04-24

brilliant extra amazing....iam speachless!!! voted on both compets....i wish you to be the among the winners

thnx

ASCAS (author)agis682014-04-24

Thanks bro!

andrea biffi (author)2014-04-22

That's an awesome project!!

ASCAS (author)andrea biffi2014-04-24

Hehehe, thanks! :)

loki2012 (author)2014-04-24

Nice soldering job!

LockonStratos (author)2014-04-24

Fantastic!!!!!!

I used to be in a pulse wave project in my tutor's lab for a long time and now it seems I have totally misunderstood the meaning of such kinds of science project. I got my mind stuck in the previous ideas of other's and don't dare to test my own. Thank you so much for showing us this great project.

dbuckley6 (author)2014-04-22

Great job. Loads of "proper" pulse oximeters are fiddly to get to read at times; especially if your hands are cold. Try on multiple fingers, earlobe before deciding that equipment is faulty

andrea biffi (author)2014-04-21

Hi Angelo, something seems to be missed in last step... I read "Programming Stage:" then nothing more...

ASCAS (author)andrea biffi2014-04-21

Oh, thanks for spotting that!

About This Instructable

149,593views

616favorites

License:

Bio: Hi I'm Angelo! I am a 18 y/o college sophomore taking my majors in BS-ECE at the DLSU. I use my course as ... More »
More by ASCAS:DIY Motorized Fidget Spinner! (Contest Entry)DIY Motorized Fidget Spinner! Build A Bluetooth Boombox Speaker (from scratch)
Add instructable to: