DEV Community

graham
graham

Posted on

Unexpected I C data spikes from CJMCU-30205 MAX30205MTA on ESP32

I’m integrating the CJMCU-30205 MAX30205MTA Human Body Temperature Sensor
into an ESP32 project via I²C, but I’m getting inconsistent temperature readings in code.

Here’s the simplified snippet:

include

define SENSOR_ADDR 0x48

void setup() {
Serial.begin(115200);
Wire.begin();
}

void loop() {
Wire.beginTransmission(SENSOR_ADDR);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom(SENSOR_ADDR, 2);
if (Wire.available() == 2) {
int data = (Wire.read() << 8) | Wire.read();
float temp = data * 0.00390625; // 16-bit resolution
Serial.println(temp);
}
delay(500);
}

Sometimes the sensor outputs random spikes (like 25.3°C → 31.7°C → 25.2°C).
Is this a timing issue with Wire.requestFrom() or the MAX30205’s conversion delay?
Should I add a read delay after writing the register pointer, or handle it with a one-shot conversion mode?
Verified stable 3.3 V supply

Is this a timing issue with Wire.requestFrom() or the MAX30205’s conversion delay?
Should I add a read delay after writing the register pointer, or handle it with a one-shot conversion mode?

Top comments (0)