Problem with MLX90614 Temperature Sensor with ESP32-C6

esp32tinker
Posts: 4
Joined: Wed Nov 12, 2025 7:14 am

Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby esp32tinker » Wed Nov 12, 2025 7:33 am

Wonder if anyone can give me pointers how to make MLX90614 to work with ESP32?

I have ESP32-C6 and it works with BME280, which is a Temperature, Humidity & Pressure Sensor.

I've tested both MLX90614 and BME280 using I2C, connected to the same pins in ESP32-C6 (8 and 9), not same time just to be clear.

Just cannot make the MLX90614 work. I've even tried three different individual sensors and nothing, so don't think it is problem with solders (sensor comes with its small board).

I swapped SDA and SCL just to make sure, used both 3.3V and 5V for Vcc, changed to different frequencies (10kHz and 1kHz) and still does not respond. I found one link which advised first to reset SDA line by raising it high and then low but that did not change anything. And yes, tried adding external pull-up resistors even though I think the sensor board also has those. Tried other pins in ESP32 for SDA and SCL and of course I tried using other addresses than 0x5A. Still, no luck.

What am I missing, any ideas if anyone has been able to make MLX90614 to work?

Minatel
Espressif staff
Espressif staff
Posts: 432
Joined: Mon Jan 04, 2021 2:06 pm

Re: Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby Minatel » Thu Nov 13, 2025 6:17 pm

Hi,

Have you tried any of the components on the ESP Registry? Like this one mlx90614?

esp32tinker
Posts: 4
Joined: Wed Nov 12, 2025 7:14 am

Re: Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby esp32tinker » Sat Nov 15, 2025 10:35 am

Thanks, was not aware of this. Actually only used Arduino IDE, which I think I should have mentioned, sorry.

But installed ESP-IDF also and I think I got this library installed but still then same, no luck.

You did give me an idea to try other libraries which are found in Arduino IDE also and doing it now. After trying couple, still not working :roll:

But appreciate the hint and starting to think I might be just too noob with ESP32.

BTW, friend of mine was able to make the same sensor to work with Arduino UNO so there must be somekind of differences here..

esp32tinker
Posts: 4
Joined: Wed Nov 12, 2025 7:14 am

Re: Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby esp32tinker » Tue Nov 18, 2025 9:11 am

Been testing the sensor and got some progress, with the code below the sensor is now detected.
Decided for now to do the testing using Arduino IDE as feel more comfortable with it.
Problem is still reading the sensor output gives no values:

MLX90614 ready!
Ambient: nan °C | Object: nan °C
Ambient: nan °C | Object: nan °C
Ambient: nan °C | Object: nan °C


Code:

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
Serial.begin(115200);
Wire.begin(6, 7); // SDA=6, SCL=7
Wire.setClock(5000);

if (!mlx.begin()) {
Serial.println("Error connecting to MLX90614!");
while (1);
}

Serial.println("MLX90614 ready!");
}

void loop() {
float ambient = mlx.readAmbientTempC();
float object = mlx.readObjectTempC();

Serial.print("Ambient: ");
Serial.print(ambient);
Serial.print(" °C | Object: ");
Serial.print(object);
Serial.println(" °C");

delay(1000);
}

esp32tinker
Posts: 4
Joined: Wed Nov 12, 2025 7:14 am

Re: Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby esp32tinker » Tue Nov 18, 2025 9:19 am

Ok success, got it working.

Read somewhere about frequencies and changed the frequency to 50kHz from 5kHz.

Just started working.

Really appreciate also the response on ESP Registry, it helped me also to test few things.

Minatel
Espressif staff
Espressif staff
Posts: 432
Joined: Mon Jan 04, 2021 2:06 pm

Re: Problem with MLX90614 Temperature Sensor with ESP32-C6

Postby Minatel » Tue Nov 18, 2025 10:42 am

Enjoy, and thanks for the feedback.

Who is online

Users browsing this forum: Baidu [Spider], meta-externalagent, PerplexityBot, PetalBot and 9 guests