Heart Beat Sensor Reference
An optical (photoplethysmography-style) pulse sensor that outputs an analog signal proportional to blood flow, used to detect heartbeats.
Pin names
| Name | Description |
|---|---|
| GND | Ground |
| VCC | Power (5V) |
| OUT | Signal — analog output, pulses with each heartbeat |
Attributes
This component has no configurable attributes.
Usage
Connect VCC to 5V, GND to GND, and OUT to an analog input pin. Detect beats by watching for peaks that cross a threshold above the signal's rolling baseline.
const int PULSE_PIN = A0;
int threshold = 550;
bool beatDetected = false;
void setup() {
Serial.begin(9600);
}
void loop() {
int signal = analogRead(PULSE_PIN);
if (signal > threshold && !beatDetected) {
beatDetected = true;
Serial.println("Beat!");
} else if (signal < threshold) {
beatDetected = false;
}
delay(10);
}
Real-world pulse detection typically needs signal filtering and per-user threshold calibration — this example shows the basic read pattern only.
Examples
| Description | Attrs |
|---|---|
| Default pulse sensor | {} |
See also
- Sound Sensor (Small) — same simple analog-threshold reading pattern
- MPU-6050 IMU — another common biometric/motion sensing module