blog

GY-906 MLX90614 Infrared Temperature Sensor Tutorial

GY-906 cover image

    In the fields of smart home, medical health and industrial automation, the demand for non-contact temperature measurement is growing. The GY-906 MLX90614 infrared temperature sensor module has become a preferred choice due to its high precision, small size, low power consumption and easy integration. Based on the MLX90614 chip, it realizes non-contact temperature measurement through infrared radiation technology. This article will comprehensively explain the module from its definition, working principle, pin parameters, Arduino integration method to application scenarios and FAQ, helping users with different needs master its key usage points.         

What is GY-906 MLX90614 infrared temperature sensor module?

GY-906 BAA sensor soldering pin

    The GY906 IR temperature module is an infrared temperature measurement module based on the thermocouple principle. It can quickly measure the temperature of a target object at a certain distance from the module.

   The MLX90614 series modules are a set of general-purpose infrared temperature measurement modules. Sensor MLX90614 module has been calibrated and linearized before leaving the factory, featuring advantages such as non-contact operation, small size, high precision, and low cost. The measured target temperature and ambient temperature can be output through a single channel, and there are two types of output interfaces, making them suitable for applications such as automotive air conditioning, indoor heating, household appliances, handheld devices, and medical equipment.

Working Principle

GY-906 MLX90614 Schematic Diagram

GY-906 MLX90614 Schematic Diagram

GY-906 MLX90614 Working Principle

    GY-906 MLX90614 IR sensor is based on the MLX90614 chip and adopts infrared radiation measurement technology to detect the surface temperature of objects. This MLX90614 chip integrates a highly sensitive infrared detector and signal processing circuit, which can accurately capture the infrared radiation emitted by objects and convert it into electrical signals.  

    Equipped with a built-in digital signal processor, the GY-906 MLX90614 sensor can automatically compensate for changes in ambient temperature, providing stable temperature readings. This non-contact measurement method makes it particularly suitable for occasions where direct contact measurement is inappropriate.  

    The MLX90614 temperature module contains an MLX90614-type infrared temperature sensor. The MLX90614 temperature sensor emits electromagnetic radiation to the target object using infrared rays and then quickly measures the temperature of the measured target. The electromagnetic radiation enters the sensor through a dual-charge electromagnetic induction element (DPP), which detects infrared energy and generates an electric charge. This charge is then amplified and converted into a digital output. Additionally, the MLX90614 integrates other chips and components such as a temperature compensation circuit, power regulator, and EEPROM, enabling it to deliver more accurate and stable measurement results.

MLX90614 Temperature Measurement Principle

    The amount of infrared radiation energy emitted by an object and the distribution of its wavelengths are closely related to the object’s surface temperature. Therefore, the surface temperature of an object can be accurately determined by measuring its self-emitted infrared radiation, which is the principle behind infrared temperature measurement. An infrared thermometer consists of several components: optical system, photoelectric detector, signal amplifier, and signal processing and output units. The optical system converges the infrared radiation energy of the target within its field of view, where the size of the field of view is determined by the optical components of the thermometer and their positions. The infrared energy is focused on the photoelectric detector, which converts it into a corresponding electrical signal. This signal passes through the amplifier and signal processing circuit, and after being corrected according to the instrument’s internal algorithm and the target’s emissivity, it is converted into the temperature value of the measured target.

    The full name of PWM is Pulse Width Modulation. It achieves the purposes of voltage and frequency conversion by adjusting the period and width of pulses. In digital pulse width modulation, digital signals serve as control signals, and the duty ratio is changed by altering the ratio of high and low level counts. PWM control circuits are widely used in switching power supplies, uninterruptible power supplies (UPS), DC motor speed control, AC motor variable frequency speed control, and other control circuits.

    SMBus (System Management Bus) is an efficient synchronous serial bus proposed by Intel in 1995. It has only two signal lines: a bidirectional data line and a clock signal line. It allows the CPU to communicate and exchange information with various peripheral interface devices in a serial manner, which can not only improve transmission speed but also reduce the resource occupation of devices. In addition, even on microcontrollers without an SMBus interface, it can be simulated using software.

    The MLX90614 series temperature measurement modules produced by Melexis are infrared temperature measurement devices that are very convenient to apply. All these modules are calibrated before leaving the factory and can directly output linear or quasi-linear signals, featuring excellent interchangeability and eliminating the need for complex calibration processes.

    The module uses the 81101 thermoelectric element as the infrared sensing part. Its output is the result of the combined effect of the measured object temperature (TO) and the ambient temperature (Ta). Ideally, the output voltage of the thermoelectric element is:

the output voltage of the thermoelectric element

    Among them, the temperature unit is Kelvin, and A is the sensitivity constant of the element.

    The target temperature and ambient temperature are measured by the thermocouple built into the 81101. The two temperature signals output from the 81101 are respectively amplified by the high-performance, low-noise chopper-stabilized amplifier on the internal MLX90302 device, and then output after passing through a 17-bit analog-to-digital converter (ADC) and a powerful digital signal processing (DSP) unit.

    The temperature resolution of this series of modules can reach 0.01°C, and they are compact in size. The measured target temperature and ambient temperature can be output through a single channel (controlled by the state machine inside the MLX90302), with two output modes: PWM output and programmable SMBus output, making them suitable for various application environments. Below, taking the MLX90614 as an example, its characteristics and usage methods are introduced in detail.

    Programming via SMBus allows modifying the preset values in the module’s EEPROM, configuring it according to application requirements, and reading the configuration information in the EEPROM. It can also read data such as temperature in the module’s RAM.

    The MLX90614 has two types suitable for 3V and 5V power supply operations. Due to the current consumption of less than 2mA for the 3V type, it is very suitable for handheld devices and battery-powered devices. For this reason, the sensor also has an energy-saving “sleep” mode, where the current consumption can be lower than 2mA. For situations where power is supplied directly by a 12V car battery, the 5V type includes electronic components that can operate at higher voltages together with several external components.

MLX90614 Chip Pin Functions

Pin

Function

VSS

Power ground, the metal case is connected to this pin.

SCL/Vz

SMBus interface clock signal, or connected to the triode base when powered by 8-16V power supply.

PWM/SDA

PWM or SMBus interface data signal. In normal mode, the object temperature is output through PWM from this pin.

VDD

Power supply

MLX90614ESF Parameters

Parameter

MLX90614ESF-Axx

MLX90614ESF-Bxx

MLX90614ESF-Dxx

MLX90614KSF-Axx

Supply Voltage, VDD (over voltage)

7V

5V

7V

Supply Voltage, VDD (operating)

5.5V

3.6V

5.5V

Reverse Voltage

0.4 V

0.4 V

0.4 V

Operating Temperature Range, TA

-40℃ ~ +85℃

-40℃ ~ +85℃

-40℃ ~ +125℃

Storage Temperature Range, TS

-40℃ ~ +125℃

-40℃ ~ +125℃

-40℃ ~ +125℃

ESD Sensitivity (AEC Q100 002)

2kV

2kV

2kV

DC current into SCL / Vz (Vz mode)

2 mA

2 mA

2 mA

DC sink current, SDA / PWM pin

25 mA

25 mA

25 mA

DC source current, SDA / PWM pin

25 mA

25 mA

25 mA

DC clamp current, SDA / PWM pin

25 mA

25 mA

25 mA

DC clamp current, SCL pin

25 mA

25 mA

25 mA

GY-906 MLX90614 Main Feature

GY-906 cover image
  1. High precision: Temperature measurement accuracy up to ±0.5°C.
  2. Wide temperature range: Measurement range from -40°C to +300°C.
  3. Fast response: Short response time, suitable for rapid temperature change monitoring.
  4. Low power consumption: Operating current only requires a few milliamps, suitable for battery-powered devices.
  5. Easy integration: The module has a simple design, easy to integrate with various development boards such as Arduino.

GY-906 MLX90614 Arduino

GY-906 MLX90614 Pinout

Arduino nano

GY-906

OLED

Button

5V

VIN

VCC

VCC

GND

GND

GND

GND

A4

SDA

SDA

\

A5

SCL

SCL

\

D2

\

\

OUT

GY-906 MLX90614 Code

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

// ========== OLED Configuration ==========
#define SCREEN_WIDTH     128
#define SCREEN_HEIGHT    64
#define OLED_RESET       -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// ========== Infrared Temperature Sensor ==========
Adafruit_MLX90614 mlx = Adafruit_MLX90614();

// ========== Button Module ==========
const int BUTTON_PIN = 2;     // Button module's OUT pin connected to D2
bool buttonWasPressed = false;
float currentTempC = 0.0;

void setup() {
  // === Serial Initialization ===
  Serial.begin(9600);

  // === Button Pin Setup ===
  pinMode(BUTTON_PIN, INPUT);  // Button is LOW when pressed (most modules work this way)

  // === OLED Initialization ===
  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // If not working, try I2C address 0x3D
    Serial.println(F("OLED init failed. Try I2C address 0x3D."));
    while(1);
  }

  // === Initial OLED Display (Before Measurement) ===
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 0);
  display.println(F("Infrared Thermometer"));
  display.println(F("--------------------"));
  display.println(F("Press button to measure"));
  display.display();

  // === Initialize MLX90614 Sensor ===
  mlx.begin();
}

void loop() {
  // === Read Button State ===
  int buttonState = digitalRead(BUTTON_PIN);
  bool isPressed = (buttonState == LOW);

  if (isPressed && !buttonWasPressed) {
    // Prevent multiple triggers
    buttonWasPressed = true;

    // === Read Object Temperature Once ===
    currentTempC = mlx.readObjectTempC();

    // === Clear Screen and Redraw ===
    display.clearDisplay();
    display.setTextColor(SSD1306_WHITE);

    // === Line 1: Title ===
    display.setTextSize(1);
    display.setCursor(0, 0);
    display.println(F("Infrared Thermometer"));

    // === Line 2: Separator Line ===
    display.println(F("--------------------"));

    // === Line 3: Display "Object Temp:" ===
    display.setTextSize(1);  // Small font
    display.setCursor(0, 20);  // y = 20
    display.print(F("Object Temp:"));

    // === Line 4: Display Temperature Value ===
    display.setTextSize(3);  //Large font
    display.setCursor(10, 40);  // y = 40,below the previous line
    display.print(currentTempC, 1);  // Show 1 decimal place
    display.println(F(" C"));      // Unit

    // === Update Display ===
    display.display();

    // === Serial Output (Once per Button Press) ===
    Serial.println(F("=== Button Pressed - Measurement Taken ==="));
    Serial.print(F("Object Temperature: "));
    Serial.print(currentTempC);
    Serial.println(F(" °C"));
    Serial.println();

    // Debounce
    delay(200);
  }

  // If button is released, allow next trigger
  if (buttonState == HIGH) {
    buttonWasPressed = false;
  }

  // Small delay to reduce loop frequency
  delay(100);
}
				
			

GY-906 MLX90614 Application Scenarios

    Due to its high precision and reliability, this GY-906 MLX90614 module is widely used in various fields:

  1. Smart home: Used to monitor indoor temperature and realize intelligent temperature control.
  2. Medical and health: Non-contact body temperature detection to reduce the risk of cross-infection.
  3. Industrial automation: Monitor the operating temperature of production equipment to prevent failures.
  4. Scientific research experiments: Provide accurate temperature data to support scientific research.

Relative Information

Purchase Link

FAQ

1、Is MLX90614 analog or digital?

    MLX90614 is a digital infrared non-contact temperature sensor. It outputs temperature data processed by internal analog-to-digital conversion through an I²C digital interface, so it is a digital sensor rather than an analog sensor.

2、How to test if a temperature sensor is working?

    To test whether an infrared temperature sensor (such as MLX90614 sensor) is working, follow these steps:

① Check hardware connections: Ensure the sensor’s VCC and GND are wired correctly, the power supply voltage meets the requirements (usually 3.3V or 5V), and the I2C communication lines SCL and SDA are connected properly without cold solder joints or short circuits.

② Observe power-on status: After powering on the sensor, check for abnormal heating or circuit faults. The sensor should not heat up significantly or have circuit abnormalities during normal operation.

③ Test I2C communication: Use an I2C scanning tool (such as Arduino’s Wire library) to detect if the sensor’s default address (0x5A or 0x5B) responds. If the address can be scanned, the communication is basically normal.

④ Read temperature data: Upload the test program (such as the sample code of the MLX90614 dedicated library), read the ambient temperature (Ta) and object temperature (To) through the serial monitor, and observe if the data is reasonable.

⑤ Verify temperature changes: The ambient temperature should be close to the current room temperature (about 20-30°C). Bring your hand close to the sensor or place objects with different temperatures (such as ice cubes, warm water) near it, and observe if the object temperature (To) changes accordingly.

⑥ Troubleshoot faults: If the reading is fixed, all zeros, or obviously abnormal, check if the wiring, I2C address, and library files are correct, or replace the sensor for further testing.

    If the temperature data is stable and meets expectations, the sensor is working normally.

3、Is MLX90614 easy-to-use?

    Overall, the MLX90614 is relatively easy to use. It adopts a standard I²C digital interface, requiring only four wires (VCC, GND, SCL, and SDA) to communicate with the main control board (such as Arduino, Raspberry Pi, etc.), without the need for complex analog signal processing. It has built-in digital signal processing and filtering functions. The output temperature data is internally calibrated, and accurate infrared temperature measurement results can be obtained directly through I²C reading. The open-source libraries (such as the MLX90614 library for Arduino) provide ready-made code examples, allowing developers to quickly implement the temperature reading function with simple calls, even for electronic beginners to get started quickly. However, during use, we should pay attention to matching the power supply voltage (usually 3.3V or 5V), selecting the I²C address (common 0x5A/0x5B), and avoiding strong light. As long as these basic matters are handled properly, the overall user experience is very user-friendly.

Leave a Reply

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