In this project, we developed an Arduino based heartbeat monitor that uses a sensor that monitors heartbeats when your finger is placed on it to count heartbeats per minute.
This is significant because your heartbeat provides information to doctors about your health.
Heartbeat Monitor Circuit uses components like Arduino UNO, an LCD display, two push buttons, a resistor, and a heartbeat rate sensor module to make a basic heartbeat monitor.
The analog data from the heart is captured by the heart rate sensor module and examined by the Arduino to calculate the heart rate, which is than shown on the LCD display
The display and the heart rate measurement are operated by two push buttons.
Coding with explanation:
#include <LiquidCrystal.h>
// Define pins for components
const int heartRatePin = A0;
const int startButtonPin = 2;
const int stopButtonPin = 3;
const int lcdContrastPin = 4;
// Create LCD object
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// Set pins as input or output
pinMode(heartRatePin, INPUT);
pinMode(startButtonPin, INPUT_PULLUP);
pinMode(stopButtonPin, INPUT_PULLUP);
pinMode(lcdContrastPin, OUTPUT);
// Initialize LCD display
lcd.begin(16, 2);
lcd.setCursor(0, 0);
lcd.print("Heartbeat Monitor");
}
void loop() {
// Read heart rate sensor value
int sensorValue = analogRead(heartRatePin);
// Calculate heart rate (adjust factors as needed)
int heartRate = (sensorValue * 60) / 1023;
// Display heart rate on LCD
lcd.setCursor(0, 1);
lcd.print("HR: ");
lcd.print(heartRate);
lcd.print(" BPM");
// Check for button presses
if (digitalRead(startButtonPin) == LOW) {
// Start heart rate measurement
// ... (your code here)
}
if (digitalRead(stopButtonPin) == LOW) {
// Stop heart rate measurement
// ... (your code here)
}
}
- Analog Read is the heart rate sensor pins analog value (A0) is read by the code.
- Your heartbeats electrical impulses cause this number to change over time.
- Noise reduction is to lessen noise and increase the accuracy of the heart rate measurement, the code may employ methods like averaging or filtering.
- Conversion to BPM is a digital value (0–1023) is created from the analog value.
- Next, a heart rate in beats per minute BPM is assigned to this number.
- The heart rate sensor modules calibration and sensitivity determine the precise mapping.
- Adjustment Factors depending on the particulars of your heart rate sensor module, the calculation (sensorValue * 60) / 1023 may need to be adjusted.
- Printing the unit “BPM” and the label “HR:” are printed on the LCD in addition to the heart rate number.
- Configuration of the Input in the pull-up resistors are used to configure the start and stop buttons as input pins.
- This indicates that when squeezed, they become low (0) from their typical high (1).
- Managing Events when either button is pushed, the code detects it.
- The heart rate monitor may begin if the start button is pushed.
- The measurement may be interrupted or paused if the stop button is pushed.
Circuit Working:
Parts List:
Component | Quantity |
---|---|
Arduino UNO | 1 |
Heart Beat sensor module | 1 |
16×2 LCD | 1 |
Push button tactile switches | 2 |
IC 7809 | 1 |
Potentiometer 10k | 1 |
Resistors 100k 1/4 watt | 2 |
In this post the Arduino UNO is supplied with a consistent 9V output voltage by use of the voltage regulator IC 7809.
This is helpful because the standard input voltage required by the Arduino UNO is 5V.
Here, heartbeats are detected with a heartbeat sensor module.
An infrared pair on the sensor picks up variations in blood flow brought on by the hearts pumping action.
These modifications are transformed into a voltage or pulse of electricity.
Heart Rate Sensor device connects to the Arduino UNO and receives the analog signal from the heart.
Arduino UNO device reads the analog data from the heart rate sensor, calculates the heart rate by processing it, and manages the LCD screen.
The computed heart rate is displayed on the LCD display.
Pressing start button from pin 2 on Arduino board causes the heartbeat measurement process.
This entails turning on the heart rate sensor module, wiping out any stored information, and setting up the LCD screen to display the heart rate.
Pressing the stop button will either pause or end the heart rate monitor.
This includes putting an end to the heart rate sensor module, storing any information gathered, and displaying a notice to let people know that the measurement has been halted or paused.
Potentiometer is used to modify the LCD displays contrast.
How to Build:
To build a Simple Heartbeat Monitor Circuit using Arduino following are the steps to follow:
- Gather all the components as shown in the above circuit diagram.
- Connect a regulated IC1 7809 to provide a regulated 9V DC to the Arduino board.
- Connect pot 10k 1st pin to VCC pin of LCD display board, 2nd leg of pot 10k to contrast pin of LCD display board and 3rd leg of pot 10k to GND pin of LCD display board.
- Connect Tactile switch start button one leg from pin 2 on the Arduino board and other leg to ground.
- Connect Tactile switch stop button one leg from pin 3 on the Arduino board and other leg to ground.
- Connect one 100k resistor between pin 2 and positive 5V on Arduino board.
- Connect other 100k resistor between pin 3 and positive 5V on Arduino board.
- Connect a 3 pin Heartbeat Sensor Module 1st leg to 5V on Arduino board, 2nd leg on ground and third leg to A0 on Arduino board.
- Connect R/W on the LCD display with the ground supply on the Arduino.
- Connect Blacklight cathode on the LCD display with the ground supply on the Arduino
- Connect Blacklight anode on the LCD display with the 5V power supply on the Arduino
Connections of an LCD Display to Arduino board:
Arduino Pin | LCD Pin | Description |
---|---|---|
5V | VCC | Power supply |
GND | GND | Ground |
D2 | RS | Register select |
D3 | E | Enable |
D4, D5, D6, D7 | D4, D5, D6, D7 | Data pins |
Conclusion:
This project illustrates a basic heartbeat monitor.
The code offers a fundamental structure for figuring out and showing heart rate.
Details on the connections and circuit architecture are also given.
By adding more sophisticated capabilities, including the ability to save heart rate data, determine the average heart rate, and provide visual cues, this project may be improved even further.
Leave a Reply