-
Notifications
You must be signed in to change notification settings - Fork 99
MLX90614 reports large negative values (ie -178 celsius) after setting emissivity #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
By change, do you mean just change emissivity? |
Oops! I meant: Set the emissivity value (to the SAME or DIFFERENT) value. Both of these actions can produce the error. |
Just ran this: #include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
Serial.begin(9600);
while(!Serial);
Serial.println("Adafruit MLX90614 test");
if (!mlx.begin()) {
Serial.println("Error connecting to MLX sensor. Check wiring.");
while (1);
};
Serial.println("Emissivity = default");
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
Serial.println("Emissivity = 0.8");
mlx.writeEmissivity(0.8);
Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC());
Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
}
void loop() {
} Can you provide a simple example sketch that demonstrates the issue? |
Sure thing. Here is a .ino file that's based on the plain adafruit library. The difference is that we set the emissivity several times. Characteristics
Output that I get: |
Thanks for the example. I'm seeing the same thing. Is there a reason you need to continuously change the emissivity like that? |
Ha ha not at all. I only want to change the emissivity on occasion and when I do, it can cause the error with just one change. In my engineering application, I need the device to boot, set emissivity, and log data. Since I can't trust the data to be clean after a given emissivity change, I can't deploy the device yet. Additional Clue for Root CauseDoes the library perform the writing of 0's to the emissivity register as instructed in the datasheet? |
Checkout this app note: EEPROM is persistent memory, so the value will remain with each power cycle. Per that app note, you also need to reset after setting for the new value to take effect. So it doesn't seem like you can change this value dynamically. But this should be OK for your application. Make a sketch that sets the emissivity to the value you want and nothing else. Then power cycle and change to your real application to use the new value. |
Is it possible to "restart" the module using a function in the library? Is a full power cycle necessary? With the MLX tied to 3.3v and GND of my microcontroller, I don't think I could power cycle unless I unplug the whole MCU. |
Thank you for these suggestions. Thanks even more for your attention and fast responses. For an immediate countermeasure, I am tying the MLX90614 GND pin to a digital output pin D4 on my MCU. After writing the emissivity, I raise D4 high, wait 50ms, and lower D4 again. This appears to be working so far. If there is no further action to be taken I can close the issue. |
Closing. Seems resolved. |
Hi all, I'm having the same problem but setting the 0x04 register to 0 doesn't work for me. Also I saw that it is already done inside the MLX SetEmissivity function. How can I solve it? |
Error of Large Negative Temperatures
This issue takes place using either library (adafruit or sparkfun) and has details posted in the issue below.
The basic behavior:
The text was updated successfully, but these errors were encountered: