Heart Rate Monitor using Arduino
Welcome to the Technical Praveen Guys, In this article, I am making another undertaking which is intriguing and simple to make. ever you saw your pulse? clearly you saw and feel it. be that as it may, with the assistance of this venture, you will see and ascertain your pulse with this eminent undertaking. likewise, I am making a pulse screen, from here you can undoubtedly make and gain proficiency with this venture. there is an OLED display on which you will see the graphical portrayal just as the numeric estimation of the heartbeat. pulse a lot rate are very similar things. a large number of us think of them as various. also, in this article, we will learn I2C protocol, analog pin utilization, and numerous different things. we are making a great deal of designing tasks on various controllers and sensors. however, chiefly we use Arduino and in the event that you need to gain proficiency with the Arduino you can take in it from our site. which can assist you with learning the Arduino and its interfacing with the gadget and sensors.
How does it works?
In this section, we will see the working of the heart rate monitor and sensor. the pulse rate sensor having a green shading light on which we need to put our finger with the goal that the light can episode on our skin. from that point onward, the sensor read the worth and sense this value to the Arduino. Arduino measure on this worth and after all the computation it send the information to OLED display to show. OLED display is highly contrasting presentation that can just show the white tone in the content just as in the activity. so I am utilizing them both. 128×64 pixel content in this small OLED. so it can show you the 128 characters all at once.
OLED display is more alluring than the old 16X2 display and having more pixels with the goal that it can show more character than the LCD. what's more, it can straightforwardly speak with the I2C Protocol. thus, it needs just two wires to speak with the regulator. be that as it may, the disadvantage is the pixel size. the words showing into the showcase are too short to even consider seeing. Presently talk about the Heart rate sensor. Pulse sensor chip away at the optical standard. there are one light and one photodiode that sense the light force. the affectability is high of this photodiode so that can undoubtedly detect the low-force light too. presently, when we place our finger at the highest point of the sensor the light occurrence from the light source on the finger and back to the photodiode. at the point when the blood abruptly expands the light sense by the photodiode likewise be change. so the sensor can send this information to the cycle. this is the manner by which the heart rate monitor work. there are one more OLED show venture gas leakage Detector.
Components Required for Heart Rate Monitor
- Pulse Rate sensor module
- Arduino Nano
- Zero PCB
- OLED 128X64
- Berg Strips
Circuit Diagram
Code :-
#include <Adafruit_SSD1306.h>
#define OLED_Address 0x3C
Adafruit_SSD1306 oled(1);
int x=0;
int lastx=0;
int lasty=0;
int LastTime=0;
int ThisTime;
bool BPMTiming=false;
bool BeatComplete=false;
int BPM=0;
#define UpperThreshold 560
#define LowerThreshold 500
void setup() {
oled.begin(SSD1306_SWITCHCAPVCC, OLED_Address);
oled.clearDisplay();
oled.setTextSize(2);
}
void loop()
{
if(x>127)
{
oled.clearDisplay();
x=0;
lastx=x;
}
ThisTime=millis();
int value=analogRead(0);
oled.setTextColor(WHITE);
int y=60-(value/16);
oled.writeLine(lastx,lasty,x,y,WHITE);
lasty=y;
lastx=x;
// calc bpm
if(value>UpperThreshold)
{
if(BeatComplete)
{
BPM=ThisTime-LastTime;
BPM=int(60/(float(BPM)/1000));
BPMTiming=false;
BeatComplete=false;
tone(8,1000,250);
}
if(BPMTiming==false)
{
LastTime=millis();
BPMTiming=true;
}
}
if((value<LowerThreshold)&(BPMTiming))
BeatComplete=true;
// display bpm
oled.writeFillRect(0,50,128,16,BLACK);
oled.setCursor(0,50);
oled.print(BPM);
oled.print(” BPM”);
oled.display();
x++;
}
Note :
there are two library which you have to include in the Arduino IDE
Arduino GFX library
Arduino 1306 library
0 Comments
If you have any doubts, Please let me know