Go Down

Topic: MLX90620 / MLX90621 - 16X4 pixel IR thermal array (Read 47836 times) previous topic - next topic

sbanisetty

Hello everyone,
Can someone help with with maxbot's mlx90621 code. It has two files one is a header file and the other is a source file. So, is it that we need to write an arduino sketch calling the functions of the source file? 

riodda

Anybody has information about MLX90621ESF avilability in small quantyties? thanks

I've found on this shop small quantities for MLX90621

http://www.as-electronic.net/shop/article_MLX90621ESF-BAA-000/MLX90621ESF-BAA-000-16x4-IR-Matrix-Temperatursensor-120%C2%B0-x-30%C2%B0-FOV.html?sessid=aDYjOkv3vj8RQBv95gmQfmkBiwBM2pVDfgi87oGcyUegrkAlWmTo5huPC4mclTH7&shop_param=cid%3D64%26aid%3DMLX90621ESF-BAA-000%26

Thanks.

BobMoore18

This is a very interesting sensor will be ordering soon. This opens arduino users to a wide variety of cool applications.

jim_bro

#63
Apr 23, 2015, 12:21 am Last Edit: Apr 23, 2015, 12:24 am by jim_bro
Hi as part of my Masters Thesis I used the MLX90620 sensors to do some indoor location positioning

I ended up merging the calculator and processing code originally shared Nathan Seidl, Max Bot & IlBaboomba and changing the output to JSON.

@sbanisetty yes you need to include the header file. If you look at the link below you should hopefully be able to see how you need to do this.

The code along with the library sources I needed to make it work (I originally had some issues reading from the sensor and ended up using the i2cMaster headers) is available on Git Hub along with the python I used plus some test harnesses etc.

https://github.com/tS7hKamAYL84j91/Infrared-IPS/tree/master/location_sensors/sensor_hardware

I summarised the processing done by the sketches & the theory behind the sensors in my thesis if you were interested in how they work (around page 39)


Hope you find the info useful when starting off using the sensors, I had lots of fun with them

Jim






barmygorilla

Hi,

I am using the code for MLX90621 but I am getting stuck at sending I2C start command with the EEPROM address (0x90).

I have changed my code to write the configuration first with the default configuration to 0x14 instead of 0x74 as the configuration register are different between the MLX90621 and MLX90620. To access EEPROM, the EEPROM enable need to be set in the config settings. Ta refresh rate and running flag are not applicable to the MLX90621. I am confused how the code given in this thread works for the MLX90621 if the datasheet says differently. For example the address for PTAT and compensation pixel are 0x40 and 0x41 not 0x90 and 0x91.

Anyway just pointing out the differences between the sensor and hoping can point me to the right direction in why I get stuck in I2C start command.

Paul

barmygorilla

Hi,

I am using the code for MLX90621 but I am getting stuck at sending I2C start command with the EEPROM address (0x90).

I have changed my code to write the configuration first with the default configuration to 0x14 instead of 0x74 as the configuration register are different between the MLX90621 and MLX90620. To access EEPROM, the EEPROM enable need to be set in the config settings. Ta refresh rate and running flag are not applicable to the MLX90621. I am confused how the code given in this thread works for the MLX90621 if the datasheet says differently. For example the address for PTAT and compensation pixel are 0x40 and 0x41 not 0x90 and 0x91.

Anyway just pointing out the differences between the sensor and hoping can point me to the right direction in why I get stuck in I2C start command.

Paul
Ok, I need to change my supply voltage to 2.6V and possibly add decoupling cap to rule it out.

vellamy

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:

Code: [Select]
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



robinvanemden

#67
Jul 04, 2015, 06:20 pm Last Edit: Jul 04, 2015, 11:38 pm by robinvanemden
Hi all,

I used Maxbot's MLX90621 library in a small test project.

The library seems to work quite well, values change as expected, you can "see" warm objects move through the field of view -  yet the calibration of the MLX90621 seems off. To be specific, the absolute temp values do not seem to reflect real life temperatures.

See here for a screenshot of the values I encounter, as visualized in a Processing sketch.

The code below is a simple application of Maxbot's library to obtain MLX90621 temperature values, in a default setup with a Teensy 3.1:

Code: [Select]
/*
* Interfacing the Melexis 90621 Sensor from a Teensy 3.1++
* Uses the 2c_t3 library for communication with the sensor
* 2013 by Felix Bonowski
* Based on a forum post by maxbot: http://forum.arduino.cc/index.php/topic,126244.msg949212.html#msg949212
* This code is in the public domain.
*
* Connection Instructions:
* Connect the Anode of a Silicon Diode to 3V Pin of Teensy. The Diode will drop ~0.7V, so the Cathode will be at ~2.7V. These 2.7V will be the supply voltage "VDD" for the sensor.
* Plug in the USB and measure the supply voltage with a multimeter! - it should be somewhere between 2.5V and 2.75V, else it will fry your precious sensor...
* ...disconnect USB again...
* Connect Teensy Pin 18 to 2.7V with a 4.7kOhm Resistor (Pullup)
* Connect Teensy Pin 19 to 2.7V with a 4.7kOhm Resistor (Pullup)
* Connect Teensy Pin 18 to I2C Data (SDA) Pin of Sensor
* Connect Teensy Pin 19 to I2C clock (SCL) Pin of Sensor
* Connect GND and 2.7V with a 100nF ceramic Capacitor.
* Connect the VSS Pin of the Sensor to GND.
* Connect the VDD Pin of the Sensor to 2.7V

*---> You are ready to go!
*/

#include <Arduino.h>
#include <i2c_t3.h>
#include "MLX90621.h"

MLX90621 sensor; // create an instance of the Sensor class

void setup(){
  Serial.begin(115200);
  Serial.println("trying to initialize sensor...");
  sensor.initialise (16); // start the thermo cam with 16 frames per second
  Serial.println("sensor initialized!");
}
void loop(){
  sensor.measure(); //get new readings from the sensor
  for(int y=0;y<4;y++){ //go through all the rows
    Serial.print("[");
    for(int x=0;x<16;x++){ //go through all the columns
      double tempAtXY= sensor.getTemperature(y+x*4); // extract the temperature at position x/y
      Serial.print(tempAtXY);     
      if (x<15) Serial.print(",");
    }
    Serial.print("]");
    if (y<3)Serial.print("~");
  }
  Serial.print("\n");
  delay(10);
};


I went through Maxbot's code to see if I could find what might cause the calibration problem, but as far as I can establish the code does exactly what is supposed to do - still, I wondered if anyone might have a suggestion as to how to obtain well calibrated temperature values.

I will make both the basic Arduino and Processing script available on GitHub soon!



Go Up