GY-906 MLX90614 infrared temperature sensor not working with Arduino Mega 2560

Hi, I'm trying to connect a "GY-906 MLX90614 infrared temperature sensor" to my Mega2560 (original board), and it's not working.

At first it worked, but then it stopped working all of the sudden.

Am I doing something wrong here? Do I need pull up resistors on the SDA/SCL lines or something like that?


#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {

  Serial.begin(9600);
  while (!Serial);

  Serial.println("Adafruit MLX90614 test");

  while (!mlx.begin()) {
    Serial.println("Error connecting to MLX sensor. Check wiring.");
    while(1);
  };

  Serial.print("Emissivity = "); Serial.println(mlx.readEmissivity());
  Serial.println("================================================");


}

void loop() {

  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.println();

  delay(500);

}




It works if I connect the external metalic case to GND like this

image

:exploding_head:

Hi, @brunoaduarte

Check, I think that module will work on 5V, you have 3V3 .

To add code please click this link;

You could try 4K7 pullups on the I2C wires.

Check the quality of solder connections on the module.

Thanks... Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Thanks for the reply Tom :pray:

Unfortunately the pull up resistors had no effect.

Also I've just resoldered all the module connections and the error persists.

The only solution was to connect the external metalic case to GND as in my last post.

Breadboards and jumper wires are not very reliable.
Try replacing the jumper wires first.
Leo..

1 Like

Hi,
Yes the case of the sensor looks like it should be connected to gnd, for shielding the low current device inside from EMC as well as supply.
Note the sensor is a 5V device if it is an A device.
MLX90614_rev001.pdf (1.2 MB)


It looks like faulty connection somewhere.
As @Wawa suggests, check your jumper wires, specifically the one connecting gnd.

Tom.. :smiley: :+1: :coffee: :australia:

1 Like

That indicates a bad solder job on the device Vss pin or the header pin.

1 Like

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