when adding 2nd i2c range sensor, first stops working

Dear all,

I have quite a strange problem when trying to add a second sensor to my working environment.

"Old" Sensor: VL53L0x (sensor)

"New" Sensor: VL6180x (sensor1)

  • Doing a i2c detect shows that both sensors are on different i2c adresses.
  • pullups are in place
  • the VL6180x works standalone without problems (on another arduino).
  • the clock and data lines of both sensors are connected to the same UNO ports 4 and 5.

Result:

Adding the code for the new sensor doesn't affect the "old" Sensor.

But as soon as I connect the new sensor physically the old sensor stops working. All calls for meassurment of the distance result in "timeout".

Code:

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include <VL53L0X.h>
#include <VL6180X.h>
#define LONG_RANGE //for VL53LOX
#define HIGH_ACCURACY //for VL53LOX

VL53L0X sensor;
VL6180X sensor1;

sensor.init();
sensor.setTimeout(500);

sensor1.init()
sensor1.setTimeout(500);
sensor1.configureDefault();

....

Serial.print(sensor.readRangeSingleMillimeters());
if (sensor.timeoutOccurred()) { Serial.print(" TIMEOUT"); }
...

Any idea how to proceed with troubleshooting?

regards
Michael

As both sensors are small SMD chips I guess you're not using them directly but by some breakout boards. Post links to the schematics of these boards!

I am wiring them directly (smoldered wires, both sets have 30 to 50 cm length and are directly connected at the ports).

Uno Port 4------------------------------------------------------------------------
/ /
Sensor 1 Sensor 2
/ /
Uno Port 5-------------------------------------------------------

Dear all,

It seems that my first input was wront and both sensors, while of different type, have the SAME i2c adress?!

I have seen that on an Arduino UNO there are 2 sets of SDA, SCL ports ... are there 2 i2c controllers on the uno or are both sets connected to the same controller?

regards
Michael

I'm still waiting for the links to the schematics of the breakout boards!