Cant get result on arduino due

hello every one
im using Pulse Express Pulse-Ox & Heart Rate Sensor with MAX32664
with my arduino due

every time i connect the sensor and open serial monitor it says "Could not communicate with the sensor! please make proper connections"

but same connections on arduino uno works and post data on my serial monitor just fine

what i can do to make it work with my arduino due

the code :arrow_down:

#include <Wire.h>
#include "max32664.h"

#define RESET_PIN 04
#define MFIO_PIN 02
#define RAWDATA_BUFFLEN 250

max32664 MAX32664(RESET_PIN, MFIO_PIN, RAWDATA_BUFFLEN);


void mfioInterruptHndlr(){
  //Serial.println("i");
}

void enableInterruptPin(){

  //pinMode(mfioPin, INPUT_PULLUP);
  attachInterrupt(digitalPinToInterrupt(MAX32664.mfioPin), mfioInterruptHndlr, FALLING);

}

void loadAlgomodeParameters(){

  algomodeInitialiser algoParameters;
  /*  Replace the predefined values with the calibration values taken with a reference spo2 device in a controlled environt.
      Please have a look here for more information, https://pdfserv.maximintegrated.com/en/an/an6921-measuring-blood-pressure-MAX32664D.pdf
      https://github.com/Protocentral/protocentral-pulse-express/blob/master/docs/SpO2-Measurement-Maxim-MAX32664-Sensor-Hub.pdf
  */

  algoParameters.calibValSys[0] = 120;
  algoParameters.calibValSys[1] = 122;
  algoParameters.calibValSys[2] = 125;

  algoParameters.calibValDia[0] = 80;
  algoParameters.calibValDia[1] = 81;
  algoParameters.calibValDia[2] = 82;

  algoParameters.spo2CalibCoefA = 1.5958422;
  algoParameters.spo2CalibCoefB = -34.659664;
  algoParameters.spo2CalibCoefC = 112.68987;

  MAX32664.loadAlgorithmParameters(&algoParameters);
}



void setup(){

  Serial.begin(57600);

  Wire.begin();

  loadAlgomodeParameters();

  int result = MAX32664.hubBegin();
  if (result == CMD_SUCCESS){
    Serial.println("Sensorhub begin!");
  }else{
    //stay here.
    while(1){
      Serial.println("Could not communicate with the sensor! please make proper connections");
      delay(5000);
    }
  }

  bool ret = MAX32664.startBPTcalibration();
  while(!ret){

    delay(10000);
    Serial.println("failed calib, please retsart");
    //ret = MAX32664.startBPTcalibration();
  }

  delay(1000);

  //Serial.println("start in estimation mode");
  ret = MAX32664.configAlgoInEstimationMode();
  while(!ret){

    //Serial.println("failed est mode");
    ret = MAX32664.configAlgoInEstimationMode();
    delay(10000);
  }

  //MAX32664.enableInterruptPin();
  Serial.println("Getting the device ready..");
  delay(1000);
}

void loop(){

  uint8_t num_samples = MAX32664.readSamples();

  if(num_samples){

    Serial.print("sys = ");
    Serial.print(MAX32664.max32664Output.sys);
    Serial.print(", dia = ");
    Serial.print(MAX32664.max32664Output.dia);
    Serial.print(", hr = ");
    Serial.print(MAX32664.max32664Output.hr);
    Serial.print(" spo2 = ");
    Serial.println(MAX32664.max32664Output.spo2);
  }

  delay(100);
}

Welcome to the forum.

The sensor board has logic level shifter and voltage regulators to make it work with 5V.

The Arduino Due is a 3.3V board and the Arduino Uno is a 5V board. Likely you need to get around the additional circuit and connect the 3.3V signals directly.

Have a look at the sensor board schematic on the web page you posted.

is there any way to get it work by editing the code or changing pins ?
i looked at sensor board schematic and didn't understand anything

No, this is about electrical signals.

If you do not want to modify your sensor board, you could get a level-shifter module and insert that between the Arduino and the sensor module. It is a little silly, but a level-shifter is cheaper than the sensor. You would then need to power the sensor board with 5V. Do not try that without an additional level-shifter. The sensor board would otherwise damage your Arduino.

If you have access to an oscilloscope, I recommend you have a look at the signals to learn. Any cheap old analog oscilloscope would do.

Try to understand the schematic. If you have any specific questions let me know.

I suspect the main issue is U2. To get 3.3V out of it you need to have a voltage that is higher than 3.3V. But if you would just use 5V at Vcc you would get 5V at the IO connector. See how the pins there are connected to the level-shifter and trough the resistors to Vcc.

Thank you very much for your help appreciate it
I will stick with my arduino UNO until my nextion screen and temperature sensor arrive and see if I can pull the project with just arduino UNO or need to switch to arduino Maga

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.