3V - 5V
3V - 5V
10mA
Analog signal (0V - VCC)
Up to 100 Hz
30 bpm - 180 bpm
70% - 100%
### Physical Characteristics
24mm x 14mm x 5mm
Optical sensor
The sensor has a built-in finger clip for easy placement
Approximately 10 grams
### Performance
2 bpm for heart rate measurement, 2% for oxygen saturation measurement
1 second
Low noise interference due to internal filtering
### Interface and Connectivity
Analog signal output through a three-pin interface (VCC, GND, OUT)
Compatible with microcontrollers, such as Arduino and Raspberry Pi
### Operating Environment
10C - 40C
20% - 80% RH
Operating in normal indoor lighting conditions
Applications
| The KY-039 Finger Heartbeat Detection Sensor is suitable for various applications, including |
Health monitoring systems
Wearable devices, such as smartwatches and fitness trackers
Medical equipment, such as pulse oximeters
Sports and fitness tracking
Research and development projects
Note
Please ensure proper calibration and testing of the KY-039 sensor in your specific application to achieve optimal results. Additionally, consult relevant medical professionals and adhere to applicable regulations when using this sensor for medical purposes.
KY-039 Finger Heartbeat Detection Sensor DocumentationOverviewThe KY-039 Finger Heartbeat Detection Sensor is a compact and easy-to-use sensor module designed to detect human heartbeats through subtle changes in light absorbance caused by blood flow. It is typically used in health-related IoT projects, such as fitness trackers, health monitors, and wearables.Pinouts and ConnectionsThe KY-039 sensor module has four pins:VCC: Power supply pin (typically 5V)
GND: Ground pin
OUT: Analog output pin
LED: LED indicator pin (optional)Connecting the SensorTo use the KY-039 sensor, connect the VCC pin to a power source (5V), the GND pin to a ground connection, and the OUT pin to an analog input pin on a microcontroller or development board.Code Examples### Example 1: Basic Heartbeat Detection using ArduinoIn this example, we'll use an Arduino Uno board to read the analog output from the KY-039 sensor and display the heartbeat count on the serial monitor.
```c++
const int sensorPin = A0; // KY-039 OUT pin connected to Arduino A0
int heartbeatCount = 0;
int signal = 0;void setup() {
Serial.begin(9600);
}void loop() {
signal = analogRead(sensorPin);
if (signal > 512) { // adjust threshold value as needed
heartbeatCount++;
Serial.print("Heartbeat detected! (");
Serial.print(heartbeatCount);
Serial.println(")");
}
delay(10);
}
```
### Example 2: Real-time Heart Rate Monitoring using Raspberry Pi and PythonIn this example, we'll use a Raspberry Pi single-board computer to read the analog output from the KY-039 sensor and display the real-time heart rate on a GUI using Python and the Tkinter library.
```python
import tkinter as tk
import numpy as np
import time# Set up GPIO and ADC
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.IN) # KY-039 OUT pin connected to Raspberry Pi GPIO 17# Create a Tkinter GUI window
root = tk.Tk()
root.title("Heart Rate Monitor")# Function to read sensor data and update the GUI
def update_gui():
signal = np.mean([GPIO.input(17) for _ in range(100)]) # read sensor data
heart_rate = signal 60 # calculate heart rate (bpm)
label.config(text=f"Heart Rate: {heart_rate:.2f} bpm")
root.after(1000, update_gui) # update GUI every 1 second# Create a label to display the heart rate
label = tk.Label(root, font=("Helvetica", 24))
label.pack()# Start the GUI event loop
update_gui()
root.mainloop()
```
These examples demonstrate the basic usage of the KY-039 Finger Heartbeat Detection Sensor in different contexts. You can modify and expand upon these examples to suit your specific IoT project requirements.