Projects Hub, lesson 28 of 81

Heart Rate-Based Fitness Tracker with LCD Feedback

intermediate2 min read

Introduction

In today's health-conscious world, monitoring our fitness levels has become essential. Heart rate-based fitness trackers have gained immense popularity for their ability to provide real-time data on our heart rate during workouts and daily activities. In this article, we will explore how to create a heart rate-based fitness tracker with an LCD feedback system using Arduino. This DIY project will not only help you understand the basics of bioelectronics but also allow you to build a personalized fitness tool tailored to your needs.

Working Principle

The heart rate-based fitness tracker we're going to build relies on a simple principle: the heart rate sensor, which measures the user's pulse, processes the data, and displays it on an LCD screen. Here's how it works:

Things We Need

  1. Arduino Uno or compatible board
  2. Heart rate sensor (e.g., Pulse Sensor)
  3. 16x2 LCD screen
  4. Breadboard and jumper wires
  5. 220-ohm resistor
  6. Power source (USB or battery)
  7. Arduino IDE installed on your computer

Circuit Diagram

Circuit Diagram

Working of the System with Arduino

  1. Heart Rate Sensor Connection: Connect the heart rate sensor to the Arduino. Typically, this involves connecting the sensor's output to an analog input pin on the Arduino.
  2. LCD Connection: Wire up the 16x2 LCD screen to the Arduino. Connect the LCD's VCC and GND pins to the 5V and GND pins on the Arduino, respectively. Connect the SDA and SCL pins to the corresponding pins on the Arduino for I2C communication. Also, connect the LCD's backlight, contrast, and RS, RW, and EN pins as per your LCD module's specifications.
  3. Code: Write an Arduino program to read the heart rate data from the sensor and display it on the LCD. Here's a simplified code snippet:

Arduino Code

Loading the circuit…Arduino Uno
Press Run to upload the code to the Arduino.
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
 
LiquidCrystal_I2C lcd(0x27, 16, 2);  // Set the LCD address and dimensions
 
int sensorPin = A0;  // Analog input for heart rate sensor
int heartRate = 0;   // Store heart rate value
 
void setup() {
  lcd.init();                      // Initialize the LCD
  lcd.backlight();                 // Turn on the backlight
  lcd.setCursor(0, 0);
  lcd.print("Heart Rate:");
  pinMode(sensorPin, INPUT);       // Set sensorPin as an input
  Serial.begin(9600);              // Start serial communication
}
 
void loop() {
  heartRate = analogRead(sensorPin); // Read the heart rate sensor
  lcd.setCursor(0, 1);
  lcd.print("     ");              // Clear the line
  lcd.setCursor(0, 1);
  lcd.print(heartRate);            // Display heart rate on LCD
  delay(1000);                     // Update every second
}

Conclusion

By following this project, you've learned how to create a heart rate-based fitness tracker using readily available components and Arduino. The heart rate data is read from the sensor, processed, and displayed on the LCD screen. This DIY fitness tracker is a great way to monitor your heart rate during exercise, helping you optimize your workouts and improve your overall fitness. Feel free to enhance and customize the project by adding features like data logging or Bluetooth connectivity to sync the data with your smartphone. Keep exploring and building more exciting electronics projects!