Hello,

I am working with MLX90621 sensor. I have adapted the code from MAXBOT because the I2C library doesn't work to me. The sensor is powered by 2.6v, has a 100nF decoupling capacitor and 4k7 pull-up resistors.

I am having problems to get the temperature data. I am reading the EEPROM and the RAM of the sensor, however, I am not able to compute all the needed equations.

First of all, I want to calculate the ambient temperature but the result is always bad.

When I calculate Kt2, the value is very very small, so his result is always Kt2=0.

Has someone an Arduino code for MLX90621 that works with the standard Arduino Wire library?

My code is attached in the post.

An example of the information I get with this code is:

`Reading EEPPROM...`

[0] 167 125 39 32 0 128 0 0 255 192 0 128 100 190 38 96 23 106 255 255 255 62 70 79 166 48 11 159 4 34 0 124

[32] 5 8 4 233 165 79 86 0 5 4 16 15 7 23 27 10 11 11 23 16 24 20 6 8 17 13 16 11 15 14 11 11

[64] 15 21 26 18 16 13 14 24 19 12 12 22 17 27 13 27 23 16 18 25 16 29 22 30 16 8 20 30 10 25 16 15

[96] 188 192 196 192 188 188 192 192 192 192 192 192 196 192 201 196 196 196 196 188 196 196 201 188 196 201 192 192 201 201 196 179

[128] 201 196 196 192 196 196 196 196 201 196 201 201 201 201 205 196 201 205 196 209 201 201 201 209 196 201 205 205 183 192 192 201

[160] 11 30 35 12 31 60 55 34 56 84 80 55 74 100 103 77 79 116 109 92 85 131 123 102 92 133 129 107 98 139 144 112

[192] 101 139 139 120 98 142 141 118 92 133 137 116 81 115 131 114 60 115 122 94 46 85 97 72 17 66 66 53 0 34 42 25

[224] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 170 255 167 255 139 165 255 171 143 10 0 7 28 101 213 84 107 95

Writing Trimming Value... Success.

Setting configuration... Success.

Reading Configuration... Success. Success. Configuration:00

Resolution: 0

Reading PTAT... Success. Success. PTAT:26047

Reading IRsensor:

[0] -49 -52 -52 -50 -51 -49 -50 -49 -49 -49 -50 -49 -49 -49 -49 -52

[1] -48 -50 -49 -49 -49 -49 -50 -50 -50 -51 -50 -48 -49 -47 -49 -48

[2] -47 -48 -47 -46 -47 -49 -47 -49 -47 -49 -49 -48 -47 -46 -46 -48

[3] -47 -46 -46 -48 -49 -51 -50 -50 -49 -48 -47 -48 -44 -42 -42 -46 Success.

k_t1_scale :7

k_t2_scale :20

v_th :1704.25

k_t1 :8.50

Ambient: 2385.46

Reading CPIX... Success. Success. CPIX:-49

Temperatures:

nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan

nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan,nan

inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf

inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf,inf