Tutoriel : Utilisation capteur de pulsation cardiaque KY-039 avec Arduino (English)
The KY-039 heartbeat sensor module can be used to detect the heartbeat signal using finger. This sensor has an analog output. By placing your finger on the module, you can see the heartbeat signal through the analog output pin.
KY-039 Heartbeat Sensor Module Pinout
This module has 3 pins:
S: Analog output signal
VCC: Module power supply – 5V
GND: Ground
Hardware Components
Arduino UNO R3
×
1
KY-039 Heartbeat Sensor Module
×
1
Male to Female jumper wire
×
1
Software Apps
Arduino IDE
Interfacing KY-039 Heartbeat Sensor Module with Arduino
Step 1: Circuit
The following circuit shows how you should connect Arduino to this module. Connect wires accordingly.
Step 2: Code
Upload the following code to Arduino. After that open the Serial Plotter.
voidsetup(){pinMode(A0,INPUT);Serial.begin(9600);}voidloop(){
float pulse;int sum =0;for(int i =0; i <20; i++)
sum +=analogRead(A0);
pulse = sum /20.00;Serial.println(pulse);delay(100);}
In this code, pin A0 of Arduino is used to receive the analog output data. In order to reduce the effect of noise on output, the average of last 20 output data is used. By placing your finger on the module, you can see how it works.
Avis
Il n’y a pas encore d’avis.