Connect Up to 64 I2C Modules - TCA9548A I2C Multiplexer Module - Arduino

by RonFrtek in Circuits > Arduino

3672 Views, 0 Favorites, 0 Comments

Connect Up to 64 I2C Modules - TCA9548A I2C Multiplexer Module - Arduino

Connect Up to 64 I2C Modules - TCA9548A I2C Multiplexer Module - Arduino

In this tutorial we will learn how to connect multiple I2C modules on the TCA9548A I2C Multiplexer Modules.

For this project we will use 3 TCA9548A I2C Multiplexer Modules and 3 I2C Displays.

Watch the Video!

Also check out this tutorials:

Arduino Connect Multiple I2C Devices

Adafruit TCA9548A 1-to-8 I2C Multiplexer Breakout

TCA9548A I2C Multiplexer Module - With Arduino and NodeMCU

What You Will Need

tca9548a.png
F7WXB0JJJ4ZYGGX.LARGE.jpg
i2c-1602-lcd-display-module-500x500.jpg
arduino-mega-2560-500x500.jpg
VisuinoAdvrtisementVersion8.jpg
FMT2X9VKEY93G5P.jpg
FMMM5N5KEY93G5M.jpg
  • Arduino Mega 2560 or any other Arduino board

Note: We are using Arduino Mega in this case because OLED Displays consume more memory and Aruino UNO would not be able to handle that.

So choose your board according to your modules.8-Channel I2C module

  • 3X TCA9548A4
  • 2X OLED Displays (or any number of other I2C modules)
  • 1X I2C LCD
  • Breadboard
  • Jumper wires
  • Visuino software: Download here

The Circuit

2021-01-07_16-29-44.jpg
  • Connect All TCA9548 modules pin SDA to Arduino pin SDA
  • Connect All TCA9548 modules pin SCL to Arduino pin SCL
  • Connect All TCA9548 modules pin VIN to Arduino pin 5V
  • Connect All TCA9548 modulesTCA9548A pin GND to Arduino pin GND

Set the I2C Address:

  • 0x70 (In Visuino 112) Connect Arduino pin GND to First TCA9548A pin A0,A1,A2
  • 0x71 (In Visuino 113) Connect Arduino pin GND to Second TCA9548A pin A1,A2 and Arduino pin 5V to Second TCA9548A pin A0
  • 0x72 (In Visuino 114) Connect Arduino pin GND to Third TCA9548A pin A0,A2 and Arduino pin 5V to Third TCA9548A pin A1

  • Connect LCD Display pin VCC to Arduino pin 5V
  • Connect LCD Display pin GND to Arduino pin GND
  • Connect LCD Display pin SDA to First TCA9548A pin SD0
  • Connect LCD Display pin SCL to First TCA9548A pin SC0
  • Connect OLED Display1 pin VCC to Arduino pin 5V
  • Connect OLED Display1 pin GND to Arduino pin GND
  • Connect OLED Display1 pin SDA to Second TCA9548A pin SD0
  • Connect OLED Display1 pin SCL to Second TCA9548A pin SC0
  • Connect OLED Display2 pin VCC to Arduino pin 5V
  • Connect OLED Display2 pin GND to Arduino pin GND
  • Connect OLED Display2 pin SDA to Third TCA9548A pin SD0
  • Connect OLED Display2 pin SCL to Third TCA9548A pin SC0

Start Visuino, and Select the Arduino MEGA Board Type

FRWQB80K1RVKKV9.LARGE.jpg
mega-visuino.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino Mega 2560" as shown on Picture 2

in Visuino Add & Set Components

2021-01-07_17-33-46.jpg
2021-01-07_17-33-24.jpg
2021-01-07_17-34-40.jpg
2021-01-07_17-37-13.jpg
2021-01-07_17-42-44.jpg
2021-01-07_17-39-18.jpg
2021-01-07_17-41-02.jpg
2021-01-07_17-41-20.jpg
2021-01-07_17-42-23.jpg
  • Add "Liquid Crystal Display (LCD) - I2C" component
  • Add 2X "OLED" component
  • Add 3X "8-Channel I2C Switch TCA9548A" component
  • Select "I2CSwitch1" and in the properties window set "Address" to 112
  • Select "I2CSwitch2" and in the properties window set "Address" to 113
  • Select "I2CSwitch3" and in the properties window set "Address" to 114

(You can use this online tool to convert Hexadecimal to Decimal)

  • Double click on the "LiquidCrystalDisplay1" and in the Elements window drag "Text Field" to the left side and in the properties window set "Initial Value" to I2C-1
  • Double click on the "DisplayOLED1" and in the Elements window drag "Draw Text" to the left side and in the properties window set "Size" to 3 and "Text" to I2C-2
  • Double click on the "DisplayOLED2" and in the Elements window drag "Draw Text" to the left side and in the properties window set "Size" to 3 and "Text" to I2C-3

in Visuino Connect Components

2021-01-07_17-46-11.jpg
i2c-m.png
  • Connect "LiquidCrystalDisplay1" pin I2C Out to "I2CSwitch1" pin I2C 0
  • Connect "DisplayOLED1" pin I2C Out to "I2CSwitch2" pin I2C 0.
  • Connect "DisplayOLED2" pin I2C Out to "I2CSwitch3" pin I2C 0

Note: In case you are using others modules/sensors as well then just connect their I2C pins the same way.

  • Connect "I2CSwitch1" pin I2C Control to Arduino pun I2C In
  • Connect "I2CSwitch2" pin I2C Control to Arduino pun I2C In
  • Connect "I2CSwitch3" pin I2C Control to Arduino pun I2C In

Generate, Compile, and Upload the Arduino Code

2021-01-07_17-53-08.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino Mega module, the Displays will start to show the text.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it and open it in Visuino: https://www.visuino.eu