Introduction
In this experiment, we will use a heartbeat sensor to monitor pulse rate. This device measures heart rate in beats per minute (BPM) and is often used in fitness and medical devices.
Components Needed
- Heartbeat Sensor Module
- Arduino (e.g., Uno, Nano)
- Jumper wires
- Breadboard
Circuit Setup
- Connect the VCC pin of the heartbeat sensor to the 5V pin of the Arduino.
- Connect the GND pin of the sensor to the GND pin of the Arduino.
- Connect the Signal (S) pin of the sensor to pin A0 on the Arduino.
Ensure all connections are secure and double-check the wiring.
Code for Heartbeat Sensor
Upload the following code to your Arduino to measure and display the heartbeat data in the Serial Monitor:
const int sensorPin = A0; // Pin connected to the heartbeat sensor
void setup() {
Serial.begin(9600); // Start serial communication
}
void loop() {
int sensorValue = analogRead(sensorPin); // Read sensor value
Serial.println(sensorValue); // Display the value in the Serial Monitor
delay(100); // Delay for stability
}
Explanation
The sensor detects changes in light reflection caused by blood flow. The analog values from the sensor are displayed in the Serial Monitor. These values can be further processed to calculate BPM.
Troubleshooting
- If no data appears in the Serial Monitor, check the wiring and ensure the correct COM port is selected.
- If the values are unstable, make sure the sensor is properly positioned and avoid excess motion.