top of page

The pulsesensor

 Heat rate is the number of times the heart beats in a minute and is produced via depolarization at the sinoatrial and atrioventricular nodes in the heart. The most common areas to locate pulse is the wrist, neck , inside the elbow, behind the knee and ankle joint.

 

 Normal heart rate differs depending on the age and health condition of a person. For the average adult, this is of around 70 beats per minute (BPM) for males and 75 beats per minute for females. A person may be considered to be in the “normal” heart beat range if it between 60 and 100 BPM. A lower value is considered bradycardia, while a higher value tachycardia[1, 2].


 Heart rate can be measured manually, by using the radial method -the pulse is taken on the wrist - or the carotid method -taking it on the throat. However heart monitoring devices are more accurate than manual methods, as they give continuous readings. Some devices that display heartbeat readings digitally include pulse oximetry, electrocardiography (ECG) and blood pressure monitors. Out of these the ECG is the one that detects the heart beat signals and shows it graphically. However, there are many sensors and cables connections, fluctuations in the signal and noise, not to mention that it may be uncomfortable for continuous motorization. That is why a simple photoplethysmograph (PPG) is better suited.
 

This project uses the SHAHIDEER pulse rate sensor.

​

SHAHIDEER is a pulse rate sensor module for ARDUINO, which can be easily clipped to a finger or earlope.

 

Pulse rate sensors work on the principle of photoplhethysmography. They measure the volume of blood through any organ of the body, producing change in the light intensity through that organ.

 

The sensor consists of two main parts: 

  • Light emitting diode (LED)

  • Light detecting resistor or a photodiode. In SHAHIDDER it is the square located  at the front of the sensor

 

​

​

​

​

​

​

This sensor works in reflection mode, as both the LED and detector are on the same side of the skin. It then functions like this:

  • The side with the heart logo is placed in contact with the skin (earlobe or finger)

  • Tissue is illuminated by the LED 

  • Some of the light is absorbed by the blood, depending on the blood volume present, and another part is reflected back

  • The ambient light detector receives the light that bounces back and gives output proportional to heart rate

  • The output of the detector is fed to ARDUINO UNO

​

    Next the steps carried out to detect the pulse rate are outlined.

​

1. Preparing the pulse rate sensor

​

 In order to insulate the  pulse sensor board, first a thin film of vinyl has been used to seal the sensor side. The back side, which has more exposed contacts, is protected with a Velcro dot. Finally the sensor is encircled in a Velcro  tape, so that it can easily fit into the finger.

​

​

​

​

​

​

​

2. Connecting the pulse sensor with Arduino UNO

​

The connection to ARDUINO UNO is done the following way:

  • Ground pin GND is connected to GND of ARDUINO

  • VCC pin connected to Arduino’s 5V

  • A0 analog pin connected to Arduino’s A0

The output of the sensor is then processed using ARDUINO IDE to correctly determine the heart rate.

​

​

​

​

​

​

​

​

​

​

3. Pulse rate detection using Arduino IDE

​

  A pulse signal  contains  multiple peaks, the predominant one being the QRS - the highest peak being R.

​

​

​

​

​

​

​

​

 

The basic way of calculating the heart rate is to divide 60 s with the mean interval between consecutive RR peaks.  If a person’s heart rate is lower, the interval will be longer. For a healthy person, the RR interval is usually of 6 seconds.

​

​

​

 

For that reason it is necessary to determine the Q peaks and, for that, a threshold is defined, which the signal needs to surprass, in order to consider it a R peak.   

​

To calculate the interval we need to calculate two consecutive peaks. In this case 10 consecutive beats are calculated and their intervals averaged, to get the heart rate. Knowing a specific set of heart beats have occurred in time “runningTotal”, we can use the rule-of-3 to calculate how many have occurred in 60 seconds.

​

The code for heart rate detection in Arduino IDE is a slightly modified version of the one done by

http://www.circuitstoday.com/pulse-sensor-arduino

 

In the interrupt function, a timer has been set. The aim of this is to obtain a sample rate of 500 Hz and a beat to beat resolution of 2 mS.

​

​

​

​

​

​

 

 Every 2 ms the pulse sensor readings are obtained (with analogRead) and will increase the sample counter by two values, whose aim is to monitor the time.  Thanks to variable N the noise produced can be avoided.

​

​

​

​

 The next two loops calculate the maximum and minimum values received by the sensor, so that the height of the peaks can be estimated. The “thresh” defines a threshold, which the peak will need to surprass in order to consider it a R peak.  

​

​

​

​

​

​

​

​

If the output received is above the set threshold value and a 3/5  of the last interval between two beats has passed, a heart beat will be detected, updating “lastbeattime”.  after calculating how much time has passed since the previous beat.

​

​

​

​

​

 

 The beats-per-minute (BPM) are calculated by taking into account the average of the last 10 time between beats. In the array “beat” the time where the beat is received is saved and at the same time the times are summed to “runningTotal”. Finally the time is averaged and it is calculated how many beats have occurred in 60 seconds.

​

​

​

​

​

​

​

​

​

​

When the pulse rate value is lower than the threshold, the pulse will be over and the threshold variable is updated.

​

​

​

​

​

 

 

If no beat is found after 2.5 mS, the values to estimate the pulse rate are initialized.

​

​

​

​

​

​

 

 

Finally, the heart rate is printed on the serial port, so that later on it can be read and transmitted to ThingSpeak.

See full code Arduino_PulseRateSensor_Accelerometer_Try.ino on Github

​

--------------------------------------------------------------------------------------------

 

[1]Ilyani Ramli, N., Youseffi, M. and Widdop, P. (2011). Design and Fabrication of a Low Cost Heart Monitor using Reflectance Photoplethysmogram. [online] Waset.org. Available at: https://waset.org/publications/3628/design-and-fabrication-of-a-low-cost-heart-monitor-using-reflectance-photoplethysmogram [Accessed 3 Nov. 2018].

[2]Harun, H., Khaidir, N., Said, Z. and Mohamad, S. (2018). Heart rate conditioning based on beats per minute and accelerometer. [online] Ajol.info. Available at: https://www.ajol.info/index.php/jfas/article/view/171730/161132 [Accessed 3 Nov. 2018].

​

​

oursensor.JPG
lightdetector.jpg
im4.JPG
im1.png
im2.png
im6.png
im7.JPG
im8.png
im9.png
im10.png
im11.png
im12.png
im13.png
im14.png
bottom of page