I built an infrared thermometer using the MLX90614 IR sensor and an Arduino Nano. I needed a little higher temperature reading so I changed to the OTI-301 sensor hoping that it would work with the same library as the MLX90614 in the Arduino IDE. Unfortunately the sensor does not work and there is very little documentation out there about the new sensor I'm using,OTI-301. if anyone could give me some guidance on how to make this sensor work with Arduino it would be much appreciated. Also, both the MLX90614 and TI-301 work with the I2c protocol so I am pretty sure I have the right connections since the MLX90614 sensor worked perfectly fine. Here is the link of new sensor



1 Answer 1


For faster response and easier mounting, I switched from a contact sensor to the OTI-301 non-contact sensor from the vendor you referenced. The following is the code that I used. Verify that your OTI-301 expected VDD is 3.3V. The MLX90614 that I tested was 5V. Would be easy to overlook the difference.

// Demo Arduino code for the OPT-301 non-contact thermometer
// References used:
//   https://drive.google.com/file/d/1XMRDCNzY3fn0q6lkGejs5D-pqksfRuZ8/view?usp=sharing
//   https://drive.google.com/file/d/1mmdkHkNbwC5VgQxGMrq07XolajNvgBkN/view?usp=sharing

#include <Wire.h>

void setup() {

void loop() {
  const int addr = 0x10; // I2C addresses at 7-bit, must shift documented 0x20 address, so 0x10.

  int rv = Wire.endTransmission(false);

  if (rv != 0) {
    Serial.print("Error while transmitting: ");
  } else {
    const int n = 6;
    uint8_t dat[n];

    Wire.requestFrom(addr, n);

    int i;
    for (i = 0; i < n && Wire.available(); i++) {
      dat[i] = Wire.read();

    if (i != n) {
      Serial.println("Incomplete data");
    } else {
      float amb = (dat[2] * 65536L + dat[1] * 256L + dat[0]) / 200.;
      float obj = (dat[5] * 65536L + dat[4] * 256L + dat[3]) / 200.;

      Serial.print("Temperatures (C): Ambient: ");
      Serial.print("  Object: ");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.