I2C hanging problem - 2 Arduino's and an 3.3V I2C Sensor TMP102

Hi,

I am trying to connect 2 arduino's (2 Uno's or 1 Uno and 1 Ethernet) with an I2C sensor (Temperatur Sensor TMP102) and communicate via I2C.

What works:

  • 2 Arduinos communicating with each other in Master/Slave or Multiple Master configuration without problem
  • 1 Arduino and the Sensor (works with either Arduino)

What does not work:
As soon as I have both Arduinos and the Sensor connected, the bus hangs. This is observed via the Serial Window where the first Arduino prints out the temperature readings. As soon as the second Arduino is connected, the window hangs immediately.

My Set-up:

  1. all GND's are connected (sensor and both arduinos)
  2. The sensor is connected to 3.3V
  3. The SDA/SCL lines are conected via 4.7k Ohm resistors to 5V
  4. I have also tried without the pull-up resistors
  5. All wires are very short, no long connections
  6. I have also successfully connected 1 Arduino with 5 different I2C sensors
  7. I Wire.read the temperature from the TMP102 once per second
  8. The Second Arduino does not do anything. The code on the first Arduino (the one polling the TMP102) hangs as soon as I connect the SCL/SDA lines from the second Arduino to the bus. Resetting, different sequence, etc all have the same result. As soon as the 2nd Arduino is connected, it stalls.

Has anyone successfully connected multiple Arduinos and 3.3V I2C sensors? If so, would be really great to share your set-up, I am at a loss here, having banged my head against it for quite some time now...

Thank you so much for your kind help.

Peter

My guess is that it is something to do with the difference between 3.3V and 5V. In particular both Arduinos will be enabling the internal pull-ups for SDA and SCL, which may be overpowering the 3.3V sensor. I would be inclined to put a level converter on the sensor, so everything is operating at the 5V level. Failing that, turn-off the internal pull-ups, eg.

digitalWrite (A4, LOW);
digitalWrite (A5, LOW);

And use a less aggressive pull-up resistor (20K maybe). Maybe even just turning off the internal pull-ups (for both sides) will be enough.

Nick, you are amazing!

I just tried it with 20kO and it now works! I have read your excellent posts about the effect of different pull-ups but I guess 4.7 was still to aggressive.

I will also try the level converter as per your suggestion (but I only have the old Sparkfun one, might get their newer bi-directional ones) and see how that goes.

The end-goal is something like 5 Arduinos and 25 Sensors... I'll keep you posted how things evolve, any tips or hints on what to look out for while building such a set-up would be much appreciated.

Anyway, thanks again, you are amazing!

Cheers

peter