Sensing Temperature (MLX90614 Arduino)

The MLX90614 is an Infrared thermometer, that by reading the infrared light coming off an object, can sense temperature between -95 and 720ºf (-70 to 382.2°C) with 17bit resolution.

This is an I2C, but unlike most I2C sensors, the MLX90614 can’t use the wire library to communicate with it, so we will be using another library, also, unlike what we typically deal with, the MLX90614 is not on a breakout board, so it requires some pull-up resistors on both the data and clock lines (Typically, these are included on the board, we just don’t notice them.)

As for hooking this up, on your Arduino (everything but the mega) SDA is on analog input pin 4, and SCL is on analog pin 5. On an Arduino mega, SDA is digital 20, and SCL is digital 21. Look at the picture to see how it should be connected, but a 4.7KΩ resistor needs to be connected from SDA to 3.3V, and another one from SCL to 3.3V. I also have a .1uf capacitor between power and ground as stated in the data sheet, but I have seen others not use it, and I have tested it without and it still worked.

Code
All this code does is output the temperature in both Celsius and Fahrenheit via serial. So open your serial monitor!

To make this code work, before you load the code, or even open the Arduino program, we need to place the “I2Cmaster” in your Arduino Library. Once the I2CMaster folder is in there, you can just go ahead and open MLX90614.pde in your Arduino software, and upload it.

MLX90614 Infrared Thermometer