Giter Site home page Giter Site logo

kashishsinghyadav / heart-rate-moniter-system-using-iot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 12 KB

we are going to make a Heart Rate Monitoring System using Arduino, Pulse sensor, and ESP8266 WiFi module. The pulse sensor will detect the heart rate, and Arduino will send it to Thingspeak using the ESP8266 WiFi module.

License: MIT License

C++ 100.00%

heart-rate-moniter-system-using-iot's Introduction

๐ˆ๐Ž๐“ ๐๐š๐ฌ๐ž๐ ๐‡๐ž๐š๐ซ๐ญ ๐‘๐š๐ญ๐ž ๐Œ๐จ๐ง๐ข๐ญ๐จ๐ซ ๐ฎ๐ฌ๐ข๐ง๐  ๐€๐ซ๐๐ฎ๐ข๐ง๐จ ๐š๐ง๐ ๐„๐’๐๐Ÿ–๐Ÿ๐Ÿ”๐Ÿ”

we are make a Heart Rate Monitoring System using Arduino, Pulse sensor, and ESP8266 WiFi module. The pulse sensor will detect the heart rate, and Arduino will send it to Thingspeak using the ESP8266 WiFi module

  • ๐‚๐จ๐ฆ๐ฉ๐จ๐ง๐ž๐ง๐ญ๐ฌ ๐‘๐ž๐ช๐ฎ๐ข๐ซ๐ž๐ *

->๐๐ฎ๐ฅ๐ฌ๐ž ๐ฌ๐ž๐ง๐ฌ๐จ๐ซ

->๐„๐’๐๐Ÿ–๐Ÿ๐Ÿ”๐Ÿ” ๐–๐ข-๐…๐ข ๐ฆ๐จ๐๐ฎ๐ฅ๐ž

->๐€๐ซ๐๐ฎ๐ข๐ง๐จ ๐”๐ง๐จ

->๐๐ซ๐ž๐š๐ ๐๐จ๐š๐ซ๐

->๐Ÿ๐Ÿ๐ŸŽ-๐จ๐ก๐ฆ ๐ซ๐ž๐ฌ๐ข๐ฌ๐ญ๐จ๐ซ๐ฌ

->๐‹๐„๐ƒ

->๐‚๐จ๐ง๐ง๐ž๐œ๐ญ๐ข๐ง๐  ๐ฐ๐ข๐ซ๐ž๐ฌ

*๐๐ซ๐จ๐ ๐ซ๐š๐ฆ๐ฆ๐ข๐ง๐  ๐‚๐จ๐๐ž ๐„๐ฑ๐ฉ๐ฅ๐š๐ง๐š๐ญ๐ข๐จ๐ง *

First of all, install all the required libraries and then enter your Wi-Fi name, password, and thingspeak.com api.

#include <SoftwareSerial.h> #include <stdlib.h> #define DEBUG true #define SSID "WiFi Name" // Enter Your WiFi Name Here #define PASS "WiFi Password" // Enter Your WiFi Password Here #define IP "api.thingspeak.com"// thingspeak.com api

Define the pins where you connected the esp8266 Tx and Rx and enter your Thingspeak API key.

SoftwareSerial ser(2,3); String msg = "GET /update?key=Your Api Key"; //Enter your API key

  • ๐ƒ๐ž๐Ÿ๐ข๐ง๐ž ๐š๐ฅ๐ฅ ๐ญ๐ก๐ž ๐ข๐ง๐ญ๐ž๐ ๐ž๐ซ ๐š๐ง๐ ๐ฏ๐จ๐ฅ๐š๐ญ๐ข๐ฅ๐ž ๐ฏ๐š๐ซ๐ข๐š๐›๐ฅ๐ž๐ฌ ๐ญ๐ก๐š๐ญ ๐ฐ๐ข๐ฅ๐ฅ ๐›๐ž ๐ฎ๐ฌ๐ž๐ ๐ญ๐จ ๐œ๐š๐ฅ๐œ๐ฎ๐ฅ๐š๐ญ๐ž ๐ญ๐ก๐ž ๐๐๐Œ (๐๐ž๐š๐ญ๐ฌ ๐๐ž๐ซ ๐Œ๐ข๐ง๐ฎ๐ญ๐ž). *

/Variables int error; int sensorPin = 0; // Connect Pulse Sensor Signal Pin to Analog Pin A0 int ledpin = 9; // Connect Led Positive Pin to Arduino Pin 9 volatile int BPM; // int that holds raw Analog in 0. updated every 2mS volatile int Signal; // holds the incoming raw data volatile int IBI = 600; // int that holds the time interval between beats volatile boolean Pulse = false; // "True" when heartbeat is detected. "False" when not a "live beat". volatile boolean QS = false; // becomes true when Arduino finds a beat.

  • ๐“๐ก๐ž ๐ฏ๐จ๐ข๐ ๐ฎ๐ฉ๐๐š๐ญ๐ž๐›๐ž๐š๐ญ() ๐Ÿ๐ฎ๐ง๐œ๐ญ๐ข๐จ๐ง ๐ฐ๐ข๐ฅ๐ฅ ๐ฌ๐ž๐ง๐ ๐๐š๐ญ๐š ๐ญ๐จ ๐ญ๐ก๐ž ๐ฌ๐ž๐ซ๐ข๐š๐ฅ ๐ฆ๐จ๐ง๐ข๐ญ๐จ๐ซ ๐š๐ง๐ ๐š๐ฅ๐ฌ๐จ ๐ฉ๐ฎ๐›๐ฅ๐ข๐ฌ๐ก ๐ข๐ญ ๐ญ๐จ ๐ญ๐ก๐ž ๐ญ๐ก๐ข๐ง๐ ๐ฌ๐ฉ๐ž๐š๐ค ๐œ๐ก๐š๐ง๐ง๐ž๐ฅ. *

    void updatebeat() { String cmd = "AT+CIPSTART="TCP",""; cmd += IP; cmd += "",80"; Serial.println(cmd); ser.println(cmd); delay(2000); if(ser.find("Error")) { return; } cmd = msg ; cmd += "&field1=";
    cmd += BPM; cmd += "\r\n"; Serial.print("AT+CIPSEND="); ser.print("AT+CIPSEND="); Serial.println(cmd.length()); ser.println(cmd.length()); if(ser.find(">")) { Serial.print(cmd); ser.print(cmd); }

  • ๐“๐ก๐ž ๐›๐ž๐ฅ๐จ๐ฐ ๐œ๐จ๐๐ž ๐ข๐ฌ ๐ฎ๐ฌ๐ž๐ ๐ญ๐จ ๐œ๐จ๐ง๐ฏ๐ž๐ซ๐ญ ๐ญ๐ก๐ž ๐ฉ๐ฎ๐ฅ๐ฌ๐ž ๐ฌ๐ž๐ง๐ฌ๐จ๐ซ ๐๐š๐ญ๐š ๐ข๐ง๐ญ๐จ ๐๐๐Œ (๐๐ž๐š๐ญ๐ฌ ๐๐ž๐ซ ๐Œ๐ข๐ง๐ฎ๐ญ๐ž). *

    ISR (TIMER2_COMPA_vect){ // triggered when Timer2 counts to 124 cli(); // disable interrupts while we do this Signal = analogRead(sensorPin); // read the Pulse Sensor sampleCounter += 2; // keep track of the time in mS int N = sampleCounter - lastBeatTime; // monitor the time since the last beat to avoid noise // find the peak and trough of the pulse wave

    if(Signal < thresh && N > (IBI/5)*3){ // avoid dichrotic noise by waiting 3/5 of last IBI if (Signal < T){ // T is the trough T = Signal; // keep track of lowest point in pulse wave } } if(Signal > thresh && Signal > P){ // thresh condition helps avoid noise P = Signal; // P is the peak } // keep track of highest point in pulse wave if (N > 250){ // avoid high frequency noise if ( (Signal > thresh) && (Pulse == false) && (N > (IBI/5)*3) ){
    Pulse = true; // set the Pulse flag when there is a pulse digitalWrite(ledpin,HIGH); // turn on pin 13 LED IBI = sampleCounter - lastBeatTime; // time between beats in mS lastBeatTime = sampleCounter; // keep track of time for next pulse if(secondBeat){ // if this is the second beat secondBeat = false; // clear secondBeat flag for(int i=0; i<=9; i++){ // seed the running total to get a realistic BPM at startup rate[i] = IBI;
    } }

*๐‚๐ข๐ซ๐œ๐ฎ๐ข๐ญ ๐ƒ๐ข๐š๐ ๐ซ๐š๐ฆ

Screenshot (82)

Screenshot (81)

heart-rate-moniter-system-using-iot's People

Contributors

kashishsinghyadav avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.