Sparkfun 30101 sensor with nodemcu ESP8266 status 16?

Hello We are using SparkFun Pulse Oximeter and Heart Rate Sensor - MAX30101 & MAX32664 (Qwiic) with nodemcu esp8266 and getting the error Status: 16. Attached pictures shows the diagram and the error code.
Please let me know if this digarm is correct . When we use Arduino instead of nodemcu the sensor is working fine and we can read the heart rate and oxygen.


To facilitate help, post your code.
But when posting the code, don't forget to put it between tags </>.


RV mineirin

#include <SparkFun_Bio_Sensor_Hub_Library.h>
#include <Wire.h>

// Reset pin, MFIO pin
int resPin = 4;
int mfioPin = 5;

// Takes address, reset pin, and MFIO pin.
SparkFun_Bio_Sensor_Hub bioHub(resPin, mfioPin); 

bioData body;  
// ^^^^^^^^^
// What's this!? This is a type (like int, byte, long) unique to the SparkFun
// Pulse Oximeter and Heart Rate Monitor. Unlike those other types it holds
// specific information on your heartrate and blood oxygen levels. BioData is
// actually a specific kind of type, known as a "struct". 
// You can choose another variable name other than "body", like "blood", or
// "readings", but I chose "body". Using this "body" varible in the 
// following way gives us access to the following data: 
// body.heartrate  - Heartrate
// body.confidence - Confidence in the heartrate value
// body.oxygen     - Blood oxygen level
// body.status     - Has a finger been sensed?

void setup(){


  int result = bioHub.begin();
  if (result == 0) // Zero errors!
    Serial.println("Sensor started!");
    Serial.println("Could not communicate with the sensor!!!");
  Serial.println("Configuring Sensor...."); 
  int error = bioHub.configBpm(MODE_ONE); // Configuring just the BPM settings. 
  if(error == 0){ // Zero errors!
    Serial.println("Sensor configured.");
  else {
    Serial.println("Error configuring sensor.");
    Serial.print("Error: "); 

  // Data lags a bit behind the sensor, if you're finger is on the sensor when
  // it's being configured this delay will give some time for the data to catch
  // up. 
  Serial.println("Loading up the buffer with data....");

void loop(){

    // Information from the readBpm function will be saved to our "body"
    // variable.  
    body = bioHub.readBpm();
    Serial.print("Heartrate: ");
    Serial.print("Confidence: ");
    Serial.print("Oxygen: ");
    Serial.print("Status: ");
    // Slow it down or your heart rate will go up trying to keep up
    // with the flow of numbers

Just posted the code. Thanks


When does this code 16 error appear?
During compilation/upload of code or during execution.
As I don't have this module, (SparkFun Pulse Oximeter and Heart Rate Sensor), I could only compile its code and no error occurred.

BTW where is this?

RV mineirin

The code burns to the nodemcu correctly. When we open the serial com windows we see this message.See the attached image. Thanks.

Examining the SparkFun_Bio_Sensor_Hub_Library.cpp file from the SparkFun_Bio_Sensor_Hub_Library.h library I found the following lines below.

    198       bioData SparkFun_Bio_Sensor_Hub::readBpm(){ <---- readBpm

    231       //"Machine State" - has a finger been detected?
    232       libBpm.status = bpmArr[5]; <<--- status

So it appears that status 16 appears to be a sensor fault detection.

RV mineirin

Thanks, Could you please clarify whether a sensor fault detection means faulty sensor ?
The same sensor works fine when used with Arduino.

I have the same problem. Did you manage to solve it?

have a look at Example1_config_BPM_Mode1.ino
where the connections are specified as

 MFIO -> PIN 5

however, looking at NodeMCU 8266 pinout etc GPIO5 is SCL and GPIO4 SDA so you have to use other pins for RESET and MFIO

Edit: looking at some code for a BMP280 I implemented some time ago there is a comment

 // ESP32 SDA to D21 SCL to D22
 // ESP8266 SDA to D2 (GPIO4) SCL to D1 (GPIO5)

Many thanks for the reply. It worked here!

what pins did you use for for RESET and MFIO?

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