Qwiic MUX Hookup Guide

Contributors: Englandsaurus
Favorited Favorite 0


PCA9548A and TCA9548A? The SparkX version of the Qwiic Mux breakout used the PCA9548A. The SparkFun red version uses the TCA9548A. Overall, both should be functionally the same with a few minor differences.

The Qwiic Mux - TCA9548A enables communication with multiple I2C devices that have the same address. The IC is simple to interface with and also has 8 configurable addresses of its own, this allows you to put 64 I2C buses on a single bus!

SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A)

SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A)


In this tutorial we'll go over how to talk to sensors on different channels of your MUX. The application of this is pretty straightforward so things won't get too fancy.

Required Materials

To get started, you'll need a microcontroller to, well, control everything.

SparkFun RedBoard - Programmed with Arduino

SparkFun RedBoard - Programmed with Arduino

SparkFun ESP32 Thing

SparkFun ESP32 Thing

Particle Photon (Headers)

Particle Photon (Headers)


Raspberry Pi 3


Now to get into the Qwiic ecosystem, the key will be one of the following Qwiic shields to match your preference of microcontroller:

SparkFun Qwiic Shield for Arduino

SparkFun Qwiic Shield for Arduino

SparkFun Qwiic HAT for Raspberry Pi

SparkFun Qwiic HAT for Raspberry Pi

SparkFun Qwiic Shield for Photon

SparkFun Qwiic Shield for Photon


You will also need a Qwiic cable to connect the shield to your MUX, choose a length that suits your needs.

Qwiic Cable - 100mm

Qwiic Cable - 100mm

Qwiic Cable - 200mm

Qwiic Cable - 200mm

Qwiic Cable - 500mm

Qwiic Cable - 500mm

Qwiic Cable - 50mm

Qwiic Cable - 50mm



Depending on your setup, you may need a soldering iron, solder, and general soldering accessories.

Solder Lead Free - 100-gram Spool

Solder Lead Free - 100-gram Spool

Weller WLC100 Soldering Station

Weller WLC100 Soldering Station


Suggested Reading

If you aren't familiar with the Qwiic system, we recommend reading here for an overview.

Qwiic Connect System
Qwiic Connect System

We would also recommend taking a look at the following tutorials if you aren't familiar with them.


An introduction to I2C, one of the main embedded communications protocols in use today.

Qwiic Shield for Arduino & Photon Hookup Guide

Get started with our Qwiic ecosystem with the Qwiic shield for Arduino or Photon.

Hardware Overview

What is the difference between the PCA9548A and TCA9548A? Very little. PCA is made by NXP, TCA is made by TI. PCA can operate from 2.3 to 5.5V, TCA can operate from 1.65 to 5.5V. Everything else is identical.

Let's look over a few characteristics of the TCA9548A so we know a bit more about how it behaves.

Operating Voltage1.65V - 5.5V
Operating Temperature-40 - 85° C
I2C Address0x70 (default) up to 0x77 (see below table)

The Qwiic input for the Mux is located at the top-center of the board, labeled Main, highlighted in the image below. The outputs are then located on the left and right sides of the board and are numbered accordingly.

Main Qwiic Port

The onboard reset pin, highlighted below, is an active low input. Pulling reset low for at least 6 ns will restart the multiplexer.

Reset Pin

The Qwiic Mux also allows you to change the last 3 bits of the address byte, allowing for 8 jumper selectable addresses if you happen to need to put more than one Mux on the same I2C port. The address can be changed by adding solder to any of the three ADR jumpers, shown in the image below.

Address Jumpers

The below table shows which jumpers must be soldered together to change to the corresponding address.


If you want to remove the pullup resistors from the I2C bus, simply remove the solder from the jumper highlighted in the below image.

Pullup Jumper

Hardware Assembly

If you haven't yet assembled your Qwiic Shield, now would be the time to head on over to that tutorial.

With the shield assembled, SparkFun's new Qwiic environment means that connecting the mux could not be easier. Just plug one end of the Qwiic cable into the Qwiic multiplexer breakout, the other into the Qwiic Shield of your choice and you'll be ready to upload a sketch and figure out just how all those address sharing sensors are behaving. It seems like it's too easy to use, but that's why we made it that way!

Mux Connected to Shield

Example Code

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

SparkFun has written some example code to enable and disable ports on the Qwiic Mux. Go ahead and download this example code here.

Additionally, you will need to install the MMA8452Q Arduino library if you are using two MMA8452Q accelerometers. First, you’ll need the Sparkfun MMA8452Q Arduino library. You can obtain these libraries through the Arduino Library Manager. Search for Sparkfun MMA8452Q Accelerometer by Jim@SparkFun Electronics to install the latest version. If you prefer downloading the libraries from the GitHub repository and manually installing it, you can grab them here:

Arduino Example Example1-BasicReadings.ino

Opening Example1-BasicReadings will open two tabs in the Arduino IDE, the first example, and also Mux_Control. Let's take a look under the hood of Mux_Control to get an idea of what's going on. There are two functions here, boolean enableMuxPort(byte portNumber) and boolean disableMuxPort(byte portNumber) which is pretty much all we need to specify which channels we'd like to talk to on the Mux. If we have a sensor on channel 0, we simply call enableMuxPort(0) to open that channel on the multiplexer. Then we'll take whatever reads and perform whatever actions we'd like to the sensor on that channel. Once finished, we have to call disableMuxPort(0) to close communication on that channel so we don't accidentally perform actions on the sensor on that channel. The below example code shows how to read from two MMA8452Q accelerometers.

#include <Wire.h>
#include <SFE_MMA8452Q.h> //From: https://github.com/sparkfun/SparkFun_MMA8452Q_Arduino_Library

MMA8452Q accel;


void setup()
  Serial.println("Qwiic Mux Shield Read Example");


  //Initialize all the sensors
  for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)
    enableMuxPort(x); //Tell mux to connect to port X
    accel.init(); //Init the sensor connected to this port

  Serial.println("Mux Shield online");

void loop()
  for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)
    enableMuxPort(x); //Tell mux to connect to this port, and this port only

    if (accel.available())

      Serial.print("Accel ");
      Serial.print(": ");
      Serial.print(accel.cx, 2);
      Serial.print(" ");
      Serial.print(accel.cy, 2);
      Serial.print(" ");
      Serial.print(accel.cz, 2);
      Serial.print(" ");

      Serial.println(); // Print new line every time.

    disableMuxPort(x); //Tell mux to disconnect from this port

  delay(1); //Wait for next reading

With the example provided, you should be able to read two I2C sensors with the same address on the same bus! Try opening up the Arduino Serial Monitor set to 9600 baud in order to read the sensor values.

Resources and Going Further

Now that you've successfully got your Qwiic mux listening to all of those concurrent addresses, it's time to incorporate it into your own project!

For more information, check out the resources below:

Need even more inspiration for your next project? Check out some of these related tutorials:

Qwiic Micro OLED Hookup Guide

Get started displaying things with the Qwiic Micro OLED.

Qwiic Quad Relay Hookup Guide

SparkFun’s Qwiic Quad Relay is a product designed for switching not one but four high powered devices from your Arduino or other low powered microcontroller using I2C.

Qwiic Pro Kit Project Guide

The Qwiic Pro Kit was designed to allow users to get started with Arduino without the need for soldering or a breadboard. We've included three inputs (a joystick, accelerometer, and proximity sensor) and one display that can be daisy chained to the RedBoard Turbo (SAMD21) Development Board.

Hookup Guide for the BlackBoard Artemis Nano

Get started with the powerful BlackBoard Artemis Nano