Skip to Content

Heartbeat Sensor Module KY-039

The KY-039 Heartbeat Sensor Module uses an infrared (IR) LED and a phototransistor to detect changes in blood flow through a fingertip. By measuring variations in the amount of IR light absorbed and reflected by blood vessels, it can monitor pulse and visualize the heartbeat. This module is often used in educational and experimental applications.

Package Includes:

  • 1 x KY-039 Heartbeat Sensor Module

8.40 AED 8.40 AED Tax Included
8.40 AED Tax Included

Not Available For Sale

This combination does not exist.

Terms and Conditions
30-day money-back guarantee
Shipping: 2-3 Business Days

 

Specifications:

  • Dimensions: 32 x 24 x 12 mm
  • Weight: 3.06 g
  • Material: FR4
  • Working Voltage: 5V
  • Sensing Method: IR LED + Phototransistor
  • Application: Teaching experiments and basic pulse detection

Pinout of the Module:

Pin Description
(-) GND
Middle Pin +5V
S Analog Signal Output

Working Principle:

The module emits infrared light through the fingertip using the onboard IR LED. A phototransistor on the opposite side detects the amount of light transmitted. Blood pulses through the finger with each heartbeat, absorbing more or less IR light and causing a measurable change in the phototransistor's output. This fluctuation can be read by a microcontroller's analog pin.

The circuit should be isolated from ambient light sources, especially 50/60 Hz lighting, to avoid interference. Sensitivity can be adjusted by changing resistor values experimentally.

Connecting to Arduino:

  • S → A0 (Analog input pin)
  • Middle pin (+) → 5V
  • (-) → GND

Code Example:


int sensorPin = 0;
double alpha = 0.75;
int period = 100;
double change = 0.0;
double minval = 0.0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  static double oldValue = 0;
  static double oldchange = 0;
  int rawValue = analogRead(sensorPin);
  double value = alpha * oldValue + (1 - alpha) * rawValue;
  Serial.print(rawValue);
  Serial.print(",");
  Serial.println(value);
  oldValue = value;
  delay(period);
}

How It Works:

  1. Reads analog signal from the KY-039's S pin connected to A0.
  2. Applies a low-pass filter using the alpha smoothing factor to eliminate noise.
  3. Prints both raw and smoothed values to the Serial Monitor for monitoring pulse fluctuations.
  4. Delays for 100ms between each read to allow stabilization.

Applications:

  • Basic pulse rate measurement
  • Educational demonstrations of IR sensing
  • Arduino and microcontroller experimentation
  • DIY heartbeat visualizers

Package Includes:

  • 1 x KY-039 Heartbeat Sensor Module