Adafruit TCA954BA Multiplexor and four Sparkfun VEML6075's -- PLEASE HELP

Hi all,

I am having trouble successfully finding/connecting to a few VEML6075 UV sensor breakout’s that I’m wanting to constantly read values from.

I have the VEML6075s connected to SD/SC ports 0-3 on the Adafuit TCA954BA multiplexer, When plugged in all UV senors are lighting up and appear to be connected properly.

When running the following code, it prints out

TCA Port #0

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #1

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #2

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #3

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #4

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #5

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #6

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

TCA Port #7

Failed to communicate with VEML6075 sensor1, check wiring?

Failed to communicate with VEML6075 sensor2, check wiring?

Failed to communicate with VEML6075 sensor3, check wiring?

Failed to communicate with VEML6075 sensor4, check wiring?

Here is the code I’m using:

#include <SparkFun_VEML6075_Arduino_Library.h>
#include <Wire.h>

#define TCAADDR1 0x70  //Multiplexer 1



VEML6075 uv_1; // Create VEML6075 object 1
VEML6075 uv_2; // Create VEML6075 object 2
VEML6075 uv_3; // Create VEML6075 object 3
VEML6075 uv_4; // Create VEML6075 object 4

void tcaselect(uint8_t i) {
  if (i > 7) return;
  Wire.beginTransmission(TCAADDR1);
  Wire.write(1 << i);
  Wire.endTransmission();
}


void setup(void)
{
  Serial.begin(115200);

  Wire.begin();
 
  for (uint8_t t=0; t<8; t++) {
      tcaselect(t);
      Serial.print("TCA Port #"); Serial.println(t);
      
      if(uv_1.begin() != VEML6075_SUCCESS)
      {
        // There was a problem detecting the VEML6075 ... check your connections
        Serial.println("Failed to communicate with VEML6075 sensor1, check wiring?");
      }
      if(uv_2.begin(Wire) != VEML6075_SUCCESS)
      {
        // There was a problem detecting the VEML6075 ... check your connections
        Serial.println("Failed to communicate with VEML6075 sensor2, check wiring?");
      }
      if(uv_3.begin(Wire) != VEML6075_SUCCESS)
      {
        // There was a problem detecting the VEML6075 ... check your connections
        Serial.println("Failed to communicate with VEML6075 sensor3, check wiring?");
      }
      if(uv_4.begin(Wire) != VEML6075_SUCCESS)
      {
        // There was a problem detecting the VEML6075 ... check your connections
        Serial.println("Failed to communicate with VEML6075 sensor4, check wiring?");
      }
  }

 
}

void loop(void)
{

}

Any ideas of what could be going on? Any help is greatly appreciated. Thanks in advance!

Hello downhillGames,

Since you’re using an Adafruit product and custom code, we are unable to provide full support.

If the sensors are powered correctly and you’re unable to connect then the issue might be with the multiplexor or the code. I would suggest reaching out to[ Adafruit’s Product Support to get more information.](https://forums.adafruit.com/)

It looks like the Adafruit board you have uses the same chip as our [Qwiic MUX. You might try the example code we have for the Qwiic MUX on it and see if you can select different channels and just confirm you can see whatever sensors are attached and to verify you’re actually changing channels.](https://www.sparkfun.com/products/14685)