Interface Heartbeat Sensor with Arduino
ARDUINO

Heartbeat Sensor


Description

The KY-039 Heartbeat Sensor Module is designed to detect the heart rate of an individual through a person's fingertip by measuring changes in infrared light. This sensor provides an analog output, which allows you to view the heartbeat signal by placing your finger on the module.


Sensor Details

These sensor modules are capable of detecting an individual's heart rate. They do this by emitting infrared (IR) light through an LED on one side of the fingertip and detecting minor changes in the received IR using a phototransistor. The fluctuations in the transmitted IR, caused by the blood being pumped through the finger, are analyzed by a program that runs on the microcontroller. The program filters out electrical noise, reads the data, and provides the heart rate measurement.

 

  • KY-039 is a low-cost heartbeat sensing module that uses infrared (IR) LED and a photo-transistor to detect the pulse of a finger. With each pulse, a red LED flashes.
  • The pulse monitor functions as follows: an LED is illuminated on one side of the finger, while a photo-transistor is located on the other side of the finger.
  • The photo-transistor captures the emitted flux when blood flows through the finger, causing a slight variation in its resistance.
  • When working with photo-transistors, it is crucial to maintain a shield of stray light. This is especially important for home lighting as the lights in homes usually operate at 50hz or 60hz, which can cause significant noise interference, even from a faint heartbeat.
  • Dimensions: 32 x 24 x 12mm
  • Weight: 3.06g
  • Material: FR4

 

 


Wiring Details
  • Sensor GND to Arduino GND
  • Sensor Signal to Arduino PIN A0
  • Sensor Vcc+ to Arduino +5V

Circuit Image
Circuit Code
                                        
                                            
int sensorPin = A0;  // Arbitrary analog pin to connect sensor output to
int period = 100; // Delay in milliseconds between readings 

//  Initialization

void setup ()
{
Serial.begin (9600); // the baud rate of the serial data
}
//===============================================================================
//  Main
//===============================================================================
void loop ()
{
static double oldValue = 0; // used for averaging.
int rawValue = analogRead (sensorPin); // Value read from the analog pin.Will be between 0-1024
Serial.println (rawValue); 
delay (period);            
}