Infrared Temperature Sensor - MLX90614

by Michal Choma in Circuits > Arduino

17925 Views, 15 Favorites, 0 Comments

Infrared Temperature Sensor - MLX90614

mlx90614.jpg
Infrared thermometers work based on a phenomenon called black body
radiation. Anything at a temperature above absolute zero has molecules inside of it moving around. The higher the temperature, the faster the molecules move. As they move, the molecules emit infrared radiation--a type of electromagnetic radiation below the visible spectrum of light. As they get hotter, they emit more infrared, and even start to emit visible light. That is why heated metal can glow red or even white. Infrared thermometers detect and measure this radiation.
From: https://sciencing.com/infrared-thermometers-work-...

For many reasons, sometimes I can't contact my temperature sensor (like DS18b20) with object, which temperature I want measure. I decided to buy this nice contactless temperature sensor - MLX90614, which measure 2 temperatures - ambient temperature and temperature of object on distance.

hh

BOM

BOM.jpg

MLX90614

mlx90614.jpg

Specification:

  • -40°C...+125 °C for ambient temperature
    -70°C...+380 ° C for object temperature.
  • High accuracy of 0.5°C in a wide temperature range (0°C...+50°C for both)
  • Measurement resolution of 0.02°C
  • I2C communication.
  • High (medical) accuracy calibration
  • When measuring the temperature, please maintain a measuring distance of 1 cm!

I think, this is good sensor for sense temperature for hot things, like cooking food or chips on motherboards. Also, it is good for cold, like ice cream. No contact with food make healthily sensing. And still you can use sensor for measure ambient temperature for weather station.

Circuit

circuit.png

Circuit is simple, as sensor use I2C communication.

Connect Vin to 3.3 Volts or 5 Volts.

Connect GND to GND of Arduino.

Connect SDA to A4 on Arduino.

Connect SCL to A5 on Arduino.

Code

Code is simple.

First, you need Adafruit library (mls90614_knihovna.zip). Open library folder, and unzip it.

In setup function, with mlx.begin() you initialized sensor.

In loop function, I use Serial monitor, for read ambient temperature, you use mls.readAmbientTempC()

for Contactless mlx.readObjectTempC().

If you want temperatures in Fahrenheit, just replace "C" with "F":

mls.readAmbientTempF() and mls.readAmbientTempF()

#include <Wire.h>
#include <Adafruit_MLX90614.h>
mlx = Adafruit_MLX90614(); void setup() { Serial.begin(9600); mlx.begin(); } void loop() { Serial.println("Temperature from MLX90614:"); Serial.print("Ambient: "); Serial.print(mlx.readAmbientTempC()); Serial.println(" °C"); Serial.print("Contactless: "); Serial.print(mlx.readObjectTempC()); Serial.println(" °C"); Serial.println(); delay(1000); }

Measure

serial_monitor_ice_cream.png

I try to measure temperature of ice cream. You can see negative values of temperature. Important thing is, measure not too close and not far. Also check, if sensor point to object.