Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Monitoring heart rate is a common application in health and fitness devices. With Arduino, you can create a simple and effective heart rate monitor using a pulse sensor. This article will guide you through the process of setting up and programming an Arduino to read and display heart rate data.
Examples:
Connect the Pulse Sensor:
Optional Resistor:
#include <PulseSensorPlayground.h>
// Variables
const int PulseWire = A0; // Pulse Sensor connected to analog pin A0
const int LED13 = 13; // The on-board Arduino LED
int Threshold = 550; // Adjust this threshold value to suit your needs
// Create an instance of the PulseSensorPlayground object
PulseSensorPlayground pulseSensor;
void setup() {
pinMode(LED13, OUTPUT); // Set the LED pin as an output
Serial.begin(9600); // Initialize the Serial Monitor at 9600 baud
// Configure the PulseSensor
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13); // Blink on each heartbeat
pulseSensor.setThreshold(Threshold);
// Start the PulseSensor
if (pulseSensor.begin()) {
Serial.println("Pulse Sensor started successfully!");
}
}
void loop() {
int myBPM = pulseSensor.getBeatsPerMinute(); // Get the BPM value
if (pulseSensor.sawStartOfBeat()) { // If a beat is detected
Serial.print("BPM: ");
Serial.println(myBPM); // Print the BPM value to the Serial Monitor
}
delay(20); // Delay for a short period to avoid overwhelming the sensor
}
Threshold
value in the code. A higher threshold value may be needed if the sensor is too sensitive, and a lower value if it is not sensitive enough.By following these steps, you can successfully create a heart rate monitor using Arduino and a pulse sensor. This project can be expanded by adding an LCD display to show the BPM directly on the device or by integrating it with other health monitoring systems.
This project demonstrates a practical application of Arduino in the health and fitness domain, showing how to monitor heart rate effectively. If you encounter any issues or need further customization, refer to the Pulse Sensor documentation and Arduino resources for additional support.