Giter Club home page Giter Club logo

protocentral-pulse-express's People

Contributors

mohammedhm avatar protocentralashwin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

protocentral-pulse-express's Issues

Sensor documentation

Hello there! I want to interface the sensor with a PIC microcontroller but I can't find the documentation to see how to manage the I2C communication between the PIC and the sensor, only with Arduino. Any reference it's appreciated. Thanks in advance!

Not working with latest .msbl version (40.6.0) of the MAX32664D hub IC

Hello, I am not sure if this is right place to raise this issue but I found that these examples are not working if we load the latest MSBL file from Analog device website which is currently 40.6.0. I also found that this examples are working perfect with older version of MSBL that is 40.2.2. Unfortunately I don't have older MSBL file. I had few IC's laying around which was preloaded with 40.2.2 MSBL where this code was working fine.
I request to send me older MSBL (40.2.2).
Better if we make that MSBL file as part of this repository.
Thank you
[email protected]
[email protected]

Problem working with MAX30102

Hi there

I have tried to use your library with MAX30102 alone, but it gave me some error message on serial monitor indicating that sensor is wrongly wired. I assume that your library can not work with MAX30102 alone and need ProtoCentral board itself?

SpO2 giving 100 ONLY

Hi. I have this sensor and it is great in terms of pressure and HR. But oxygen gives a constant value of 100 for everyone (I tried five different people). Does anyone know how to adjust this?

Max30102 didn't give me the result I expected, does the problem with the code?

Hi there,
I'm try max30102 with nodemcu everything is alright, except the readings I get are changing with a huge different it sometimes give a negative No. (-999) when SpO2 isn't valid, there is no other negative No. other than this, but I don't like that. I want it to give readings when its valid and waiting when it's not valid.

this is the code used:

`
// Include section
#include <Wire.h>
#include "MAX30105.h"
#include "spo2_algorithm.h"
#include "heartRate.h"

// Definitions
#define MAX_BRIGHTNESS 255

// Variables declaration
#if defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168__)

uint16_t irBuffer[100]; //infrared LED sensor data
uint16_t redBuffer[100];  //red LED sensor data
#else
uint32_t irBuffer[100]; //infrared LED sensor data
uint32_t redBuffer[100];  //red LED sensor data
#endif

int32_t bufferLength; //data length
int32_t spo2; //SPO2 value
int8_t validSPO2; //indicator to show if the SPO2 calculation is valid
int32_t heartRate; //heart rate value
int8_t validHeartRate; //indicator to show if the heart rate calculation is valid

byte pulseLED = 11; //Must be on PWM pin
byte readLED = 13; //Blinks with each data read

// Heart rate vars

const byte RATE_SIZE = 4; //Increase this for more averaging. 4 is good.
byte rates[RATE_SIZE]; //Array of heart rates
byte rateSpot = 0;
long lastBeat = 0; //Time at which the last beat occurred

float beatsPerMinute;
int beatAvg;

// sampling times

unsigned long prevHRTime;
unsigned long prevSP02Time;

// Sensor object instantiation
MAX30105 particleSensor;

// Setup
void setup(){

// Initialize serial port and configure your sensor 

  Serial.begin(115200);
 Serial.println("Initializing...");

  // Initialize sensor
  if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) 
  {
    Serial.println("MAX30105 was not found. Please check wiring/power. ");
    while (1);
  }
  Serial.println("Place your index finger on the sensor with steady pressure.");

  particleSensor.setup(); //Configure sensor with default settings
  particleSensor.setPulseAmplitudeRed(0x0A); //Turn Red LED to low to indicate sensor is running
  particleSensor.setPulseAmplitudeGreen(0); //Turn off Green LED

  prevHRTime = millis();
  prevSP02Time = millis();
}


// main loop

void loop(){

    unsigned long now = millis();

//    if(now - prevHRTime > 50){
//        prevHRTime  = now;
//
        heart_rate();    // Implementation is below
//
//    }
  
}



void heart_rate(){

 long irValue = particleSensor.getIR();

  if (checkForBeat(irValue) == true)
  {
    //We sensed a beat!
    long delta = millis() - lastBeat;
    lastBeat = millis();

    beatsPerMinute = 60 / (delta / 1000.0);
    Serial.print("true");

    // ------------------------------------------------------

      bufferLength = 100; //buffer length of 100 stores 4 seconds of samples running at 25sps

  //read the first 100 samples, and determine the signal range
  for (byte i = 0 ; i < bufferLength ; i++)
  {
    while (particleSensor.available() == false) //do we have new data?
      particleSensor.check(); //Check the sensor for new data

    redBuffer[i] = particleSensor.getRed();
    irBuffer[i] = particleSensor.getIR();
    particleSensor.nextSample(); //We're finished with this sample so move to next sample

  }

  //calculate heart rate and SpO2 after first 100 samples (first 4 seconds of samples)
  maxim_heart_rate_and_oxygen_saturation(irBuffer, bufferLength, redBuffer, &spo2, &validSPO2, &heartRate, &validHeartRate);

  //Continuously taking samples from MAX30102.  Heart rate and SpO2 are calculated every 1 second
  while (1)
  {
    //dumping the first 25 sets of samples in the memory and shift the last 75 sets of samples to the top
    for (byte i = 25; i < 100; i++)
    {
      redBuffer[i - 25] = redBuffer[i];
      irBuffer[i - 25] = irBuffer[i];
    }

    //take 25 sets of samples before calculating the heart rate.
    for (byte i = 75; i < 100; i++)
    {
      while (particleSensor.available() == false) //do we have new data?
        particleSensor.check(); //Check the sensor for new data

      digitalWrite(readLED, !digitalRead(readLED)); //Blink onboard LED with every data read

      redBuffer[i] = particleSensor.getRed();
      irBuffer[i] = particleSensor.getIR();
      particleSensor.nextSample(); //We're finished with this sample so move to next sample

      //send samples and calculation result to terminal program through UART


      Serial.print(", HR=");
      Serial.print(heartRate, DEC);
      
      Serial.print(", SPO2=");
      Serial.print(spo2, DEC);

      Serial.print(", SPO2Valid=");
      Serial.println(validSPO2, DEC);
    }

    //After gathering 25 new samples recalculate HR and SP02
    maxim_heart_rate_and_oxygen_saturation(irBuffer, bufferLength, redBuffer, &spo2, &validSPO2, &heartRate, &validHeartRate);
  }

    //--------------------------------------------------------


  Serial.print("IR=");
  Serial.print(irValue);
  Serial.print(", BPM=");
  Serial.print(beatsPerMinute);
//  Serial.println();
  }



  if (irValue < 50000)
  {
    beatsPerMinute = 0;
    beatAvg = 0;
    Serial.print(" No finger?");
    Serial.println();
  }


}

,

this is the result I got:

,
 No finger?
true, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=88, SPO2=-999, SPO2Valid=0
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=53, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=62, SPO2=14, SPO2Valid=1
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=-999, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=107, SPO2=-999, SPO2Valid=0
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=214, SPO2=63, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=136, SPO2=84, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=72, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=250, SPO2=48, SPO2Valid=1
, HR=214, SPO2=61, SPO2Valid=1
,

algorithm-mode.ino file

Hi,
I was going through the documentation and there it was mentioned that we can callibrate the sensor bu adding SpO2 and BPT values in the algorithm-mode.ino file but in the source code no such file is available. Do we have to change them in the header files or something else.

Please reply as I would like to work upon the same

Thanks

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.