I2C With Elegoo UNO R3

Hi to everyone,

I'm trying to connect an new MLX90614 IR Thermometer sensor to my Elegoo UNO R3 Arduino board (references below) using the I2C protocol, but when I run a tester code to check if the board is detecting the sensor, it seems that no I2C devices are being found.

Could someone give me a hand if they see any errors in the circuit or if they know whether the Elegoo UNO R3 boards are compatible with the I2C protocol? Or maybe it is more of a sensor problem?

MLX90614 hw-691 sensor model: https://spanish.globalsources.com/Sensor-infrarrojo/HW-691-1178301151p.htm
Elegoo UNO R3 board (kit): UNO R3 Kit de súper iniciadores – ELEGOO EU

Sensor Connections:
VIN - 5V
GND - GND
SDA - A4
SCL - A4

Code:

#include <Wire.h>

void setup() {
  Serial.begin(9600); 
  while (!Serial);       
  
  Serial.println("\nSearching I2C devices...");
  Wire.begin(); 
}

void loop() {
  
  byte error, address;
  int nDevices = 0;

  for (address = 1; address < 127; address++) { 
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0) {
      Serial.print("I2C device found at 0x");
      Serial.println(address, HEX);
      nDevices++;
    } else if (error == 4) {
      Serial.print("Unknow error at 0x");
      Serial.println(address, HEX);
    }
  }

  if (nDevices == 0) {
    Serial.println("Not I2C devices found.");
  } else {
    Serial.println("Finished scan.");
  }

  delay(5000); 
}

Output:

PS: I've already tried to change sensor's Vin to 3.3V, but the result is the same.

Thank you very much in advance.
Best,
Samuel

You have no electrical connection to your sensor. Simply setting the sensor holes over the header pins will not work.

Let me repeat that:

Simply setting the sensor holes over the header pins will not work.

They must be soldered. Period. End of story.

2 Likes

Thak you very much.

1 Like

I have now soldered the sensor board:

but when I run the tester code from post #1, I get the same "Not I2C devices found." as I did before.

Could it be a problem with the sensor or the electric scheme? I've searched in other forums but nothing seems to fit my problem.

PS: I've tryed other sensors that use I2C (e.g. MAX30105) and it worked without errors, so I suppouse it is not a problem with the board protocol nor the code.

MLX90614 Temperature IR: In-Depth: Interface MLX90614 IR Temperature Sensor with Arduino
Elegoo UNO R3: ELEGOO UNO R3 Super Starter Kit with Tutorial Compatible with Arduino IDE – ELEGOO US

The sensor connections are still the same as I described in post #1.

Since other I2C devices are detected,it may be that you damaged the sensor when you hadn't soldered it before and tried applying power to it. With intermittent (at best) connections, there's a real possibility that the sensor ended up being power via sneak paths on SDA and/or SCL and self destructed.

2 Likes

Also inspect your soldering, you might have cold solder joint there (sphere shape solder)?

NO pull up resistors....

1 Like

Are there pull-up resistors on SDA and SCL?

I have merged your forum topics due to them having too much overlap on the same subject matter @slozanoj.

In the future, please only create one topic for each distinct subject matter and be careful not to cause them to converge into parallel discussions.

The reason is that generating multiple forum topics on the same subject matter can waste the time of the people trying to help. Someone might spend a lot of time investigating and writing a detailed answer on one topic, without knowing that someone else already did the same in the other topic.

Thanks in advance for your cooperation.

It is hard to tell from the photograph, because the resolution is not high enough. But it looks like the ground pin is not soldered correctly.

For reliable operation insert pull-up resistors on SDA and SCL. 4k7 are typical.

Also, like others, I suspect your soldering.

At least two (probably all) are cold solder joints (the "doughnut" shape). Apply flux to the joint, heat iron to 380c, hold iron to solder pad and pin, release after solder flows together.