How to design a Non-Contact Infrared Thermometer with MLX90614 IR Temperature Sensor

Prevention is better than cure” is one of the effective measures to prevent the spreading of COVID-19 and to protect mankind. Currently, humans are employed for temperature screening and mask identification in public places to prevent the spread of COVID-19. 

Today in many public places and in other gatherings, it has become common to screen individuals for body temperature, as a preventive measure to check for fever. The device that is used to do this is called a Contactless Infrared Thermometer. So, the objective of this tutorial is to design a Low cost, Easy to build Contactless Thermometer that can measure body temperature,using MLX90614 Infrared Temperature Sensor & Arduino Board. You can display the temperature reading on SSD1306 0.96″ OLED Display. 

In this project we will interface MLX90614 with Arduino Board and use the laser diode to point the sensor to a particular object. The refresh rate and sensitivity of MLX90614 are very high that it can give the reading within a fraction of a second. You can use MLX90614 to measure the temperature of a hot object like machines, flames, hot iron, device CPU. You can even use this sensor for laboratory purposes, i.e. MLX90614 can also be used as an infrared thermometer for measuring the body temperature. Due to COVID-19, the demand for this sensor has increased within the last few months. The MLX90614 Sensor requires some calibration in Arduino Code which we will learn in this post.

MLX90614 Sensor

MLX90614’s is an infrared thermometer designed for non-contact temperature which is perfect for measuring the temperature of moving objects. MLX90614’ offers an internal 17-bit ADC, a low noise amplifier, and a powerful DSP ensuring high accuracy and resolution. This module consists of both the IR sensitive thermopile detector chip and the signal conditioning ASIC integrated into the same TO-39 can. 

This sensor works based on Stefan-Boltzmann law which states that all objects emits IR energy and the intensity of this energy will be directly proportional to the temperature of that object. The sensing unit in the sensor measures how much IR energy is emitted by a targeted object and the computational unit converts it into temperature value using a 17-bit in-built ADC and outputs the data through I2C communication protocol. The sensor measures both the object temperature and ambient temperature to calibrate the object temperature value. 

.The sensor provides a field of view of 35 degrees with a gradient of temperature compensation for short-distance measurement. Thus it provides a sensing range from 4 cm -10 cm approximate. Moreover, the breakout board comes with all of the components needed for operation and two types of pins.


  • Input supply: 3V-5V
  • Input current: 2mA
  • Object Temperature Range: -70°C to 382.2°C
  • Ambient Temperature Range: -40°C to 125°C
  • Resolution/Accuracy: 0.02°C
  • High accuracy of 0.5C over a wide temperature range
  • Small size, low cost.
  • Mounted on a breakout board with two types of pins.
  • 10k pull up resistors for the I2C interface with optional solder jumpers.
  • Easy to integrate
  • Factory calibrated in a wide temperature range
  • Mounted on a breakout board with two types of pins
  • The measurement resolution of 0.02C
  • Single and dual-zone versions
  • SMBus compatible digital interface
  • Customizable PWM output for continuous reading
  • Simple adaptation for 8v to 16V applications
  • Sleep mode for reduced power consumption
  • Different package options for applications and measurements versatility

The MLX90614 thermometer has 4 pins:

  • VIN: power pin. It will depend on the voltage regulator but the normal thing is that you can supply 5V or 3V3.
  • GND: ground pin or 0V.
  • SCL: clock signal pin of the I2C interface.
  • SDA: I2C interface data signal pin.


  • High precision non-contact temperature measurements
  • Thermal Comfort sensor for Mobile Air Conditioning control system
  • The temperature sensing element for residential,
  • commercial and industrial building air conditioning Windshield defogging
  • The automotive blind angle detection
  • Industrial temperature control of moving parts
  • Temperature control in printers and copiers
  • Home appliances with temperature control
  • Livestock monitoring
  • Movement detection
  • Thermal relay/alert
  • Body temperature measurement

0.96 inch OLED display

Organic Light Emitting Diode, or Organic LED, is the abbreviation for Organic Light Emitting Diode. It’s a display technology made up of OLED panels that, when an electric current is sent through them, emit their own light. As a result, OLEDs are extremely light, have a true contrast ratio (that is, their whites are brighter and their blacks are darker than conventional electronic displays), have a wide colour gamut, deep colour saturation, and a wide viewing angle.


  • OLED Driver IC: SSD1306
  • Resolution: 128 x 64
  • Visual Angle: >160°
  • Display Color: Area Color (White)
  • Input Voltage: 3.3V ~ 6V
  • Compatible I/O Level: 3.3V, 5V
  • Only Need 2 I/O Port to Control
  • Full Compatible with Arduino
  • Working temperature: -30°C ~ 70°C
  • Interface: I2C
  • Super High Brightness (Adjustable)
  • Super High Contrast (Adjustable)
  • Embedded Driver/Controller

What should be the distance between the Sensor and the Object?

The term Field of View (FOV) describes the value of this distance; the field of view for our sensor is roughly 80°.

MLX90614 Infrared Thermometer Field of View

As seen above, the sensing range can be visualised as a conical form from the sensor point. As we get further away from the measuring object, the sensing area doubles. The sensing area grows by 2cm for every 1cm we walk away from the object. We used a laser diode on top of the sensor in our thermal gun to determine where the sensor’s sensing region is currently pointing. I noticed that the values were accurate while the gun was pointing 2cm away from the object, and that the accuracy decreased as we moved further away.

Arduino MLX90614 Thermometer Circuit Diagram

The circuit diagram for Infrared Thermometer is pretty simple. The complete circuit is shown below, it was created using Fritzing software.

MLX90614Arduino Uno

Once installed you can now load the following code. Tcode works the same way on any compatible with the Arduino platform.

MLX90614 Arduino Library

To interface the MLX90614 with the Arduino Board, the Arduino IDE requires the MLX90614 Library. Sparkfun and Adafruit both contributed to the creation of the library. The MLX90614 library from Adafruit and Sparkfun connects to the MLX90614 non-contact infrared thermometer through a 2-wire, I2C-like interface (SMBus).

1. Download Adafruit MLX90614 Library

2. Download Sparkfun MLX90614 Library

You’ll also need the Library for OLED Display in addition to the MLX90614 Library. Two libraries are required for the SSD1306 OLED Display. The libraries can be downloaded from the link below.

1. Adafruit SSD1306 Library: 

2. Adafruit GFX Library

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <stdint.h>
#include <Adafruit_MLX90614.h>

#define OLED_RESET 4

Adafruit_SSD1306 display(OLED_RESET);
Adafruit_MLX90614 mlx = Adafruit_MLX90614();

#if (SSD1306_LCDHEIGHT != 32)
#error(“Height incorrect, please fix Adafruit_SSD1306.h!”);

void setup()
Serial.println(“Adafruit MLX90614 test”);
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //To find the I2C //Address Of your OLED please Check this Blog //

void loop()
// Clear the buffer.

// text display tests
display.print(“Ambient: “);
display.print(” c”);
display.print(“Object: “);
display.print(” c”);



 By pressing the Push Button Switch, you can now turn on the circuit. The device will need 5 seconds to configure after being turned on, and the results will be presented on the OLED Display. Once the initialization is complete, the laser will switch on and the temperature will be displayed on the OLED.


Hope you all found this article quite useful.We MATHA ELECTRONICS will be back soon with more interesting topics.

Leave a Reply

Your email address will not be published.