AZ-Delivery TCA9548A User manual

Welcome!
Thank you for purchasing our AZ-Delivery TCA9548A I2C Multiplexer
Module. On the following pages, you will be introduced to how to use and set-
up this handy device.
Have fun!

Table of Contents
Introduction....................................................................................................3
Specifications................................................................................................4
The pinout.....................................................................................................
Connection schematic...................................................................................8
The connection schematic is shown on the following image:........................8
How to set-up Arduino IDE............................................................................9
How to set-up the Raspberry Pi and Python...............................................13
Connecting the modules with Atmega328p.................................................14
Sketch examples.....................................................................................16
Connecting the modules with Raspberry Pi.................................................18
Libraries and tools for Python..................................................................20
Enabling the I2C interface...........................................................................21
Python script............................................................................................23
- 2 -

Introduction
The TCA9548A I2C Multiplexer Module is a device made around
TCA9548A chip that simplifies using multiple I2C devices with one
microcontroller. It is an eight-channel (bidirectional) I2C multiplexer which
allows eight separate I2C devices to be controlled by a single host on single
I2C bus.
The TCA9548A chip has eight bidirectional translating switches that can be
controlled through the I2C bus. The module can connect several different
devices with a single microcontroller.
If some of the devices connected to the same channel have same I2C
address, the issue can be solved by simply connecting to other channel, if
the device does not have a configurable I2C address DIP switch or jumper.
- 3 -

Specifications
Operating voltage range 1.65V - 5.5V
Operating current 100mA (max.)
Input current 20mA
Output current 25mA
Input tolerance voltage 5V (max.)
Interface I2C
I2C input channels 8
I2C output 1
Storage temperature -65 - 150℃
Dimensions 22x32x2. mm (0.8x1.2x0.1in)
The max of 8 of these multiplexers can be connected together on 0x 0-
0x addresses in order to control 64 of the same I2C addressed parts. By
connecting the three address bits A0, A1 and A2 to VIN it can get different
combination of the addresses. This is how an address byte of the
TCA9548A looks like. First -bits combine to form the slave address. The
last bit of the slave address defines the operation (read or write) to be
performed. When it is high (1), a read is selected, while a low (0) selects a
write operation.
NOTE: The TCA9584A module can also act as logic level converter; i.e. all
I2C devices can have their own power supply/voltage. Further explanations
of this functionality is not in the scope of this eBook.
- 4 -

Features
•I2C Bus and SMBus Compatible
•Active-Low Reset Input
•Three Address Pins, Allowing up to Eight TCA9548A Devices on the I2C
Bus
•Channel Selection Through an I2C Bus, In Any Combination
•Power Up With All Switch Channels Deselected • Low RON Switches •
Allows Voltage-Level Translation Between 1.8-V, 2.5-V, 3.3-V, and 5-V
Buses
•No Glitch on Power Up • Supports Hot Insertion • Low Standby Current •
Operating Power-Supply Voltage Range of 1.65 V to 5.5 V
•5-V Tolerant Inputs • 0- to 400-kHz Clock Frequency • Latch-Up
Performance Exceeds 100 mA Per JESD 8, Class II
•ESD Protection Exceeds JESD 22 – ±2000-V Human-Body Model (A114-
A) – 200-V Machine Model (A115-A)
•±1000-V Charged-Device Model (C101)
- 5 -

Chan in the I2C address of the TCA9548A
The bus address of the TCA9548A is changed by using the connections to
the A0, A1 and A2 pins. By default use of 0x 0 address, by wiring A0-A2 to
GND(LOW). Using the table below, it can be reconfigured to an address
between 0x 0 and 0x by matching the inputs to HIGH(5V) or LOW(GND):
INPUTS I2C BUS SLAVE ADDRESS
A2 A1 A0
L L L 112 (decimal), 0 (hexadecimal)
L L H 113 (decimal), 1 (hexadecimal)
L H L 114 (decimal), 2 (hexadecimal)
L H H 115 (decimal), 3 (hexadecimal)
H L L 116 (decimal), 4 (hexadecimal)
H L H 11 (decimal), 5 (hexadecimal)
H H L 118 (decimal), 6 (hexadecimal)
H H H 119 (decimal), (hexadecimal)
- 6 -

The pinout
The module has 24 pins. The pinout is shown on the following image:
- -

Connection schematic
The connection schematic is shown on the following image:
The schematic represents example of multiple devices connected to
different channels.
- 8 -

How to set-up Arduino IDE
If the Arduino IDE is not installed, follow the link and download the
installation file for the operating system of choice. The Arduino IDE version
used for this eBook is 1.8.13.
For Windows users, double click on the downloaded .exe file and follow
the instructions in the installation window.
- 9 -

For Linux users, download a file with the extension .tar.xz, which has to
be extracted. When it is extracted, go to the extracted directory and open
the terminal in that directory. Two .sh scripts have to be executed, the first
called arduino-linux-setup.sh and the second called install.sh.
To run the first script in the terminal, open the terminal in the extracted
directory and run the following command:
sh arduino-linux-setup.sh user_name
user_name - is the name of a superuser in the Linux operating system. A
password for the superuser has to be entered when the command is
started. Wait for a few minutes for the script to complete everything.
The second script called install.sh, has to be used after the installation
of the first script. Run the following command in the terminal (extracted
directory): sh install.sh
After the installation of these scripts, go to the All Apps, where the Arduino
IDE is installed.
- 10 -

Almost all operating systems come with a text editor preinstalled (for
example, Windows comes with Notepad, Linux Ubuntu comes with
Gedit, Linux Raspbian comes with Leafpad, etc.). All of these text
editors are perfectly fine for the purpose of the eBook.
Next thing is to check if your PC can detect an Atmega328p board. Open
freshly installed Arduino IDE, and go to:
Tools > oard > {your board name here}
{your board name here} should be the Arduino/Genuino Uno, as it can
be seen on the following image:
The port to which the Atmega328p board is connected has to be selected.
Go to: Tools > Port > {port name goes here}
and when the Atmega328p board is connected to the USB port, the port
name can be seen in the drop-down menu on the previous image.
- 11 -

If the Arduino IDE is used on Windows, port names are as follows:
For Linux users, for example port name is /dev/ttyU Bx, where x
represents integer number between 0 and 9.
- 12 -

How to set-up the Raspberry Pi and Python
For the Raspberry Pi, first the operating system has to be installed, then
everything has to be set-up so that it can be used in the Headless mode.
The Headless mode enables remote connection to the Raspberry Pi,
without the need for a PC screen Monitor, mouse or keyboard. The only
things that are used in this mode are the Raspberry Pi itself, power supply
and internet connection. All of this is explained minutely in the free eBook:
Raspberry Pi Quick tartup Guide
The Raspbery Pi O operating system comes with Python preinstalled.
- 13 -

BME280 pin TCA9548A pin Wire color
VIN 5V (Atmega328p 5V) Red wire
GND GND (Atmega328p
GND)
Black wire
SDA SD0 Blue wire
SCL SC0 Green wire
TCA9548A pin Mc pin Wire color
VIN 5V Red wire
GND GND Black wire
SDA A4 Blue wire
SCL A5 Green wire
OLED pin TCA9548A pin Wire color
SDA SD1 (CH1) Blue wire
SCL SC1 (CH1) Green wire
VCC 5V (Atmega328p pin) Red wire
GND GND (Atmega328p
pin)
Black wire
- 15 -

Sketch examples
#include <U8g2lib.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME28 .h>
Adafruit_BME28 bme;
#define TCAADDR x7
U8G2_SSD13 6_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R , U8X8_PIN_NONE);
void TCA9548A(uint8_t bus) {
Wire.beginTransmission( x7 );
Wire.write(1 << bus);
Wire.endTransmission();
}
void u8g2_prepare() {
u8g2.setFont(u8g2_font_6x1 _tf);
u8g2.setFontRefHeightExtendedText();
u8g2.setDrawColor(1);
u8g2.setFontPosTop();
u8g2.setFontDirection( );
}
void setup() {
Wire.begin();
Serial.begin (96 );
TCA9548A( );
bool communication = bme.begin( x76);
TCA9548A(1);
u8g2.begin();
u8g2_prepare();
- 16 -

}
void loop(void) {
TCA9548A( );
float temperature = bme.readTemperature();
float pressure = bme.readPressure()/1 ;
float humidity = bme.readHumidity();
TCA9548A(1);
u8g2.clearBuffer();
u8g2_prepare();
u8g2.setFont(u8g2_font_6x1 _tf);
u8g2.drawStr( , , "Temperature: ");
u8g2.setCursor(75, );
u8g2.print(temperature);
u8g2.println();
u8g2.drawStr( , 1 , "Pressure: ");
u8g2.setCursor(75, 1 );
u8g2.print(pressure);
u8g2.println();
u8g2.drawStr( , 2 , "Humidity: ");
u8g2.setCursor(75, 2 );
u8g2.print(humidity);
u8g2.println();
u8g2.sendBuffer();
delay(1 );
}
- 1 -

Connectin the modules with Raspberry Pi
Connect the modules with the Raspberry Pi as shown on the following
image:
- 18 -

TCA9548A pin Raspberry Pi pin Physical pin Wire color
VIN 3.3V 1 Red wire
GND GND 14 Black wire
SDA GPIO2 3 Green wire
SCL GPIO3 5 Blue wire
A0, A1, A2 GND 14 Black wire
BME280(1) PIN TCA9548A pin Raspberry Pi pin Wire color
SCL SC0 Blue wire
SDA SD0 Green wire
VIN VIN 3.3V (PIN1) Red wire
GND GND GND (PIN14) Black wire
BME280(2) PIN TCA9548A pin Raspberry Pi pin Wire color
SCL SC1 Blue wire
SDA SD1 Green wire
VIN VIN 3.3V (PIN1) Red wire
GND GND GND (PIN14) Black wire
- 19 -

Libraries and tools for Python
To use the module with the Raspberry Pi, the library RPi.GPIO has to be
installed. If the library is already installed, running the installation command
only updates the library to a newer version.
To install the library, open the terminal and run the following commands,
one by one:
sudo apt-get update && sudo apt-get upgrade
sudo apt install python3-pip
sudo apt install git
git clone https://github.com/pimoroni/bme280-python
cd bme280-python
sudo ./install.sh
- 20 -
Table of contents
Popular Multiplexer manuals by other brands

ADTRAN
ADTRAN OPTI-6100 LMX Specification sheet

ZyXEL Communications
ZyXEL Communications IES-1248-51A user guide

Patton electronics
Patton electronics 3028 Turbo Installation and operator's manual

Actisense
Actisense NMEA 0183 Install & user manual

OCENAV
OCENAV ATM105A1N manual

Vicon
Vicon AURORA 2000 quick guide