MLX 90614 Contactless Infrared Temperature Sensor
Disclosure: Some of the links below are affiliate links and we only earn a small commission if you purchase through our links at no additional cost to you. The earning mainly used for maintaining the website.
One of the easiest ways to measure temperature is to place a thermometer close to an object. And this requires some physical contact with that object.
Forget about physical contact to measure the temperature. A Contactless Infrared temperature sensor, the MLX90614, can measure the temperature without even touching the object.
This tutorial covers the basics of the MLX90614 interface with Arduino to read the temperature in Degree Celsius and Fahrenheit.
Working Principle of Infrared Temperature Sensor
According to Stefan-Boltzmann law, the infrared radiation from the black body per unit surface area is directly proportional to the power of four of the black body’s temperatures.
So, what this sensor does. There are an IR-sensitive thermopile detector and a signal-conditioning chip that converts infrared energy into electrical energy.
MLX90614 Tutorial Starter Pack
- Arduino Uno/Mega/Nano
- MLX90614
- Breadboard
- Jumper Wires
Wiring MLX90614 Module to Arduino
Before making any wiring, make sure to check your MLX90614 sensor model. I am using the “BAA” option code.
As can see from the “BAA” model, the safe supply voltage is around 3.6V. The module does have a 5V regulator, but I have burned the module when connected to 5V from the Arduino.
The wiring is easy and only has four pins to connect.
Vin | 3.3V |
GND | Ground |
SCL | SCL/A5 |
SDA | SDA/A4 |
Arduino Program For MLX90614
Interfacing with Arduino is easy and has no complexity here. First, download and include libraries for MLX90614. Second, write the codes. You have made it. Sound too simple? That simple.
#include <Wire.h>
#include <Adafruit_MLX90614>
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup() {
Serial.begin(9600);
mlx.begin();
}
void loop() {
Serial.print("Ambient = ");
Serial.print(mlx.readAmbientTempF());
Serial.print("*F ");
Serial.print("*Object = ");
Serial.print(mlx.readObjectTempF());
Serial.print("*F\t");
Serial.print("Ambient = ");
Serial.print(mlx.readAmbientTempC());
Serial.print("*C ");
Serial.print("*Object = ");
Serial.print(mlx.readObjectTempC());
Serial.println("*C");
delay(250);
}
Libraries for Programming MLX90614
#include <Adafruit_MLX90614>
<Wire.h>: Allows communication with I2C/TWI devices.
Adafruit_MLX90614.h>: Library for MLX90614 to work with Arduino.
Declare Variables
Create “mlx” as an object of class “Adafruit_MLX90614”. Any name will do, not necessary to be “mlx”. Pass object “mlx” as an argument to function “Adafruit_MLX90614”.
Void setup()
Codes will run once here.
Start communication at desired speed (baud – data rate in bits per second). So that Arduino can send data to computer at Serial Monitor.
Initialize MLX90614 sensor.
Void loop()
Codes will run repeatedly here.
Temperature in Degree Celsius
To read ambient temperature in degree Celsius.
To read object temperature in degree Celsius.
Temperature in Degree Fahrenheit
To read ambient temperature in degree Fahrenheit.
To read object temperature in degree Fahrenheit.
Nay! We Love Videos
Bye Bye
We have covered up reading temperature in Degree Celsius (“mlx.readAmbientTempC()” and “mlx.readObjectTemC()”) and Fahrenheit (“mlx.readAmbientTempF()” and “mlx.readObjectTemF()”) using the MLX90614 contactless infrared temperature sensor.
Hope you find this tutorial helpful in your projects. Subscribe to our newsletter for more tutorials.