Hi all,
I'm trying to connect a TCS34725 colour sensor and a couple of Pololu VL53L0X distance sensors to my Arduino UNO board, using a Grove base shield V2.
I'm tring to get measurements but unfortunately I receive 65535 from both VL53L0X while TCS34725 seems to work fine.
I verified I2C addresses... They are ok.
Supply is 5V, the same for all sensors.
Without the TCS3472, VL53L0X sensors work fine.
I noticed the following:
disconnecting the only 5V and 0V wires from the TCS3472 ( before running the sketch) , VL53L0X sensors work fine.
if I connect the 5V and 0V wires to the TCS3472 while the sketch is running, VL53L0X sensors continue to work correctly.
Same behaviour disconnecting the only SDA and SCL wires from the TCS3472 and connecting them while the sketch is running.
What am I doing wrong?
Any idea about this strange behavior?
During the first test I used 3.3V to supply the TCS sensor. Unfortunately I got the same issue....I'll try to repeat test using 3.3V for all sensors ...
It is a 3.3V device and you must use logic level shifters with a 5V Arduino. If they are not included on the sensor module, you may have damaged or destroyed it.
Pololu's products usually (if not always) include the level shifters.
When starting to work with new I2C devices, always run the I2C address scanner program to test communications and look for address conflicts.
There aren't I2c conflicts. addresses are ok, tested running i2cscanner() inside setup().
All sensors are connected to a SeeedStudio Grove Base Shield V2.
There are 4 x I2C on-board Grove connectors: every connector has four wires, VCC,GND,SCL,SDA.
All sensors have their own Grove Universal 4 Pin 20cm cable. Nothing else.
This is a really bad idea. You should never connect Arduino I/O pins to an unpowered device, as the unpowered device will draw power via the I/O pins. Normally the I2C bus would not work at all under these conditions, but that depends on the circuitry of the mystery boards you have.
Same behaviour disconnecting the only SDA and SCL wires from the TCS3472 and connecting them while the sketch is running.
I don't understand this either. The TCS3472 should be completely invisible to the rest of the system if the I2C bus is disconnected.
If you buy sensors from a reputable manufacturer like Adafruit, Sparkfun or Pololu, you can expect support with such problems.
After several tests, I finally found a quite satisfactory workaround.
I connected the TCS3472 Vin pin to an Arduino digital pin (pin 7 in my sketch).
Within the setup () this pin is set as OUTPUT and forced to LOW (0V) before the VL53L0X sensors initialization process (in this way the TCS3472 cannot interfere with the VL53L0X sensors initialization).
Once the initialization phase has been completed, the TCS3472 is activated by setting pin 7 to HIGH (5V) level.
Now it works!!!