Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

MLX90614 Arduino: Non-Contact IR Temperature Sensor Guide

Non-contact temperature measurement has become increasingly important in electronics, medical devices, and industrial applications. The MLX90614 Arduino combination provides an accessible yet highly accurate solution for measuring temperatures without physical contact. As someone who has integrated this sensor into numerous embedded designs, I can tell you it’s one of the most reliable IR thermometers available for maker projects.

In this comprehensive guide, I’ll cover everything you need to know about interfacing the MLX90614 infrared temperature sensor with Arduino, including the working principle, wiring configurations, calibration techniques, and practical code examples.

What Is the MLX90614 Infrared Temperature Sensor?

The MLX90614 is a high-precision, factory-calibrated infrared thermometer manufactured by Melexis. Unlike contact-based temperature sensors like the DS18B20 or thermocouples, the MLX90614 measures temperature by detecting infrared radiation emitted by objects in its field of view. This non-contact approach enables temperature measurement of moving parts, hazardous materials, or surfaces that would be damaged by physical probes.

How Non-Contact IR Temperature Measurement Works

Every object above absolute zero emits infrared radiation proportional to its temperature. This principle, known as the Stefan-Boltzmann law, forms the foundation of IR thermometry.

Inside the MLX90614, an infrared thermopile detector collects this radiation through an optical filter that blocks visible light and near-infrared wavelengths. The thermopile converts the absorbed IR energy into a small voltage signal, which is then processed by the sensor’s integrated 17-bit ADC and digital signal processor. The result is a precise temperature reading delivered via the I2C interface.

The MLX90614 actually provides two temperature measurements simultaneously: the object temperature (what you’re pointing at) and the ambient temperature (the sensor die temperature). The ambient reading helps compensate for environmental conditions and can serve as a secondary measurement for certain applications.

MLX90614 Sensor Versions and Variants

Melexis produces several variants of the MLX90614 to suit different applications. Understanding these differences helps you select the right sensor for your project.

MLX90614 Voltage Variants

VariantSupply VoltageLogic LevelBest For
MLX90614Axx4.5V – 5.5V5VArduino Uno, Mega
MLX90614Bxx2.6V – 3.6V3.3VESP32, ESP8266, Arduino Due

MLX90614 Field of View (FOV) Variants

ModelField of ViewOptimal Use Case
MLX90614-BAA90°General purpose, close range
MLX90614-BCC35°Longer distance, smaller targets
MLX90614-DCIIndustrial, precise spot measurement

The field of view determines how much area the sensor “sees” at a given distance. A 90° FOV means the sensing area diameter equals twice the measurement distance. At 10cm away, the sensor averages temperature across a 20cm diameter circle. For accurate readings, the target object must completely fill this field of view.

Standard vs Medical Grade Accuracy

VersionAccuracyTemperature Range
Standard±0.5°CFull operating range
Medical Grade±0.2°CAround body temperature (35-42°C)

The medical-grade version (MLX90614-BCF) offers enhanced accuracy specifically calibrated for human body temperature measurement, making it suitable for clinical applications.

MLX90614 Arduino Specifications

Understanding the complete specifications helps ensure proper integration into your design.

ParameterValue
Object Temperature Range-70°C to +380°C
Ambient Temperature Range-40°C to +125°C
Resolution0.02°C
Accuracy (Standard)±0.5°C (0 to +50°C range)
ADC Resolution17-bit
InterfaceI2C (SMBus compatible)
I2C Address0x5A (default, programmable)
Supply Current1.5mA typical
Response Time0.6 seconds (90% response)
Operating Wavelength5.5µm to 14µm

MLX90614 Arduino Pinout and Module Details

Most MLX90614 modules available for hobbyists come on breakout boards that include necessary support circuitry.

Standard Module Pinout

PinNameFunction
1VCC/VINPower supply input
2GNDGround reference
3SCLI2C clock line
4SDAI2C data line

Module Features

The GY-906 breakout board, one of the most common modules, includes several helpful components:

  • 662K 3.3V voltage regulator: Accepts 3.3V or 5V input, outputs regulated voltage for the sensor
  • I2C pull-up resistors: Built-in pull-ups on SDA and SCL lines
  • Decoupling capacitor: Filters power supply noise
  • Optical filter: Built into the MLX90614 package, blocks visible light interference

Wiring MLX90614 to Arduino

The I2C interface makes wiring straightforward, requiring only four connections.

MLX90614 Arduino Uno/Nano Wiring

MLX90614 PinArduino Uno Pin
VCC5V
GNDGND
SCLA5 (SCL)
SDAA4 (SDA)

MLX90614 Arduino Mega Wiring

MLX90614 PinArduino Mega Pin
VCC5V
GNDGND
SCLPin 21 (SCL)
SDAPin 20 (SDA)

For bare MLX90614 sensors (not on breakout boards), add 4.7K pull-up resistors between SDA/SCL and VCC, plus a 100nF decoupling capacitor across the power pins.

Installing the MLX90614 Arduino Library

Before writing code, install the Adafruit MLX90614 library through the Arduino IDE:

  1. Open Arduino IDE
  2. Navigate to Sketch → Include Library → Manage Libraries
  3. Search for “Adafruit MLX90614”
  4. Click Install on the Adafruit MLX90614 Library
  5. Also install the “Adafruit BusIO” dependency if prompted

Alternatively, the SparkFun MLX90614 library offers additional features like emissivity adjustment and address changing.

MLX90614 Arduino Code Examples

Let me share the code patterns that have proven most reliable across my projects.

Basic Temperature Reading

This fundamental example reads both ambient and object temperatures:

#include <Wire.h>

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {

  Serial.begin(9600);

  while (!Serial);

  Serial.println(“MLX90614 Arduino Temperature Sensor”);

  if (!mlx.begin()) {

    Serial.println(“Error: MLX90614 not found!”);

    while (1);

  }

  Serial.println(“Sensor initialized successfully”);

}

void loop() {

  Serial.print(“Ambient: “);

  Serial.print(mlx.readAmbientTempC());

  Serial.print(“°C\t”);

  Serial.print(“Object: “);

  Serial.print(mlx.readObjectTempC());

  Serial.println(“°C”);

  // For Fahrenheit readings:

  // Serial.print(mlx.readAmbientTempF());

  // Serial.print(mlx.readObjectTempF());

  delay(500);

}

Temperature Alarm System

This practical example triggers an alert when temperature exceeds a threshold:

#include <Wire.h>

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

const int buzzerPin = 8;

const int ledPin = 13;

const float tempThreshold = 37.5;  // Temperature threshold in Celsius

void setup() {

  Serial.begin(9600);

  mlx.begin();

  pinMode(buzzerPin, OUTPUT);

  pinMode(ledPin, OUTPUT);

}

void loop() {

  float objectTemp = mlx.readObjectTempC();

  Serial.print(“Temperature: “);

  Serial.print(objectTemp);

  Serial.println(“°C”);

  if (objectTemp > tempThreshold) {

    digitalWrite(ledPin, HIGH);

    tone(buzzerPin, 1000, 200);  // Alert tone

    Serial.println(“WARNING: High temperature detected!”);

  } else {

    digitalWrite(ledPin, LOW);

    noTone(buzzerPin);

  }

  delay(500);

}

Averaging Multiple Readings for Stability

For applications requiring stable readings, averaging multiple samples reduces noise:

#include <Wire.h>

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

float getAverageTemperature(int samples) {

  float total = 0;

  for (int i = 0; i < samples; i++) {

    total += mlx.readObjectTempC();

    delay(50);

  }

  return total / samples;

}

void setup() {

  Serial.begin(9600);

  mlx.begin();

}

void loop() {

  float avgTemp = getAverageTemperature(10);  // Average of 10 readings

  Serial.print(“Average Object Temperature: “);

  Serial.print(avgTemp, 2);

  Serial.println(“°C”);

  delay(1000);

}

Understanding Emissivity and Calibration

Emissivity is crucial for accurate IR temperature measurement. It represents how effectively an object emits infrared radiation compared to a perfect blackbody (emissivity = 1.0). The MLX90614 is factory-calibrated for emissivity of 1.0, but real-world objects have varying emissivity values.

Common Material Emissivity Values

MaterialEmissivity
Human Skin0.98
Water0.96
Paper0.93
Rubber (black)0.94
Plastic0.84 – 0.95
Painted Metal0.90 – 0.95
Oxidized Steel0.79
Polished Aluminum0.05
Polished Copper0.03

Adjusting Emissivity with SparkFun Library

The SparkFun library allows runtime emissivity adjustment:

#include <Wire.h>

#include <SparkFunMLX90614.h>

IRTherm therm;

void setup() {

  Serial.begin(9600);

  therm.begin();

  // Set emissivity for human skin measurement

  therm.setEmissivity(0.98);

  Serial.print(“Emissivity set to: “);

  Serial.println(therm.readEmissivity());

}

void loop() {

  if (therm.read()) {

    Serial.print(“Object: “);

    Serial.print(therm.object(), 2);

    Serial.println(“°C”);

  }

  delay(500);

}

Note that emissivity values are stored in the sensor’s EEPROM and persist across power cycles.

MLX90614 Arduino Project Applications

The versatility of this sensor enables numerous practical applications.

Medical and Health Monitoring

Non-contact body temperature screening became widely adopted during the COVID-19 pandemic. The MLX90614 can measure forehead or wrist temperature without physical contact, making it ideal for fever detection systems.

Industrial Temperature Monitoring

Monitor the temperature of rotating machinery, conveyor belt products, or hazardous materials without interrupting operations. The sensor can detect overheating components before failure occurs.

HVAC and Home Automation

Integrate with smart home systems to monitor heating/cooling efficiency, detect hot spots in electrical panels, or trigger climate control based on surface temperatures.

Food Safety

Verify proper storage temperatures for perishable goods without opening containers or compromising cold chain integrity.

Electronics Debugging

Quickly identify overheating components on circuit boards during development and testing phases, far safer than touching potentially hot ICs.

Troubleshooting MLX90614 Arduino Issues

After integrating this sensor into many designs, I’ve encountered and resolved most common problems.

Sensor Not Detected on I2C Bus

Solutions:

  • Verify wiring connections, especially SDA and SCL
  • Check that pull-up resistors are present (either on module or external)
  • Run an I2C scanner sketch to confirm the sensor address (default 0x5A)
  • Ensure proper voltage level (3.3V module with 5V Arduino may need level shifter)

Inaccurate Temperature Readings

Causes and fixes:

  • Wrong emissivity setting for the measured material (adjust emissivity)
  • Object doesn’t fill the sensor’s field of view (move closer)
  • Sensor not at thermal equilibrium (allow warm-up time, typically 1-2 minutes)
  • Reflective surfaces nearby causing interference (shield sensor)

Readings Fluctuate Excessively

Improvements:

  • Implement averaging over multiple samples
  • Add proper decoupling capacitors on power supply
  • Shield sensor from air currents and drafts
  • Ensure stable power supply (noise affects readings)

Useful Resources for MLX90614 Arduino Projects

ResourceURLDescription
Melexis Datasheetmelexis.comOfficial MLX90614 specifications
Adafruit Librarygithub.com/adafruitArduino library with examples
SparkFun Librarygithub.com/sparkfunAdvanced library with emissivity control
Arduino Referencearduino.cc/referenceOfficial documentation
Last Minute Engineerslastminuteengineers.comDetailed tutorials
DFRobot Wikiwiki.dfrobot.comApplication notes

Component Sources:

  • Adafruit (adafruit.com) – Quality modules with documentation
  • SparkFun (sparkfun.com) – Evaluation boards available
  • Amazon/AliExpress – Budget GY-906 modules

FAQs About MLX90614 Arduino Projects

What is the maximum distance the MLX90614 can measure temperature?

The MLX90614 doesn’t have a fixed maximum distance. Instead, accuracy depends on whether the target completely fills the sensor’s field of view. For the 90° FOV version, the target diameter should be at least twice the measurement distance. At 10cm distance, the target should be at least 20cm across. For smaller targets or greater distances, use narrow FOV variants like the MLX90614-DCI with its 5° field of view.

Can I connect multiple MLX90614 sensors to one Arduino?

Yes, but it requires changing the I2C address of additional sensors since all MLX90614 sensors ship with the default address 0x5A. The SparkFun library includes functions to reprogram the I2C address stored in the sensor’s EEPROM. Alternatively, use an I2C multiplexer like the TCA9548A to connect multiple sensors at the same address on separate channels.

Why does my MLX90614 show lower temperature than expected when measuring body temperature?

This typically occurs because the sensor is calibrated for emissivity of 1.0, while human skin has an emissivity around 0.98. More significantly, measuring forehead temperature in a cool environment naturally reads lower than core body temperature. Medical-grade infrared thermometers include compensation algorithms for this offset. Adjust emissivity settings and consider adding a calibration offset in your code based on reference measurements.

How do I improve the accuracy of my MLX90614 readings?

Several techniques improve accuracy: First, allow the sensor 1-2 minutes to reach thermal equilibrium after power-up. Second, set the correct emissivity for your target material. Third, ensure the target completely fills the field of view. Fourth, average multiple readings to reduce noise. Finally, shield the sensor from drafts and avoid nearby heat sources that could affect the ambient temperature measurement.

Can the MLX90614 measure through glass or plastic windows?

Standard glass and most plastics block infrared radiation in the wavelengths the MLX90614 detects (8-14µm), making direct measurement through these materials impossible. You would measure the glass/plastic temperature instead of what’s behind it. Special IR-transparent materials like germanium, zinc selenide, or certain polyethylene films can be used as windows, but they require emissivity compensation due to their less-than-perfect transmission.

Conclusion

The MLX90614 Arduino combination offers a powerful and accessible solution for non-contact temperature measurement across countless applications. From simple thermometer projects to sophisticated industrial monitoring systems, this sensor delivers professional-grade accuracy at hobbyist-friendly prices.

Start with the basic code examples provided here to verify your wiring and sensor operation, then expand into more sophisticated applications as your project demands. Pay attention to emissivity settings for accurate measurements, and allow adequate warm-up time for the sensor to stabilize.

The sensor’s I2C interface, factory calibration, and wide temperature range make it suitable for both prototyping and production applications. Whether you’re building a temperature gun, monitoring equipment health, or creating a smart home sensor network, the MLX90614 provides the reliability and precision needed for successful projects.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.