Getting nan reading from MLX90614 SENSOR

Hi there
myself Chirayu
and i am a 8th grade student
Tomorrow i have submit the project of thermometer.
for that i have used mlx90614 sensor and arduino uno.
And will show the readings on the serial monitor and

the problem occurs that when i open the serial monitor it show nothing but when i disconnect the sda wire it starts but it doesn’t print the temperature instead writes " nan "

here's the circuit :

and this is the code

#include <Wire.h>

#include <Servo.h>
//#include <AFMotor.h>
//#include <NewPing.h>
#include <Adafruit_MLX90614.h>

Servo servo;
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"); 
}

and here what serial monitor shows

image

so can anyone help me remove this nan and get the temperature
thanks

To start - No I2C 4K7 pullup resistors...?

What does it mean

There are No I2C 4K7 pullup resistors in your drawing.

yes

You need to add them!

Hey man did it work?

If your MLX90614 Sensor is on coming with the blue board under it (like it shows in the fritzing sketch) then you do not need the I2C pullup resistors since they are already implemented underneath the board.
I would check the wiring again if I were you.
If everything checks out, then chances are your sensor has some issues and needs replacing.
Sometimes this NaN reading happens when you have a design and maybe your sensors are under pressure. I experienced that recently in my own design when the casing was too tight and the sensors were reading NaN. The moment I loosen the casing they start reading correct values.

So to recap,
Check your wiring.
Check the performance of the system when you only have the MLX90614 sensor connected to Arduino and out in the open.
Conduct a continuity test to see if all the connections are correct.
If it still doesn't works, change the sensor.

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