Showing posts with label Heart Rate Monitor Sensor. Show all posts
Showing posts with label Heart Rate Monitor Sensor. Show all posts

Heart Beat Monitor using PIC Microcontroller

 Construction of Heart Beat Monitor using PIC Microcontroller:

The measurement Heart Rate is very important parameter of the human body which is related to cardiovascular system. As we know that the heart rate of a healthy young person is around 72 beats per minute (BPM). Some person like Athletes may have lower heart rates. The babies have higher heart rate around 120 bpm. The children may have heart rates around 90 bpm. Another fact is that heart rate rises gradually during exercises and returns slowly to the rest value after exercise. However, the monitoring is BPM is important to know if the heart is working perfectly in normal circumstances.  Here we will design of a very low cost device which will measure the heart rate of the person by clipping sensors on one of the fingers and then displaying the result on a LCD. This project is based on microcontroller. The microcontroller is programmed in such a way that the heart rate meter will display various measurement results and their interpretation that the value is normal or not. The project can be programmed to display the average, maximum and minimum rates over a period of time and so on. 

 The project we are constructing in this post will be consisting three main components like the sensor, processing unit, and display. The Sensor of this project is consisting of an infrared transmitter LED and an infrared sensor photo-transistor. The sensor for detection of proper heart beat of a human is actually in the form of a pair of two semi-conductor parts, transmitter & receiver. This sensor is mounted into a casing which can be clipped on one of the fingers of the patient or whose BPM are required to measure. The LED in the sensor described above will emit infrared light which will be passed into the attached finger of the patient. The photo-transistor of this sensor will detect the IR beam. The changes in the intensity of light will be the function of changes in the volume of blood in the finger. Thus, it will actually measure the change of blood volume in the finger. The signal generated at the photo transistor end will be in the form of pulses but in the order of mv means very low level. It requires proper amplification. The signal from optical sensor attached to the finger of patient is then amplified and process accordingly. The analog signal is then fed to PIC microcontroller for counting of pulses, analysis and display. The microcontroller used in this project is a very low cost simple PIC microcontroller which is very easily available at local electronics parts market everywhere. The number of the microcontroller is PIC 16F84. The MCU counts the number of pulses for one minute.  The Pulses per minute are actually the Beats per minute or the heart rate of that person. Three readings are taken consisting of each for one minute then the results are averaged out and final averaged BPM are displayed.  The calculated averaged heart rate is displayed on an LCD in beats per minute.

Circuit diagram of Heart Beat Monitor using PIC 16F84

Circuit diagram of Heart Beat Monitor using PIC 16F84
Circuit diagram of Heart Beat Monitor using PIC 16F84


The analog signal processing unit is an electronics circuit which is consisting of two operational amplifiers and a low-pass filter. The use of OP-AMP here is this circuit is required to amplify the weak signal from photo transistor to a level which is acceptable for microcontroller. As we know that the PIC microcontroller 16F84 will work on DC 5V power supply therefore, this MCU will operate its input/ output pins or ports at TTL level. Thus OP-AMP section of this project is designed so that the pulse shall obey the TTL rules for proper counting at microcontroller stage. Now again back to the operational amplifier circuit designing, here we will like to tell that the first operational amplifier is used to amplify the signal with a gain of about 100. The second operational amplifier will further amplify the signal and give it proper shape with the gain around 560. While performing the testing of this circuitry at designing stage it was realized that a low pass filter shall be included in the operational amplifier stage circuit to filter out all unwanted high frequency noises coming from nearby equipment or instruments etc. The cut off frequency of this filter was selected as about 2Hz. A red color LED is also connected at the output stage of the operational amplifiers which flashes as the pulses are generated or passed from this circuitry to the microcontroller section. The output of the operational amplifier & low pass filter circuit is fed to one of the digital inputs of a PIC16F84 microcontroller. The microcontroller is operated from a 4MHz crystal. The microcontroller output ports drive the LCD. When the Heart Beat Monitor is powered ON by applying the power supply to it. The Welcome message is display on LCD after that instruction to operate appears on LCD. 

Sequence of operation of Heart Beat Monitor using PIC 16F84 Microcontroller

Display of HBM PIC MICROCONTROLLER
Various Display Screen during Measurement


Press start button to get the reading. Here the user has to press the start button. Immediately after that the microcontroller will start counting the pulse for obtaining the reading # 1 and at that time LCD display will show calculating 1. Here one important thing shall be noted that the sensor shall be applied to patient before the pressing of start button. After completing the first measurement time, the unit will continue counting for second measurement and display on LCD will be changed from Calculating 1 to calculating 2. After the completion of required time period for this measurement, the display will be changed to calculating 3. When the heart rate monitor unit have successfully measured the three reading, then it will perform averaging and the averaged results will be display on the LCD. If it in normal range, message will display “NORNAL”. If the averaged value is at lower side, or higher side the message will be display accordingly. The reset button is required to press for re-using it again.

 

Optical sensor for detection of heart Beat
Optical Sensor used in Project of Heart Beat Monitor

Some important facts about the sensor are: These sensor clips consist of only a pair of IR photo transistor and receiver LEDs enclosed in a specially designed plastic clip housing and cable with stereo jack plug. The probe clip alone does not have any other circuit. To use the probe, you must have some suitable application circuit or compatible pulse rate monitor. For the best results the application environment should be away from direct sunlight or high intensity lights and the person under observation should stop any body movements / exercises.

This project can further be improved in coming post covering it in the field like use of a graphical LCD. Sound effects can be included to the meter like a sound is produced each time a pulse is received at microcontroller. Similarly, the maximum & minimum values of heart rates during the measurement can be displayed. For the sake of data logging onto personnel computer or laptop, the Serial communication can be added to this project.

The Warning or abnormalities in the case of very high or very low heart rates are displayed on the LCD with the indication by an LED and a buzzer.

 The software is developed using the popular PROTON+ Basic compiler. The compiler is developed and distributed by Crownhill Associates. The software is described below.

 '****************************************************************

'* In this project a PIC16F84A microcontroller is 
'* used and an infrared sensor is connected to pin
'* RB0. Also, a button is connected to pin RB1 of
'* the microcontroller.
'* The average heart rate is measured and
'* displayed on a LCD
'*****************************************************
Device = 16F84A ' selection of device = Microcontroller

Xtal = 4 ' the crystal frequency

Symbol SVIC = PORTB.1 ' decaration of input/ output PIN of MCU
Symbol PIN  = PORTA.1
Symbol BLK  = PORTA.0
' decaration of local variables
Dim Cnt As Byte
Dim Heart As Word
Dim J As Byte
Dim B As Byte
TRISB = %00000011

Cls' clear the display
DelayMS 1000 ' wait for one minute
' prints the welcome message
' prints the instruction for start
Print At 1,1, "     READY...   "   
Print At 2,1, "  PRESS  START  "
'
' Wait until BUTTON pressed
'

While SVIC = 1:Wend  ' waiting for button to press

Cls ' clear the screen
Heart = 0 ' initialization of HB parameter

For J = 1 To 3
    Print " CALCULATING ",Dec J
    Cnt = Counter PORTB.0,10000
    Cnt = 6 * Cnt
    Heart = Heart + Cnt
Cls
Next J

Heart = Heart / 3 ' averaging
Cls
' Warning section
If Heart<=40 Then 
GoTo WARN1
ElseIf Heart>=100 Then 
GoTo WARN2   
Else
    Print At 1,1, "NORMAL HEARTRATE"
    Print At 2,1, "Heart = ",Dec Heart," /min"
    Sound PIN, [25, 50]
    DelayMS 250
EndIf
GoTo FIN

WARN1:
    Print At 1,1, " LOW HEART RATE"    
    Print At 2,1, "Heart = ",Dec Heart," /min"
GoTo BEEP

WARN2:
    Print At 1,1, "HIGH HEART RATE"   
    Print At 2,1, "Heart = ",Dec Heart," /min"
GoTo BEEP

BEEP: ' produces sound
For B = 1 To 3
    Sound PIN, [25, 50]
    DelayMS 250
Next B

ABN: ' blinking of LED
    High BLK
    DelayMS 200
    Low  BLK
    DelayMS 200
GoTo ABN

FIN:
    End    ' end of program

 FAQ about Heart Beat Monitor

What does the microcontroller-based heart rate monitor do using fingertip sensors?

The heart rate monitor is a metering device used to measure the heart beats. Its construction involve the use of microcontroller inside it. The device which actual measure or detect the heart pulse is attached to the finger of a person, thus this monitor has a fingertip sensor with it.

Is this device is using the heart rate app free download for android?

Currently this heart rate monitor is constructed so that it will work stand alone. However, in future we have a project in which will be using android for measuring the heart beat and its app will also be developed accordingly.

how does a heart rate monitor work?

The heart rate monitor work with the use of an optical sensor attached on the finger of a person to detect the pulse of heart and the value is displayed on LCD or LED display of the monitor.

Is this similar to the heart rate sensor apple watch?

The function of this heart rate monitor is also to detect and display the heart pulses, but the apple watch for heart rate sensor has some additional feature like to communicate with iPad, iPhone etc.

Is this monitor using Arduino heart rate sensor?

No, our heart rate monitor uses the optical sensor, it does not use the heart rate sensor based on Arduino or other. However, we have used PIC Microcontroller in it for data processing and display purposes. Arduino does similar jobs. As we know that Arduino boards also uses microcontroller but those are made up of Atmel AVR.

Is it the finger clip heart rate monitor?

Yes, it is the finger clip heart rate monitor, whose sensor can be attached to finger of a patient or to the ear of patient.

Is this project like heart rate monitor for android smartphone?

This project we have developed so far uses PIC Microcontroller in it. It does not use the android smartphone. However, we are planning to develop a heart rate monitor using android smart phone in future, on its completion, it will be posted here on this blog.

Does it support the Arduino heart rate sensor code?

No, our heart rate monitor does not support the code written for Arduino. The code written for this heart rate monitor is in basic language and compiled using proton plus compile.

Is it the heart rate monitor with LCD?

Yes, an alpha numeric LCD of 2lines has been attached with this heart beat Monitor.

Where is the heart rate sensor schematic?

The schematic circuit diagram is provided and explained above.

What is the use of potentiometer in heart rate monitor?

The potentiometer in heart rate monitor are used in the analog signal processing area, where the operational amplifier are configured using resistors and capacitors to have desired amplification gain and signal level, so that the signal can be feed to microcontroller for the measurement of heart pulses.

How will we be understanding heart rate monitor readings?

It is very simple the results will be shown on LCD in the form of BPM.

In which language the code for heart rate monitor is written?

The Basic language is used to write the program of heart rate monitor and the proton plus complier is used to convert basic language code to hex file.

how to analyze an electronic heart pulse readout

The normal range is defined in the program code listing, if the readings are not in normal range of heart beat, then appropriate warning  message is display on LCD.

Keyword research: The heart rate monitor circuit diagram is provided above. The heart rate monitor experiment is done and results are very encouraging. This heart rate monitor is without chest strap. This heart beat meter is similar to the analog heart rate monitor sensor (ecg) for Arduino but different in a sense use of different microcontroller. The sensor of this monitor can be applied to the ear also.

Pulse rate Sensor to monitor heart beat rate of human

 Introduction of heart rate monitoring sensor:

To monitor the heart rate or pulse rate of any human body, a dedicated sensor is required. The sensor is basically a device which convert the information of blood flow in vain of body into electrical signal. The signal generated from pulse rate sensor are then process further to interface with microcontroller or microprocessor of Arduino board. Where the digital signal are analyzed and then results are displayed using any convenient means of display like LED display or using LCD display. Therefore we can say that the Pulse Sensor is a especially designed device which is ready for plug and play to measure the heart rate with help of any kind of microcontroller like AVR on Arduino board or Microchip PIC or Atmel 8051 family. This sensor is used by electronics engineering students, professional engineers, software engineers, embedded project developers to easily include the live data of heart rate into projects. There are variety of sensors available for this purpose. The pulse monitoring sensor are usually fixed or attached with help of a clip onto a fingertip or sometimes it can be used on earlobe to get the heart rate data from the body of human.

Principle of construction of Heart Rate Sensors:

The important point of in the discussion regarding the construction of heart arte sensor is that the technique used for the detection of pulse rate is non-invasive type of detection or measurement. These sensors are consisting of optical electrical devices. The majority of the optical heart rate sensor do have f an electronic circuit built-in with them in addition to sensing element to proper shape the electronics signal so that these could be easy interfaced with microcontroller or any digital signal processing device. The operation of the sensors starts with the monitoring of heart beat by clipping these onto a fingertip.

The working principle involved in the working of the Heart beat Sensor is Photo-ple-thysmo-graph. This principle in based to detect the changes in the volume of blood in apart of body like finger. The volume of blood is measured by the variation in the intensity of the light passing or blocked through that organ. The source of light in a heart beat sensor is usually an IR LED and the detector may be of any light intensity Detector like a Photo Diode, a Light Dependent Resistor (LDR) or a Photo Transistor. These two parts work tighter to form an understandable electronics signal.

Parts of pulse sensor:

Parts of a typical pulse rate sensor are basically two;

1.   IR transmitter: The function of IR transmitter is to emit IR which will be used to detect the blood in veins. Basically the media used for the detection of pulse is Infra-Red Radiations.

2.   IR receiver: The function of the IR receiver is to collect the IR passes through the finger. Some of the IR will be blocked when blood passes through the veins. The difference in the intensity will be actually the determination of pulse.

Types of pulse sensor:

There are two techniques which are used for the detection of heart beat;

1.     Reflection Based Detection of Heart Beat:

In this method the light or IR radiation is emitted from IR transmitter and received by IR receiver or photo diode or photo transistor. The light source (IR Transmitter) and the detector (Photo Transistor) are place at same side of a finger or organ (adjacent to each other). The finger of the person is placed in front of the transmitter and receiver. The light is reflected through the finger and a portion of it is blocked and rest of the light passed when blood sticks in veins. The light is shining on the finger and the part reflected back to photo transistor is measured. The quantity of light varies with the amount of blood in veins of finger. As the quantity of blood changes significantly in corresponding the heart function continuously. As a result the pulses are formed through the photo diode or photo transistor end.

Heart beat, Pulse rate Sensor Construction
 Reflection Based Detection of Heart Beat


2.     Transmission Based Detection of Heart Beat:

In this method the light or IR radiation is emitted from IR transmitter and received by IR receiver or photo diode or photo transistor. The light source (IR Transmitter) and the detector (Photo Transistor) are place facing each other and the finger of the person is placed in between the transmitter and receiver. The light is passed through the finger and a portion of it is block when blood sticks in veins. The light is shined and passes through the finger which is directly relates to the quantity of blood in vein at that time. As we know that the quantity of blood always changes, as a result we get pulse at the light collection device which is in our case the photo-transistor or photo-diode. This is a continuous process of up and down as a function of blood pumped into the finger.

Pulse rate Monitor, Heart Beat Pulse rate sensor
Transmission Based Detection of Heart Beat


Working of Heart beat Sensor with an electronics circuit # 1:

So far we have discussed the theory of working of a pulse sensor. Now we should move to its particle used. In fact the pair of light emitting device and light sensing device are not all the components to get the desired output. We attach some of analog electronics components to make them working. Here we will discuss the construction a simple circuit in which we could be able to detect a pulse using above discussion about the sensor. Therefore we can say that a typical Heart beat Sensor will be consisting of detection based devices along with electronics circuit. The detection part of the Heart beat Sensor will have an IR LED and a Photo Diode/ transistor placed in a clip. The electronics circuit will be consisting of an Op-Amp along with a few other analog electronics components like resistor & capacitors. This electronics circuit will help us to connect the detection part of sensor to signal processing unit like a Microcontroller. The working of the Heart Beat sensor is easily and becomes more interesting when we do a detailed study of the circuit diagram.

Circuit diagram heart beat sensor, detection pulses
Obtaining Electrical Signal from Heart Beat Sensor


The circuit diagram shown in above figure is based on assumption that the clip sensor part or detection part is attached with the finger. When the heart beat sensor have finger in place between the detectors the pulses are started to detect. As we have already discussed that with every heart beat the amount of blood in the finger will change from minimum to maximum level in the vein. The light emitted from the IR LED on passing through the finger get interactions with the blood quantity. The amount of light managed to pass through the obstacle of blood will be thus detected by the Photo Diode. The amount of light will be the function of amount of blood in vein as a result a changing electrical signal will be available at the photo diode terminal which is then processed through the use of OP-AMP. Here we will use LM358 OP-AMP which is consisting of two op-amp inside a single ship. The output of the photo diode is feed to the non–inverting input of the first op–amp through a capacitor. The use of capacitor at this stage is to block the DC Components of the signal coming from the detection unit. The amplification factor of at this stage is kept around 1001. It is sufficient to amplify the week signal to a level which is desirable. The output of first non-inverting amplifier is feed to second op-amplifier which is built in a comparator mode. The output of second op-amplifier (Comparator0 is used to feed to a transistor to have train of pulses as shown in the circuit diagram above. It may be noted that the construction of this circuit is very simple and efforts are made to use the general purpose components which are easily available in local electronics market or on a radio shop. For example the use of op-amp LM358, the transistor could be any NPN like c828 or BC 547.

Working of Heart beat Sensor with an electronics circuit # 2: 

The above circuit has been built in order to have response from optical sensor used to monitor the heart rate pulses as discussed earlier. The only difference is that it is very simple circuit as compared to previous one but it has very good results too.  

Optical sensor for heart rate Monitor
Interface of optical heart rate sensor


In this circuit we are using the IR transmitter coupled with the photo transistor. Again it is the assumption that the finger is placed in between the optical transmitter and optical receiver so that the light have obstacle with blood. For the optical sensor assembly (U2), we used a reflective optical sensor. This sensor has transistor output. Coming to the Op-Amp again we can use the LM358 or Lm 741 as per our convenient choice. But I think for the sake of experiments the results of LM358 are good enough. It is to be noted that the light of the LED is at the peak emitter wavelength 950 nm. The Designers or engineers normally use a range between 700 nm (Red light) to 1000 nm (infrared light) for biological instruments. The light beam have to cross the narrow parts of the body like a fingertip or an earlobe or the lower lip therefore use of this range of light is safe and workable.

Popular Post (All Time)