Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Adafruit MLX90640 no temperature output
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit MLX90640 no temperature output

by robieber on Tue Jun 30, 2020 1:37 am

Hello,

I bought an Adafruit MLX90640 a fe weeks back here in the Philippines, it was normally operational/running- providing setup info as well as temperature info, I am testing it using the MLX90640_simpletest arduino code.

Now it does not provide temperature readings. Thanks and hope you can help.

this is the output of the serial monitor:

load:0x40080400,len:6352
entry 0x400806b8
Adafruit MLX90640 Simple Test
Outlier pixels: 5
Found Adafruit MLX90640
Serial number: 32288A26187
Current mode: Chess
Current resolution: 18 bit
Current frame rate: 4 Hz


Here is the simpletest code:
Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_MLX90640.h>

Adafruit_MLX90640 mlx;
float frame[32*24]; // buffer for full frame of temperatures

// uncomment *one* of the below
//#define PRINT_TEMPERATURES
#define PRINT_ASCIIART

void setup() {
  while (!Serial) delay(10);
  Serial.begin(115200);
  delay(100);

  Serial.println("Adafruit MLX90640 Simple Test");
  if (! mlx.begin(MLX90640_I2CADDR_DEFAULT, &Wire)) {
    Serial.println("MLX90640 not found!");
    while (1) delay(10);
  }
  Serial.println("Found Adafruit MLX90640");

  Serial.print("Serial number: ");
  Serial.print(mlx.serialNumber[0], HEX);
  Serial.print(mlx.serialNumber[1], HEX);
  Serial.println(mlx.serialNumber[2], HEX);
 
  //mlx.setMode(MLX90640_INTERLEAVED);
  mlx.setMode(MLX90640_CHESS);
  Serial.print("Current mode: ");
  if (mlx.getMode() == MLX90640_CHESS) {
    Serial.println("Chess");
  } else {
    Serial.println("Interleave");   
  }

  mlx.setResolution(MLX90640_ADC_18BIT);
  Serial.print("Current resolution: ");
  mlx90640_resolution_t res = mlx.getResolution();
  switch (res) {
    case MLX90640_ADC_16BIT: Serial.println("16 bit"); break;
    case MLX90640_ADC_17BIT: Serial.println("17 bit"); break;
    case MLX90640_ADC_18BIT: Serial.println("18 bit"); break;
    case MLX90640_ADC_19BIT: Serial.println("19 bit"); break;
  }

  mlx.setRefreshRate(MLX90640_4_HZ);
  Serial.print("Current frame rate: ");
  mlx90640_refreshrate_t rate = mlx.getRefreshRate();
  switch (rate) {
    case MLX90640_0_5_HZ: Serial.println("0.5 Hz"); break;
    case MLX90640_1_HZ: Serial.println("1 Hz"); break;
    case MLX90640_2_HZ: Serial.println("2 Hz"); break;
    case MLX90640_4_HZ: Serial.println("4 Hz"); break;
    case MLX90640_8_HZ: Serial.println("8 Hz"); break;
    case MLX90640_16_HZ: Serial.println("16 Hz"); break;
    case MLX90640_32_HZ: Serial.println("32 Hz"); break;
    case MLX90640_64_HZ: Serial.println("64 Hz"); break;
  }
}

void loop() {
  delay(500);
  if (mlx.getFrame(frame) != 0) {
    Serial.println("Failed");
    return;
  }
  Serial.println();
  Serial.println();
  for (uint8_t h=0; h<24; h++) {
    for (uint8_t w=0; w<32; w++) {
      float t = frame[h*32 + w];
#ifdef PRINT_TEMPERATURES
      Serial.print(t, 1);
      Serial.print(", ");
#endif
#ifdef PRINT_ASCIIART
      char c = '&';
      if (t < 20) c = ' ';
      else if (t < 23) c = '.';
      else if (t < 25) c = '-';
      else if (t < 27) c = '*';
      else if (t < 29) c = '+';
      else if (t < 31) c = 'x';
      else if (t < 33) c = '%';
      else if (t < 35) c = '#';
      else if (t < 37) c = 'X';
      Serial.print(c);
#endif
    }
    Serial.println();
  }
}

robieber
 
Posts: 2
Joined: Mon Jun 29, 2020 10:56 pm

Re: Adafruit MLX90640 no temperature output

by adafruit_support_carter on Wed Jul 01, 2020 3:20 pm

Try adding a new print statement in the loop and see if you can see that:
Code: Select all | TOGGLE FULL SIZE
void loop() {
  Serial.println("Getting Frame Data...");
  delay(500);

adafruit_support_carter
 
Posts: 15963
Joined: Tue Nov 29, 2016 2:45 pm

Re: Adafruit MLX90640 no temperature output

by robieber on Thu Jul 02, 2020 11:43 pm

Hello,

Here is the output:
Adafruit MLX90640 Simple Test
Outlier pixels: 5
Found Adafruit MLX90640
Serial number: 32288A26187
Current mode: Chess
Current resolution: 18 bit
Current frame rate: 2 Hz
Getting Frame Data...


I also added Serial.println(mlx.getFrame(frame)); after the delay(500), there is no output, execution stops there. I seems to hang on getFrame function.

Thanks.

Robi

robieber
 
Posts: 2
Joined: Mon Jun 29, 2020 10:56 pm

Please be positive and constructive with your questions and comments.