All About Circuits Forum How to calculate heart pulse?
 User Name Remember Me? Password
 Register Blogs FAQ Members List Today's Posts Search Today's Posts Mark Forums Read

 The Projects Forum Working on an electronics project and would like some suggestions, help or critiques? If you would like to comment or assist others with their projects, this is the place to do it.

#1
03-26-2011, 03:47 PM
 sakurarandom New Member Join Date: Mar 2011 Posts: 8
How to calculate heart pulse?

My group is given a project namely Heat Beat Monitoring System. We need to come out finger clip sensor that connect to PIC and then connect to PC using USB. Currently, my group has set up the finger clip sensor in breadboard, PIC is loaded with bootloader and Window Forms have been designed using Visual Studio 2008 in C++ language. Now I am facing problem how to calculate the heart rate in PIC using MPLAB in C language. May I know how do determine the output from sensor to PIC is in what form? And in MPLAB, how do i write the coding to calculate the heart beat?

Hereby attach my circuit. There is some error on the PIC connection so kindly ignore it. Thank you so much.
circuit.jpg
#2
03-26-2011, 04:26 PM
 Audioguru Banned Join Date: Dec 2007 Location: Ontario, Canada Posts: 9,411

Look in Google for the HEMON circuit. HEMON is short for Heart Monitor.
The code for the microcontroller is shown.
#3
03-26-2011, 07:59 PM
 russpatterson Senior Member Join Date: Feb 2010 Location: Carlsbad, California Posts: 351

I've made a bunch or photoplethysmographic heart rate monitors. I've usually used a phototransistor but if your LDR works then that's great.

Can you see your heart rate on your PIC's pin 2 if you hook a scope to it? Do you have a blinking LED that goes off when your heart beats?

If your asking for the calculation for beats per minute it's something like:

Count the milliseconds between heart beat pulses on your pic. Then use a formula like: BPM = 60/(milliseconds/1000)

So if there's 1000 mS between beats your heart rate is 60 BPM, one beat per second. If there's 500 mS between beats your BPM is 120.

Last edited by russpatterson; 03-26-2011 at 11:27 PM.
#4
03-27-2011, 03:08 AM
 sakurarandom New Member Join Date: Mar 2011 Posts: 8

Quote:
For the sensor on my breadboard, I am not sure it blink with heart beat or not. I connect pin2 to oscilloscope..it end up a waveform about this shape http://www.picotech.com/experiments/...e/results.html but peak to peak voltage is 53micro second. Kind of weird therefore my group member is going to transfer it to PCB board. One disadvantage of this circuit is that different ppl test the sensor, trigger always have to be made and therefore output voltage from pin2 is different. Thanks for your formula. In C lanaguage for my PIC, how my PIC about to count the period between my beats? This is what bothering me..
#5
03-27-2011, 03:09 AM
 sakurarandom New Member Join Date: Mar 2011 Posts: 8

Quote:
 Originally Posted by Audioguru Look in Google for the HEMON circuit. HEMON is short for Heart Monitor. The code for the microcontroller is shown.
Oh ok. Thanks ya
#6
03-28-2011, 05:08 PM
 sakurarandom New Member Join Date: Mar 2011 Posts: 8

Is anyone know or have software to convert assembly code to c code? I intend to convert pic 16f84 code to c language code. Thanks
#7
03-29-2011, 05:19 PM
 russpatterson Senior Member Join Date: Feb 2010 Location: Carlsbad, California Posts: 351

Get the sample C files for your pic from the HITECH C install. It's free, just google HITECH C DOWNLOAD. To get the timing (there are many ways but here's one) setup an interrupt on a timer (like timer0) set it to go off 128 times per second or something. You can use a counter in that interrupt to know how much time has gone past. You can also just look at the timer values when you detect a beat and reset. That would be more accurate. Anyway getting the PIC working and getting timing values are something you should learn. Get the sample C code working then start reading the datasheet for your pic. Oscillator, timers, and interrupts are what you need to figure out for this.

That wave form you posted certainly looks like it could be heart rate ~60 BPM.
#8
05-13-2011, 09:40 AM
 sakurarandom New Member Join Date: Mar 2011 Posts: 8

Thank you all. My project was successfully done.
 The Following User Says Thank You to sakurarandom For This Useful Post: russpatterson (05-13-2011)

 Tags calculate, heart, pulse

 Related Site Pages Section Title Worksheet Time constant calculations Worksheet Physical effects of electricity

 Similar Threads Thread Thread Starter Forum Replies Last Post tuscarora The Projects Forum 18 03-09-2010 07:20 PM 1337Hendrix The Projects Forum 6 12-02-2009 07:40 PM mantsali Embedded Systems and Microcontrollers 2 10-30-2009 04:53 AM quantumlab The Projects Forum 3 03-03-2009 01:42 PM Mazaag The Projects Forum 2 11-10-2006 07:18 AM

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Electronics Forums     General Electronics Chat     The Projects Forum     Homework Help     Electronics Resources Software, Microcomputing, and Communications Forums     Programmer's Corner     Embedded Systems and Microcontrollers     Computing and Networks     Radio and Communications Circuits and Projects     The Completed Projects Collection Abstract Forums     Math     Physics     General Science All About Circuits Commmunity Forums     Off-Topic     The Flea Market     Feedback and Suggestions

All times are GMT. The time now is 01:52 PM.