Microcontroller Measures Heart Rate Through Fingertip





Introduction: Microcontroller Measures Heart Rate Through Fingertip

Microcontroller Contest

Runner Up in the
Microcontroller Contest

Heart rate is a very vital health parameter that is directly related to the soundness of the human cardiovascular system. This project describes a technique of measuring the heart rate through a fingertip using a PIC microcontroller. While the heart is beating, it is actually pumping blood throughout the body, and that makes the blood volume inside the finger artery to change too. This fluctuation of blood can be detected through an optical sensing mechanism placed around the fingertip. The signal can be amplified further for the microcontroller to count the rate of fluctuation, which is actually the heart rate.

Update: For those who are interested to replicate this project, you can use Easy Pulse sensor that covers the complete sensor and instrumentation part. Easy Pulse is a photoplethysmography-based pulse sensor using a similar circuit as described in this project.

Also check out the Arduino version of this project here.

Step 1: Sensor Assembly

The sensor unit consists of an infrared light-emitting-diode (IR LED) and a photo diode, placed side by side, and the fingertip is placed over the sensor assembly, as shown below. The IR LED transmits an infrared light into the fingertip, a part of which is reflected back from the blood inside the finger arteries. The photo diode senses the portion of the light that is reflected back. The intensity of reflected light depends upon the blood volume inside the fingertip. So, every time the heart beats the amount of reflected infrared light changes, which can be detected by the photo diode. With a high gain amplifier, this little alteration in the amplitude of the reflected light can be converted into a pulse.

Step 2: Signal Conditioning Circuit

The reflected IR signal detected by the photo diode is fed to a signal conditioning circuit that filters the unwanted signals and boost the desired pulse signal. The circuit diagram above shows the IR LED (D1) and the photo diode (D2) along with the signal conditioning circuit made of two stage operational amplifiers configured as active low pass filters. The cut-off frequencies of both the filters are set to about 2.5 Hz, and so it can measure the pulse rate up to 2.5*60 = 150 bpm. The gain of each filter is about 100, which gives the total 2-stage amplification of 10000. This is good enough to convert the weak pulsating signal into a TTL pulse. Note that at the input of each OpAmp filter stage, there is a 1 uF capacitor to block any DC component in the signal. At the output is connected a LED that will blink with heart beat. The cathode of LED gets the ground path through the collector of BC547 transistor. In order to save the battery life, the transistor is turned on for 15 seconds by PIC16F628A microcontroller while the measurement is going on. The number of pulses counted within this interval is multiplied by 4 to get actual beats per minutes (bpm).  

Step 3: Microcontroller and Display Circuit

The PIC16F628A runs at 4.0 MHz using an external crystal. The two tact switches are used for Start and Clear functions. You should rest your fingertip on the sensor assembly before pressing the Start button. You can use fore finger or middle finger for this. Once the Start button is pressed, the microcontroller turns on the BC547 transistor (in the signal conditioning circuit). This turns the IR LED on, and the LED starts blinking with the fluctuation in the blood volume inside finger arteries. After 15 seconds, the measurement is completed and the result is displayed on a 3-digit seven segment LED display.

Step 4: Device in Action

This video shows the heart rate measuring device in action.

The firmware for PIC16F628A was developed in C and compiled with mikroC Pro for PIC compiler from mikroElektronika.
You can find the source code and HEX files attached here with or can also view the program on my blog site.



  • Epilog Challenge 9

    Epilog Challenge 9
  • Paper Contest 2018

    Paper Contest 2018
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.




working absolutely fine


Hi,could i have the detail of the project i also have the same project but i have problem with?
please send me the code and list of the component of the project

Can u please sendme the details about this project to my mail ..... i am doing this as my main project so please help me..my mail is moheb2212@gmail.com

and i want to ask... can i take a sensor from pulse oximeter that generate an analog signal and use it on this code and circuit ? !

can you send me a list of the parts that you have used please. Thank you.

Sir can you kindly send me the necessary codes ,simulation files and PCB layout file. My email address is asif.chowdhury9663@gmail.com

If you receive this info could you forward it to me as well? nlittell@iupui.edu

Can I ask for the program code? Please.

Please send it here: annrosejessica@gmail.com.

Thank you in advance.

hello, do you have the details of this project? can you please send me?

mail id mitraniloy@gmail.com

thanks in advance

hey dude!!! can u send me the details about components!! urgent!!


Sorry for replying so late .... everything along with source code is given in thr instructable but still if u find any difficuly feel free to contact