Infrared contactless thermometer (pyrometer) based on the MLX90614 sensor and ATmega32

Contactless thermometers are pretty standard consumer items today, and the low-end ones without sophisticated optics are already quite cheap. Nevertheless, I was just curious about the sensor employed in these devices, so I purchased the MLX90614 sensor instead and dedicated two evenings to building such a device myself, using the ATmega32 MCU. The result is below:

The display shows the object temperature and ambient temperature, updating about twice a second. Short press of the button toggles display backlight, long press toggles to emissivity setup mode.

The schematics is trivial, following the datasheets of the involved components. It is powered from a 9V battery, down-converted by LM2575 to 5V (using AAA version of MLX90614). Connection of the I2C pins and of the display are described in the GPL-licensed open source code of the firmware. An additional headers backward.h and old_sfrdefs.h might be needed in some build environments. Do not forget to link it with a floating point library as indicated in the source file, otherwise no numbers will be printed.

I was not able to write the emissivity to the register of the MLX sensor. Actually, changing emissivity is not described in the datasheet. I found another app. note from Melexis about that, but it did not work. Maybe it is not supported in this sensor and they removed it from the particular datasheet. I assume that the CRC calculation I implemented is correct, since it matches when reading the temperature.

I have noticed also a little catch concerning the MLX90614 compatibility with SMBUS/I2C: There is a timeout of 50microseconds for SCL being high. It simply stops communication when SCL stays high for 50us after the start condition. This is not a problem here, but it is an issue if you want e.g. access MLX90614 via libmpsse and ft2232h from a PC. The latency there was about 130microseconds and the communication failed. Notice that I2C does not define any timeouts and SMBUS defines only a 35 millisecond timeout.





My Electronics page


My hobby page


My main page with e-mail contact


TOP of my family pages