Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Monitor Heart Rate Using Arduino

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:

Components Needed:

  1. Arduino Board (e.g., Arduino Uno)
  2. Pulse Sensor (e.g., Pulse Sensor Amped)
  3. Breadboard and Jumper Wires
  4. Resistor (e.g., 10k Ohm)
  5. USB Cable for Arduino
  6. Computer with Arduino IDE installed

Step-by-Step Instructions:

Step 1: Connect the Pulse Sensor to the Arduino

  1. Connect the Pulse Sensor:

    • Connect the VCC pin of the pulse sensor to the 5V pin on the Arduino.
    • Connect the GND pin of the pulse sensor to the GND pin on the Arduino.
    • Connect the Signal (S) pin of the pulse sensor to the A0 analog input pin on the Arduino.
  2. Optional Resistor:

    • Place a 10k Ohm resistor between the Signal pin and the ground to stabilize the signal.

Step 2: Install the Pulse Sensor Library

  1. Open the Arduino IDE.
  2. Go to Sketch > Include Library > Manage Libraries.
  3. Search for "PulseSensor Playground" and install it.

Step 3: Write the Arduino Code

#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
}

Step 4: Upload the Code and Test

  1. Connect your Arduino to the computer using the USB cable.
  2. Upload the code to the Arduino by clicking the Upload button in the Arduino IDE.
  3. Open the Serial Monitor (Tools > Serial Monitor) to view the heart rate data.

Step 5: Adjust the Threshold

  • If the sensor is not detecting the heartbeats accurately, adjust the 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.

Conclusion

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.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.