Datasheet
Wiring & Test
The TCA9548A multiplexer is interesting in that it has an I2C address (0x70 by default) -
and you basically send it a command to tell it which I2C multiplexed output you want to talk
to, then you can address the board you want to address.
We suggest using this little helper to help you select the port
#define TCAADDR 0x70
void tcaselect(uint8_t i) {
if (i > 7) return;
Wire.beginTransmission(TCAADDR);
Wire.write(1 << i);
Wire.endTransmission();
}
You can then call tcaselect(0) thru tcaselect(7) to set up the multiplexer.
Note that you if you happen to have I2C devices with I2C address 0x70, you will need to
short one of the Addr pins on the TCA9548 breakout to Vin in order to make it not conflict.
Given that you can have 0x70 thru 0x77, just find one that's free and you're good to go!
Example Multiplexing
For example, say we want to talk to two HMC5883 breakouts. These magnetometers have
a fixed address of 0x1E so you cannot have two on one I2C bus. Wire up the TCA9548
breakout so that:
Vin is connected to 5V (on a 3V logic Arduino/microcontroller, use 3.3V)
GND to ground
SCL to I2C clock
SDA to I2C data
Then wire up each of the other sensor breakouts to Vin, Ground and use one of the SCn /
SDn multiplexed buses:
© Adafruit Industries
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-
breakout
Page 14 of 21










