Infrared Thermometer – MLX90614 Interfacing with Arduino

ABOUT THE SENSOR

Infrared Thermometer - MLX90614

Description: Melexis’ MLX90614ESF-BAA is an infrared thermometer designed for non-contact temperature sensing. An internal 17-bit ADC and a powerful DSP contribute to the MLX90614’s high accuracy and resolution. It has a huge number of applications including body temperature measurement and movement detection.

The MLX90614 provides two methods of output: PWM and SMBus (i.e. TWI, I2C). The 10-bit PWM output provides a resolution of 0.14°C, while the TWI interface has a resolution of 0.02°C. The MLX90614 is factory calibrated in wide temperature ranges: -40 to 85°C for the ambient temperature and -70 to 382.2°C for the object temperature. The measured value is the average temperature of all objects in the Field Of View of the sensor. The MLX90614 offers a standard accuracy of 0.5°C around room temperatures.

This device comes in an industry standard TO-39 package. We’re carrying the 3V version of this sensor.

Features:

  • Small size, low cost
  • Easy to integrate
  • Factory calibrated in wide temperature range:
    • -40 to +85°C for sensor temperature
    • -70 to +380°C for object temperature
  • SMBus compatible digital interface
  • Customizable PWM output for continuous reading
  • High accuracy of 0.5°C over wide temperature range (0 to +50°C for both Ta and To)
  • Measurement resolution of 0.02°C
  • Single and dual zone versions
  • Simple adaptation for 8 to 16V applications
  • Power saving mode
  • Different package options for applications and measurements versatility
  • Automotive grade

SparkFun IR Thermometer Evaluation Board - MLX90614

Documents:

imageedit_1_7493397999

file-pdf-icon

DATASHEET OF

Infrared Thermometer – MLX90614

 DataSheet

(clickable image)

PIN CONFIGURATION

SOFTWARE REQUIRED

ARDUINO IDE (for windows)

SCHEMATICS

mlx90614_arduinoI2C circuit

ARDUINO SOURCE CODE

arduino-icon-2

  • /* Melexis MLX90614 infrared non contact temperature sensor
     *
     * connect MLX90614 pin 1 SCL to Arduino pin analog 5
     * connect MLX90614 pin 2 SDA to Arduino pin analog 4
     * connect MLX90614 pin 3 Vdd to Arduino pin +5V
     * connect MLX90614 pin 4 Vss to Arduino pin GND
     solder 100n capacitor between Vdd and Vss
    
     * KHM 2010 /  Martin Nawrath
     * Kunsthochschule fuer Medien Koeln
     * Academy of Media Arts Cologne
     */
    
    #include <i2cmaster.h>
    
    char st1[30];
    
    void setup()
    {
      Serial.begin(115200);
      Serial.println("Melexis MLX90614 temperature Sensor");
    
      PORTC = (1 << PORTC4) | (1 << PORTC5);  //enable internal pullup resistors on i2c ports
    
    }
    void loop()
    {
    
      long int tpl;
    
      tpl=readMLXtemperature(0); // read sensor object temperature
      tpl = tpl *10;
      tpl = tpl / 5;
      tpl=tpl-27315;
      sprintf(st1,"object temp: %03li.%li",tpl/100, abs(tpl %100) );
      Serial.print(st1);
      Serial.print("   ");
    
      tpl=readMLXtemperature(1); // read sensor ambient temperature
      tpl = tpl *10;
      tpl = tpl / 5;
      tpl=tpl-27315;
      sprintf(st1,"ambient temp: %03li.%li",tpl/100, tpl %100 );
      Serial.print(st1);
      Serial.print("   ");
      Serial.println("");
      delay(100);
    
    }
    //****************************************************************
    // read MLX90614 i2c ambient or object temperature
    long int readMLXtemperature(int TaTo) {
        long int lii;
        int dlsb,dmsb,pec;
        int dev = 0x5A<<1;
    
      i2c_init();
      i2c_start_wait(dev+I2C_WRITE);  // set device address and write mode
      if (TaTo) i2c_write(0x06); else i2c_write(0x07);                // or command read object or ambient temperature
    
      i2c_rep_start(dev+I2C_READ);    // set device address and read mode
      dlsb = i2c_readAck();       // read data lsb
      dmsb = i2c_readAck();      // read data msb
      pec = i2c_readNak();
      i2c_stop();
    
      lii=dmsb*0x100+dlsb;
      return(lii);
    }

 GITHUB LIBRARY LINK

 

HAPPY INTERFACING:)

SHUBHAM GUPTA-TECEX

2 Comments Add yours

  1. brar saab says:

    awesome bro hppy interfacing

    Liked by 1 person

    1. TECEX Inc. says:

      Thank you @brar Saab
      We appreciate your consideration

      Like

Leave a comment