MLX Temp Sensor I2C Problems

Hi,
I'm trying to use an MLX90614 Temp sensor with no luck. I've added the 4.7K pullups and checked all my wiring with a muli. I've tried this with the A5/A4 as well as the dedicated SDA SCL pins on the Uno. Not really sure what's going on. I've used this board for other I2C (Adafruit OLED) with no problems. I have 3 of these sensors and none of them work, but they are all previously used on projects before me. Should I buy more sensors? Should I look for internal shorts on the device?

Any input is appreciated.
Thanks,
Leo

(The LED is the Pyrometer. From left to right inputs are VIN,GND,SCL,SDA)


// SPDX-FileCopyrightText: 2023 Carter Nelson for Adafruit Industries
//
// SPDX-License-Identifier: MIT
// --------------------------------------
// i2c_scanner
//
// Modified from https://playground.arduino.cc/Main/I2cScanner/
// --------------------------------------
#include <Arduino.h>
#include <Wire.h>


// Set I2C bus to use: Wire, Wire1, etc.
#define WIRE Wire
void setup() {
  WIRE.begin();

  Serial.begin(9600);
  while (!Serial)
     delay(10);
  Serial.println("\nI2C Scanner");
}


void loop() {
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    WIRE.beginTransmission(address);
    error = WIRE.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknown error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}

Getting the output:

---- Opened the serial port COM4 ----
11:15:06:093 -> 
11:15:06:093 -> I2C Scanner
11:15:06:107 -> Scanning...
11:15:06:107 -> No I2C devices found
11:15:06:107 -> 
11:15:11:500 -> Scanning...
11:15:11:501 -> No I2C devices found

I've no experience of your particular sensor, but a quick read of the datasheet for it says that it is an SMBUs compatible device. Paragraph 8.4.7 of the datasheet says:

The MLX90614 meets all the timing specifications of the SMBus [1]. The maximum frequency of the MLX90614 SMBus is 100 KHz and the minimum is 10 KHz.

I wonder if the standard I2C scanner is using a clock that is too fast. If so, try the multi-speed I2C scanner by Rob Tillaart.

See if that detects your device.

MLX90614-Datasheet-Melexis.pdf (2.7 MB)

Hey Mark, yeah I was concerned about the SMbus vs I2C situation. I gave that code a try and here's what I got:
It seems to be stuck?

12:26:07.225 -> 
12:26:07.225 -> <speeds = 50 100 150 200 250 300 350 400 >
12:26:07.225 -> 
12:26:07.225 -> Arduino MultiSpeed I2C Scanner - 0.1.16
12:26:07.257 -> 
12:26:07.257 -> I2C ports: 1  Current: Wire0
12:26:07.257 -> 	@ = toggle Wire - Wire1 .. Wire5 [e.g. TEENSY or Arduino Due]
12:26:07.257 -> Scan mode:
12:26:07.257 -> 	s = single scan
12:26:07.257 -> 	c = continuous scan - 1 second delay
12:26:07.257 -> 	q = quit continuous scan
12:26:07.257 -> 	d = toggle latency delay between successful tests. 0 - 5 ms
12:26:07.257 -> 	i = toggle enable/disable interrupts
12:26:07.257 -> Output:
12:26:07.257 -> 	p = toggle printAll - printFound.
12:26:07.257 -> 	h = toggle header - noHeader.
12:26:07.290 -> 	a = toggle address range, 0..127 - 8..119 (default)
12:26:07.290 -> Speeds:
12:26:07.290 -> 	0 = 100..800 KHz - step 100  (warning - can block!!)
12:26:07.290 -> 	1 = 100 KHz
12:26:07.290 -> 	2 = 200 KHz
12:26:07.290 -> 	4 = 400 KHz
12:26:07.290 -> 	9 = 50..400 KHz - step 50     < DEFAULT >
12:26:07.290 -> 
12:26:07.290 -> 	!! HIGH SPEEDS - WARNING - can block - not applicable for UNO
12:26:07.290 -> 	8 =  800 KHz
12:26:07.290 -> 	M = 1000 KHz
12:26:07.290 -> 	N = 3400 KHz
12:26:07.290 -> 	O = 5000 KHz
12:26:07.290 -> 	P = 100 400 1000 3400 5000 KHz (standards)
12:26:07.329 -> 
12:26:07.329 -> 	r = reset to startup defaults.
12:26:07.329 -> 	? = help - this page
12:26:07.329 -> 
a
12:26:25.366 -> <address Range = 0..127>
s
12:26:40.133 -> TIME	DEC	HEX		50	100	150	200	250	300	350	400	[KHz]
12:26:40.176 -> --------------------------------------------------------------------------------------------------------

Since the MLX90614 should have the internal pullups in place, I tried that code (Multi speed I2C scanner) with and without pullup resistors. Without pullups it gets stuck, with pullups it shows no devices. So my sensor must be bad?

.........
12:32:45.944 -> 11155	90	0x5A		.	.	.	.	.	.	.	.
12:32:45.944 -> 11158	91	0x5B		.	.	.	.	.	.	.	.
12:32:45.944 -> 11160	92	0x5C		.	.	.	.	.	.	.	.
12:32:45.977 -> 11163	93	0x5D		.	.	.	.	.	.	.	.
12:32:45.977 -> 11166	94	0x5E		.	.	.	.	.	.	.	.
12:32:45.977 -> 11168	95	0x5F		.	.	.	.	.	.	.	.
12:32:45.977 -> 11171	96	0x60		.	.	.	.	.	.	.	.
12:32:45.977 -> 11174	97	0x61		.	.	.	.	.	.	.	.
12:32:45.977 -> 11176	98	0x62		.	.	.	.	.	.	.	.
12:32:45.977 -> 11180	99	0x63		.	.	.	.	.	.	.	.
12:32:45.977 -> 11183	100	0x64		.	.	.	.	.	.	.	.
12:32:45.977 -> 11185	101	0x65		.	.	.	.	.	.	.	.
12:32:45.977 -> 11188	102	0x66		.	.	.	.	.	.	.	.
12:32:45.977 -> 11191	103	0x67		.	.	.	.	.	.	.	.
12:32:45.977 -> 11194	104	0x68		.	.	.	.	.	.	.	.
12:32:46.010 -> 11196	105	0x69		.	.	.	.	.	.	.	.
12:32:46.010 -> 11199	106	0x6A		.	.	.	.	.	.	.	.
12:32:46.010 -> 11202	107	0x6B		.	.	.	.	.	.	.	.
12:32:46.010 -> 11205	108	0x6C		.	.	.	.	.	.	.	.
12:32:46.010 -> 11207	109	0x6D		.	.	.	.	.	.	.	.
12:32:46.010 -> 11210	110	0x6E		.	.	.	.	.	.	.	.
12:32:46.010 -> 11213	111	0x6F		.	.	.	.	.	.	.	.
12:32:46.010 -> 11216	112	0x70		.	.	.	.	.	.	.	.
12:32:46.010 -> 11218	113	0x71		.	.	.	.	.	.	.	.
12:32:46.010 -> 11222	114	0x72		.	.	.	.	.	.	.	.
12:32:46.010 -> 11225	115	0x73		.	.	.	.	.	.	.	.
12:32:46.010 -> 11228	116	0x74		.	.	.	.	.	.	.	.
12:32:46.043 -> 11230	117	0x75		.	.	.	.	.	.	.	.
12:32:46.043 -> 11233	118	0x76		.	.	.	.	.	.	.	.
12:32:46.043 -> 11236	119	0x77		.	.	.	.	.	.	.	.
12:32:46.043 -> 
12:32:46.043 -> 0 devices found in 410 milliseconds.

Here is some interesting reading: Guide to Comparing I²C Bus to the SMBus | Analog Devices It will explain they are compatible BUT there are considerations such as week pull up resistors, lower speed, etc.

We're reaching the limits of my knowledge on SMBus. I wonder is there is some subtle difference between I2C and SMBus that is causing the issue?

Do you have any other hardware that can interrogate the MLX?

Grasping at straws here, but another thing that may be worth trying is a software I2C port just to see if there's any response from the MLX that way. Being a software implementation, it could give you the potential to tweak the timing of the I2C bus signals in a way that the real hardware I2C interface can't - assuming of course that's the issue.

Did you get the MLX devices from a reputable source?

These were pulled out of an existing project. Looking at the documentation they ran one of these exact sensors off of just SCL/ SDA/GND/3.3V. So maybe I just burned this one out by testing with 5V. :0

Page 1 of the datasheet I posted says that there are 3v and 5v versions and it gives a breakdown of the part number. Does that tie in with any printing on the device itself?

No, part only shows "HW-691". Im going to buy two more from Amazon and try them with 3.3V. Hopefully that'll do it!

That's just some generic module identification. There are lots of breakout modules with all sorts of sensors that seem to have a similar format of marking: HW-xxx.

Page 53 of the datasheet covers the actual part marking and it says:

The MLX90614 is laser marked with 10 symbols. First 3 letters define device version (AAA, BCC, etc), and the last 7 are the lot number. Example: “ACC9307308” – MLX90614ACC from lot 9307308.

The AAA or BCC appears to refer to the 3 letter option code as detailed on the bottom of the front page of the datasheet.

Unfortunately I couldn't find out (or I missed it), where the actual marking is on the physical device. It would make sense for it to be around the circumference of the metal case rather than underneath the device where the pins are.

Take another look at your device to see if there is any laser etching visible.

It may be completely blank if the sensor is some generic Chinese clone.

Hi all,
New sensor works like a charm. Plug and play. Super happy!!

Adafruit MLX90614 test
Emissivity = 1.00
================================================
Ambient = 23.39*C       Object = 23.85*C
Ambient = 74.10*F       Object = 74.97*F

Ambient = 23.43*C       Object = 24.03*C
Ambient = 74.17*F       Object = 75.25*F

Ambient = 23.43*C       Object = 24.17*C
Ambient = 74.17*F       Object = 75.51*F

Ambient = 23.45*C       Object = 23.51*C
Ambient = 74.21*F       Object = 74.32*F

Ambient = 23.43*C       Object = 23.17*C
Ambient = 74.17*F       Object = 73.71*F

Ambient = 23.43*C       Object = 23.09*C
Ambient = 74.17*F       Object = 73.56*F

Ambient = 23.45*C       Object = 23.39*C
Ambient = 74.21*F       Object = 74.10*F

Ambient = 23.41*C       Object = 26.91*C
Ambient = 74.14*F       Object = 80.44*F

Ambient = 23.43*C       Object = 30.03*C
Ambient = 74.17*F       Object = 86.05*F

Ambient = 23.41*C       Object = 30.23*C
Ambient = 74.14*F       Object = 86.41*F

Ambient = 23.43*C       Object = 27.15*C
Ambient = 74.17*F       Object = 80.87*F

Ambient = 23.47*C       Object = 23.05*C
Ambient = 74.25*F       Object = 73.49*F

Ambient = 23.41*C       Object = 22.95*C
Ambient = 74.14*F       Object = 73.31*F

Ambient = 23.47*C       Object = 22.83*C
Ambient = 74.25*F       Object = 73.09*F

Ambient = 23.43*C       Object = 22.77*C
Ambient = 74.17*F       Object = 72.99*F

Ambient = 23.41*C       Object = 22.89*C
Ambient = 74.14*F       Object = 73.17*F

Ambient = 23.43*C       Object = 23.97*C
Ambient = 74.17*F       Object = 75.15*F

Ambient = 23.45*C       Object = 29.35*C
Ambient = 74.21*F       Object = 84.83*F

Ambient = 23.45*C       Object = 30.91*C
Ambient = 74.21*F       Object = 87.64*F

Ambient = 23.45*C       Object = 25.01*C
Ambient = 74.21*F       Object = 77.02*F

Ambient = 23.45*C       Object = 22.87*C
Ambient = 74.21*F       Object = 73.06*F

Ambient = 23.45*C       Object = 22.69*C
Ambient = 74.21*F       Object = 72.84*F```
1 Like

Please tell me the solution,I'M also Facing Same Problem with mlx90614

Hi xcode,
So my problem ended up being that I applied 5v to a 3.3v sensor, and probably cooked it. I bought new ones and kept it to 3.3v; that worked with the example code.

I'm working with 3.3v but still show no i2c found, i have tried 5 mlx90614 modules

Offbrand Uno? Sounds like its the board not the module if all 5 don't work