Non Contact Temperature Sensor MLX90614 With Arduino Tutorial

miliohm
26 Januari 2020 14:22
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

One of solution to build sensor system that can measure high temperature without damage the system is using contactless or non-contact temperature sensor. This sensor can sense temperature of an object without touch the object.
Mlx90614 is a infrared based sensor, it measure the temperature based on infrared emitted by an object. It senses electromagnetic waves in the range about 700 nm to 14,000 nm.

Mlx90614 is a great cheap sensor that cost under 10$.

Sensor Spesification

These are some good feature of this sensor taken from it’s datasheet.

  • Small size, low cost
  • Factory calibrated in wide temperature range:
    40 to 125 °C for sensor temperature and
    70 to 380 °C for object temperature.
  • High accuracy of 0.5°C over wide temperature
    range (0..+50°C for both Ta and To)
  • Measurement resolution of 0.02°C
  • Available in 3V and 5V versions

Wiring Diagram

Vin -> 3.3V
GND -> GND
SCL -> SCL or A5
SDA -> SDA or A4

You can choose to connect sensor I²C pin to arduino SCL, SDA or arduino pin A4,A5 they have the same function. Make sure use 3.3V for 3.3V module type. Because it will damage if connected to 5V. I damaged mine twice.

MLX90614 With Arduino Code

Before you start the code, make sure you have the library. Download library from adafruit here.

You can get the sample code to measure temperature using the library sample or copy code below :

/*************************************************** 
  This is a library example for the MLX90614 Temp Sensor
  Designed specifically to work with the MLX90614 sensors in the
  adafruit shop
  ----> https://www.adafruit.com/products/1748
  ----> https://www.adafruit.com/products/1749
  These sensors use I2C to communicate, 2 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!
  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/
#include <Wire.h>
#include <Adafruit_MLX90614.h>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
  Serial.begin(9600);
  Serial.println("Adafruit MLX90614 test");  
  mlx.begin();  
}
void loop() {
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 
  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF()); 
  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");
  Serial.println();
  delay(500);
}

Paste the code above to your arduino IDE and upload. After done uploading, you can test the sensor. It should works now!. You can measure an object temperature by face the sensor toward the object.

If you have any question you can leave comment below.


  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •