├── LICENSE ├── README.md ├── image.png └── main.ino /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Abhineet Raj 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arduino pulse sensor device 2 | 3 | This device gathers the data regarding heartbeat/Pulse/BPM rate, and displays it to user on LCD display. 4 | 5 | ## Materials required 6 | * Pulse sensor 7 | * LCD 16X2 8 | * Arduino UNO 9 | 10 | ## Working rule 11 | 12 | * When a heartbeat occurs, blood is pumped through the human body and gets squeezed into the capillary tissues. Consequently, the volume of these capillary tissues increases. But in between the two consecutive heartbeats, this volume inside capillary tissues decreases. This change in volume between the heartbeats affects the amount of light that will transmit through these tissues. This can be measured with the help of a microcontroller. 13 | * The pulse sensor module has a light that helps in measuring the pulse rate. When we place the finger on the pulse sensor, the light reflected will change based on the volume of blood inside the capillary blood vessels. This variation in light transmission and reflection can be obtained as a pulse from the output of the pulse sensor. This pulse can be then conditioned to measure heartbeat and then programmed accordingly to read as heartbeat count using Arduino. 14 | 15 | ## Circuit 16 | ![alt text](https://github.com/abhineetraj1/arduino-pulse-sensor/blob/main/image.png?raw=true) 17 | 18 | ## Installation 19 | * Download Arduino IDE. 20 | * Open main.ino file and upload the code into arduino board. 21 | * Attach tft display to arduino board 22 | * Run your Arduino :) 23 | 24 | ## Programming languages used:- 25 | cplusplus arduino 26 | 27 | 28 | ## Author 29 | * [abhineetraj1](http://github.com/abhineetraj1) -------------------------------------------------------------------------------- /image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abhineetraj1/arduino-pulse-sensor/f8e0d3c16488276fa2c2f662d51fa25101779adf/image.png -------------------------------------------------------------------------------- /main.ino: -------------------------------------------------------------------------------- 1 | #define USE_ARDUINO_INTERRUPTS true // Set-up low-level interrupts for most acurate BPM math. 2 | #include // Includes the PulseSensorPlayground Library. 3 | #include 4 | LiquidCrystal lcd(7, 6, 5, 4, 3, 2); 5 | 6 | // Variables 7 | const int PulseWire = 0; // PulseSensor PURPLE WIRE connected to ANALOG PIN 0 8 | const int LED13 = 13; // The on-board Arduino LED, close to PIN 13. 9 | int Threshold = 550; // Determine which Signal to "count as a beat" and which to ignore. 10 | // Use the "Gettting Started Project" to fine-tune Threshold Value beyond default setting. 11 | // Otherwise leave the default "550" value. 12 | 13 | PulseSensorPlayground pulseSensor; // Creates an instance of the PulseSensorPlayground object called "pulseSensor" 14 | void setup() { 15 | Serial.begin(9600); // For Serial Monitor 16 | lcd.begin(20,4); 17 | 18 | // Configure the PulseSensor object, by assigning our variables to it. 19 | pulseSensor.analogInput(PulseWire); 20 | pulseSensor.blinkOnPulse(LED13); //auto-magically blink Arduino's LED with heartbeat. 21 | pulseSensor.setThreshold(Threshold); 22 | 23 | // Double-check the "pulseSensor" object was created and "began" seeing a signal. 24 | if (pulseSensor.begin()) { 25 | Serial.println("We created a pulseSensor Object !"); //This prints one time at Arduino power-up, or on Arduino reset. 26 | lcd.setCursor(0,0); 27 | lcd.print(" Heart Rate Monitor"); 28 | } 29 | } 30 | 31 | void loop() { 32 | int myBPM = pulseSensor.getBeatsPerMinute(); // Calls function on our pulseSensor object that returns BPM as an "int". 33 | // "myBPM" hold this BPM value now. 34 | if (pulseSensor.sawStartOfBeat()) { // Constantly test to see if "a beat happened". 35 | Serial.println("♥ A HeartBeat Happened ! "); // If test is "true", print a message "a heartbeat happened". 36 | Serial.print("BPM: "); // Print phrase "BPM: " 37 | Serial.println(myBPM); // Print the value inside of myBPM. 38 | lcd.setCursor(0,2); 39 | lcd.print("HeartBeat Happened !"); // If test is "true", print a message "a heartbeat happened". 40 | lcd.setCursor(5,3); 41 | lcd.print("BPM: "); // Print phrase "BPM: " 42 | lcd.print(myBPM); 43 | } 44 | delay(20); // considered best practice in a simple sketch. 45 | } --------------------------------------------------------------------------------