Open luigi-grim opened 3 years ago
Hi,
I tried the driver on several random MLX90640 devices and it is working. I also used the EEPROM and the frame data that you provided to feed it in the driver functions and check the outcome. I also did manual calculations as described in the datasheet. Both the manual calculations and the driver agree that based on that input data the temperatures should be:
Vdd = 3.305 Ta = 25.431 To = 28.763,28.694,28.991,28.945,28.804,28.724,28.632,28.502,28.323,27.966,27.542,26.696,23.479,22.934,22.378,22.758,22.697,22.404,22.676,23.043,22.640,22.874,23.113,23.062,23.201,23.211,23.235,23.437,23.614,23.597,23.598,24.736,28.719,28.244,29.382,28.696,28.575,28.522,28.642,28.664,28.472,28.138,26.866,26.346,22.657,22.649,22.475,22.636,22.402,22.477,22.782,22.540,22.720,22.584,22.622,22.914,22.880,22.889,23.332,23.049,23.685,23.680,24.214,24.496,28.863,28.706,28.944,28.961,28.197,28.197,28.814,28.449,28.186,28.001,26.274,24.932,22.699,22.388,22.352,22.713,22.721,22.433,22.277,22.817,22.775,22.825,22.878,22.870,23.359,23.132,23.181,22.966,23.482,23.265,23.715,24.044,28.414,28.705,28.765,28.734,28.712,28.730,28.984,28.761,28.181,28.007,25.304,23.579,22.407,22.451,22.773,22.582,22.605,22.651,22.195,22.687,22.661,22.534,22.767,23.090,23.022,22.794,23.059,23.016,23.526,23.555,23.811,23.591,28.701,28.557,28.447,28.246,28.642,28.207,28.371,28.538,27.768,27.612,23.367,22.928,22.520,22.493,22.427,22.691,22.626,22.592,22.419,22.445,22.892,22.557,22.291,22.801,22.903,23.073,22.713,23.328,22.978,23.201,24.058,24.122,28.478,28.562,28.811,28.600,28.284,28.553,28.733,28.536,27.600,26.636,23.108,22.472,22.401,22.205,22.193,22.579,22.359,22.476,22.507,22.831,22.929,22.435,22.544,22.310,22.762,22.941,22.800,22.978,23.466,23.695,23.663,23.912,28.713,28.585,28.338,28.873,28.203,28.322,27.948,28.116,26.895,25.110,22.487,22.523,22.922,22.380,22.362,22.694,22.097,22.263,22.678,22.843,22.661,22.460,22.544,22.866,22.792,22.820,22.844,23.394,23.466,23.458,23.437,23.745,28.535,28.419,28.546,28.335,28.214,28.005,28.472,28.119,26.109,24.168,22.238,22.237,22.656,22.449,22.456,22.422,22.295,22.470,22.583,22.553,22.889,22.533,22.452,22.732,22.493,22.708,22.932,23.241,23.317,22.901,24.167,23.781,28.430,28.355,28.265,28.609,28.620,28.438,28.022,27.722,24.144,22.684,22.054,22.449,22.497,22.340,22.599,22.637,22.593,22.340,22.264,22.595,22.525,22.376,22.121,22.765,22.690,23.076,22.533,23.241,23.128,23.320,23.286,23.571,28.620,28.385,28.468,28.451,28.313,28.311,28.058,27.407,23.388,22.428,22.444,22.643,22.540,22.218,22.502,22.345,22.325,22.245,22.358,22.627,22.575,22.589,22.352,22.627,22.732,22.605,23.159,23.103,23.172,23.165,23.567,23.821,28.019,28.140,28.070,28.558,27.806,27.919,27.062,26.099,22.606,22.228,21.952,22.461,22.171,22.220,22.177,22.204,22.165,22.037,22.764,22.610,22.434,22.457,22.486,23.021,22.923,22.584,22.975,23.518,23.157,22.795,23.112,23.812,28.224,28.191,28.117,28.235,28.164,27.632,26.629,24.986,22.334,22.596,22.352,22.501,22.528,22.579,22.089,22.395,22.523,22.407,22.525,22.803,22.480,22.351,22.560,22.714,22.805,22.302,22.857,22.824,23.009,23.230,23.400,23.631,28.174,28.125,28.069,28.371,27.901,27.425,25.442,23.964,22.419,22.462,21.962,22.685,22.384,22.255,22.361,22.386,22.361,22.386,22.142,22.506,22.261,22.306,22.817,22.986,22.922,22.608,23.137,22.791,23.010,22.817,23.349,23.581,27.867,28.200,28.121,28.227,27.450,27.474,24.685,23.168,22.299,22.360,22.514,22.412,22.421,22.301,22.416,22.410,22.548,22.107,22.691,22.557,22.466,22.513,22.880,23.013,22.784,22.650,23.017,23.176,23.243,23.062,23.841,23.824,28.026,27.769,28.220,28.072,26.962,26.776,23.172,22.646,22.319,22.275,22.312,22.466,22.220,22.446,22.194,22.564,22.367,22.371,22.276,22.495,22.283,22.586,22.665,22.641,22.908,22.793,23.319,22.963,23.168,23.008,23.560,24.010,27.716,27.849,28.108,28.276,26.666,26.170,22.920,22.521,22.363,22.332,22.531,22.663,22.401,22.186,22.428,22.920,22.725,22.413,22.657,22.532,22.641,22.954,23.054,22.838,22.774,22.501,23.008,23.167,23.006,23.246,24.067,23.832,27.901,27.643,27.752,27.743,25.967,24.961,22.612,22.481,22.556,22.605,22.746,22.509,22.358,22.528,22.478,22.531,22.638,22.511,22.306,22.802,22.911,22.566,22.637,22.857,22.772,22.918,23.114,23.281,23.758,23.309,23.736,23.978,27.959,27.892,27.814,27.431,25.846,24.035,22.856,22.353,22.597,22.654,22.644,22.863,22.235,22.108,22.402,22.262,22.529,22.556,22.693,22.359,22.631,22.624,22.711,22.727,22.825,22.997,23.175,23.115,23.013,23.558,23.801,23.801,28.139,27.850,27.822,27.250,24.613,23.228,22.802,22.609,22.346,22.350,22.686,22.731,22.307,22.347,22.612,22.670,22.804,22.329,22.407,22.579,22.723,22.852,22.765,22.945,22.854,22.520,23.791,23.226,23.282,23.264,23.477,24.401,28.210,27.583,27.372,26.780,23.963,23.118,22.514,23.158,22.395,22.230,22.423,22.754,22.357,22.398,22.675,22.701,22.675,22.528,22.444,22.768,22.775,22.923,23.010,22.823,22.893,23.121,23.287,23.054,23.516,23.321,24.232,23.977,27.693,27.800,26.984,26.231,23.041,22.662,22.596,22.726,22.617,22.666,22.449,22.975,22.891,22.537,22.708,22.715,22.589,22.190,22.845,22.795,22.841,22.496,23.241,23.040,22.944,23.288,23.740,23.550,23.843,23.623,24.348,24.370,27.774,27.905,26.895,26.111,22.560,22.545,22.839,22.416,22.521,22.416,22.853,22.343,22.605,22.608,22.612,22.919,22.314,22.579,22.918,23.009,22.910,22.755,22.944,23.597,23.157,23.328,23.803,23.778,23.247,24.107,23.952,24.655,27.779,27.514,26.303,25.118,22.728,22.314,22.401,22.224,22.591,22.379,22.591,22.799,22.652,22.644,22.959,22.642,22.980,22.465,22.762,23.119,23.117,23.083,23.116,23.299,23.441,23.007,24.269,23.917,24.458,23.974,24.530,25.328,27.895,27.461,25.653,24.638,22.801,22.599,22.510,22.485,22.320,22.646,22.538,22.561,22.725,22.233,22.707,22.891,22.536,22.545,22.850,23.181,23.003,22.982,23.029,23.185,23.491,23.475,23.526,23.772,23.657,24.072,24.891,25.171
You mentioned that you started off of the MLX90641 deriver working. Is it possible that you somehow mixed-up the two drivers?
Best regards
Thank you very much for your time, I could focus on libraries since my reading is correct and I realized the T0 computation screws calculation when it starts using kTa and Kv arrays. In fact those arrays doesn't look right at all. I will look better into their calculation, maybe my C dialect makes something wrong, but I have a big doubt: according to the excel file with example values, kTa and kV should be both 0.something, so float, but in the params struct their type is actually int8_t. If I force those data to zero in the T0 calculation the reading is very good, probably with little errors here and there. Any idea why they are int in the params struct instead of float, as the excel example suggest they should be?
HI, indeed the xls file is not valid anymore - since the update for reducing the RAM footprint. You first need to calculate the correct Vdd and Ta values. For the input data you shared Vdd should be 3.305 and Ta should be 24.31. In your case you have error in Vdd (which maybe explains the error in Ta). So I would suggest that you first look into Vdd.
Best regards
Hello. I'm trying to implement the mlx90640 on a CC2538 texas instrument and a Contiki os. I successfully implemented the mlx90641 getting an output like this:
But when i switched on the mlx90640 (of course with new main libraries, while i2c library is almost the same) i'm getting some strange results:
eeprom and frame looks like reasonable values, but after the To conversion only some pixel are getting 22-23 degree that is correct reading, all the other are strongly out of range. I also tried "lookup table method" but i'm getting same results. I have several sensors and several boards, so i already tried to change batteries, board or sensors, but I got same mistakes in same pixels. CC2538 has only 32kB ram but "size" command gives: text data bss dec hex filename 81868 1970 22452 106290 19f32 host.elf So it looks like ok. Any suggestions?