MLX90614 not working properly

while (!Serial);

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

when this code is executed we get the output as ,
Error connecting to MLX sensor. Check wiring."


what to do to get the correct output

Welcome to the forum

Your topic has been moved to the Programming category of the forum as it does not relate to the use of IDE 1.x

Have you done that ?

Please post your full sketch and a schematic of your project. A photo of a hand drawn circuit is good enough

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
  Serial.begin(9600);
  while (!Serial);

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

void loop() {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF());
  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();
  delay(500);
}

When starting out with a new device and library, always make sure that one or more of the library examples work.

If that doesn't work, and the device uses I2C, run the Arduino I2C address scanner program to verify I2C communications.

Hello aishwaryabauraja

Take a view to gain the knowledge:

Easier to read

I2C requires pullup resistors. I'm missing these in your schematic. Usually these are provided on the breakout board.

Please check if you have pullup resistors and provide a good photo of your circuit.

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