Phipps Electronics

Order within the next 

FREE SHIPPING OVER $199

50,000+ ORDERS

WORLDWIDE SHIPPING

SSL SECURED

Using the Heart Beat Sensor KY-039 with Arduino

Contents

INTRODUCTION:

In this tutorial, we will learn about the KY-039 module, how it works and we will build a simple project using the KY-039 module and an Arduino.

 

HEARTBEAT SENSOR KY-039:

The KY-039 Module will be our main component for this tutorial. This module has an infrared (IR) LED, and an IR receiver mounted on a breakout board with resistors. Figure 1 shows the module as seen in fritzing.

Figure 1: KY-039 Heart Beat Sensor

 

PIN OUT:

The KY-039 module has three pins.

PinDescription
(-)GND
Middle Pin+5V
SSignal

 

HOW DOES IT WORK?

Our blood vessels in the fingers contracts and expands on every heartbeat. By placing our finger between the infrared (IR) LED and IR receiver, our blood vessel affects how much IR light is received by the receiver. Based on this, the module’s output is an analog signal from 0~1023. A higher value means less light is being “blocked” through our finger and vice-versa.

 

PROJECT – ARDUINO HEARTBEAT GRAPH:

After learning about the KY-039 module and how it works, it is now time to build a project using the module. Our project will get the analog values from the KY-039 module and display it on the serial monitor.

 

PROJECT COMPONENTS:

For this project, we need the following components:

  • Arduino Uno board (1 pc.)
  • KY-039 Heart Beat Sensor (1 pc.)
  • Jumper wires

 

WIRING DIAGRAM:

Figure 2 shows the connection between the Arduino Uno and the KY-039 Heart Beat Sensor.

Figure 2: Connection Diagram

 

The KY-039 module pins are connected to the Arduino Uno board as follows:

Component PinUNO Board Pin
(-)GND
Middle Pin+5V
SA0

 

CODE:

Below is the Arduino sketch for our project. I have added comments to explain important parts of the code. Save the code as KY-039.ino and upload it to your Arduino board.

// Arduino and KY-039 module

void setup ()
{
Serial.begin(9600); // initialize serial
}

void loop ()
{
// display analog values to serial
Serial.println(analogRead(A0));
}

 

PROJECT TEST:

Apply power to your Arduino Uno board and open the Serial Plotter in the Arduino IDE. Arduino will display the analog value received from the heartbeat module as a graph. If you want to see the analog output as a stream of numbers, open the Serial Monitor instead.

SUBSCRIBE FOR NEW POST ALERTS

Subscribe to be the first to know when we publish a new article!
List Subscriptions(Required)

POPULAR POSTS

Scroll to Top