Thermal Infrared (TIR)

The Thermal Infrared for Mindstorms NXTIntroduction

The Dexter Industries Thermal Infrared Sensor reads surface temperatures of objects.  It is a non-contact thermometer based on the MLX90614.  Detecting the infrared radiation from an object, the sensor can read object temperatures between -90°F and 700°F (-70°C and +380°C).  The sensor has a high accuracy of 0.5°C and a resolution of 0.02°C.

The Thermal Infrared Sensor reads both the ambient temperature (the temperature of the air around the sensor) and  the surface temperature of the object that the sensor is pointed towards.


The Thermal Infrared Sensor can be connected to any of the four sensor ports on the Mindstorms NXT.  The sensor uses I2C protocol to communicate with the Mindstorms NXT.


Layout for the Thermal Infrared Sensor For Mindstorms NXT

On the frontside of the sensor:

Thermal Infrared Sensor - Backside of the Sensor

On the backside of the sensor:

Hints and Warnings



The Thermal Infrared Sensor communicates with the LEGO Mindstorms through any sensor port on the NXT.  The detector on the front of the sensor board is controlled by a microcontroller (on the back of the sensor board).  The microcontroller translates signals from the detector to the Mindstorms NXT.

For most program, the Thermal Infrared Sensor NXT-G Block will be sufficient.


NXT-G blocks have been developed for the Thermal Infrared Sensor.  These blocks read object temperature and the ambient temperature.  They can be downloaded here:

Thermal Infrared Sensor NXT-G Block: The NXT-G Block has two outputs.  One reads an object’s temperature and one reads the ambient temperature.  Temperatures are output in 100XKelvin.

Thermal Infrared NXT-G Block Marker for Mindstorm NXT Sensor
The Sensor Icon in NXT-G
NXT-G-Block for Mindstorms NXT
The Sensor Block in NXT-G
NXT-G Block Control Panel for Thermal Infrared Sensor for Lego Mindstorm NXT
The Thermal Infrared Sensor NXT-G Control Panel


Thermal Infrared Emissivity NXT-G Block: Most objects and materials you will want to measure the temperature of will not need the emissivity adjusted.  The sensor has a default emissivity of 1.0, representing a black body.  However, some materials (especially polished metals and reflective materials) will need the emissivity adjusted to measure temperature accurately.  This block can be used to changewrite the emissivity of the object being read.  Emissivity is typically expressed as a fraction, were 1.0 is a perfect black body.  To set the emissivity to 1.0, the number into the block should be 10,000.  To set the emissivity to Aluminum aluminum foil (ε = 0.04), for example, the number into the block should be 400.

If the emissivity value is set to a new value, it will remain set to that value until the emissivity is reprogrammed.

The emissivity of common materials can be found here.

Emissivity Block
A quick program in NXT-G for setting the emissivity.

Sensor Firmware

Advanced users that want to develop firmware are able to do so.  This information is provided to advanced users, but is by no means necessary to understand to fully use the thermal infrared sensor.

The firmware for the TIR sensor was written in Atmel’s AVR Studio 5.0.  The firmware polls the SMBus protocol of the MLX90614 and translates it into standard I2C for the Mindstorms NXT.  The I2C slave address of the sensor is 0x0E (in hex format).  The TIR has two registers it updates with temperature information:

When the LEGO MINDSTORM NXT requests a register, the Infrared sensor returns two bytes:  a High Byte and a Low Byte.  The High and Low Bytes.  When these are shifted and combined into a single floating point number and then multiplied by the Temperature Factor (0.02), this gives the temperature, in Kelvin, multiplied by 100 (divide by 100 to get an accurate floating point value).  See the examples below for more information.


An example in RobotC.  This example reads the object temperature, ambient temperature, and emissivity, and writes the emissivity.  The RobotC example for LEGO MINDSTORMS NXT can be found here.




Labview VI’s for the Dexter Industries Thermal Infrared Sensor can be found here:

Other Links and Examples

Frequently Asked Questions


Got a question?  Ask on our forum!