Skip to content

[I2C] MLX90614 temp sensor not working over ESP32 I2C interface #2408

Closed
@marquesn

Description

@marquesn

Hardware:

Board: ESP-WROOM-32 (ESP32_DevKitc_V4)
Core Installation version: 1.0.1
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: No
Upload Speed: 921600
Computer OS: Windows 10

Description:

I have been trying to get a MLX90614 IR temperature sensor to work with the ESP32 - this sensor makes use of the I2C interface. However, the values are always reported back as 1037 C and 1899F.

I have been using pins 22 and 21 for SCL and SDA, and have tried supplying the sensor with both 3.3V and 5V. I have also connected 4.7K pull-up resistors to the SDA and SCL lines (also tried 2K7, 10K, and with no pull-ups).

I am using the "Adafruit_MLX90614" library, and have also tried to use the Sparkfun MLX90614 (although Sparkfun is giving me a compiling error when trying to compile for the ESP32). I have also tried to connect another MLX90614 to the ESP32 on the off chance that one of them might've just been broken, but the results were the same.

I have also seen similar issues to this as in:
#1694
#2089
#1962

Based on the solutions provided in the links shown above, I also tried to update the latest version of the arduino-esp32 using the arduino boards manager to version 1.0.1.

Sketch:

#include <Wire.h>
#include <Adafruit_MLX90614.h>
 
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
 
void setup()
{
  Serial.begin(9600);
  mlx.begin();
}
 
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(1000);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: StaleIssue is stale stage (outdated/stuck)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions