TCA9548A I2C Multiplexer: Use Multiple Devices with the Same Address on Arduino

Sdílet
Vložit
  • čas přidán 5. 07. 2024
  • The TCA9548A I2C switch / multiplexer allows directing I2C traffic between one main bus and up to 8 other switchable buses. Two main advantages of being able to switch between separate buses are
    1. Each bus can operate at a different voltage, allowing level translation between devices that talk to the same master controller
    2. Devices that are configured for the same I2C address can't exist on a single bus without conflict but they can co-exist in the same system if they are isolated on separate buses.
    Here's a demo project showing how to get the TCA9548A module working with Arduino, using 3 PCF8574 GPIO expanders. 2 of the expanders are configured for the same address so they are wired to 2 separate switch buses in order to interact with Arduino Uno over one main I2C bus.
    Sketch and Wiring Diagram
    github.com/GadgetReboot/TCA9548A
    TCA9548A Datasheet
    www.ti.com/lit/ds/symlink/tca9...
    Adafruit TCA9548A module
    learn.adafruit.com/adafruit-t...
    Patreon: / gadgetreboot
    #ElectronicsCreators
  • Věda a technologie

Komentáře • 31

  • @BrianThomas
    @BrianThomas Před 7 dny +1

    4 year old video and it's still giving some great and relevent content. Thank you for a very straightforward explanation. I can't thank you enough.

  • @AnotherMaker
    @AnotherMaker Před 4 lety +1

    Fantastic video. I learned a ton.

  • @onecircuit-as
    @onecircuit-as Před 4 lety +1

    Great product and nice clear explanation! 👍

  • @stevesfascinations1516
    @stevesfascinations1516 Před 4 lety +3

    Nice job! I had not thought about needing this, so far all my i2c are configurable or on unique addresses. Very well explained. Off to ali I go...

    • @GadgetReboot
      @GadgetReboot  Před 4 lety

      I had this module sitting around who knows how long, then I hard wired the address pins to a chip on a PCB and realized I should have put jumpers so I caused my own limitation when I wanted to use 2 boards together... Always good to buy random modules for those unexpected times.

  • @DrexProjects
    @DrexProjects Před 4 lety +1

    Great video! Thanks.

  • @electronic7979
    @electronic7979 Před 4 lety +2

    Helpful video 👍

  • @TheEmbeddedHobbyist
    @TheEmbeddedHobbyist Před 4 lety +3

    It's a nice chip, but you have to try and keep as much on the same bus as you can to keep the bus switching overhead to a minimum If you require full speed. Still it's a nice way of getting out of an conflicting address hole.

    • @GadgetReboot
      @GadgetReboot  Před 4 lety

      Yeah I can't imagine trying to do fast ADC or DAC things this way.

    • @ArjanvanVught
      @ArjanvanVught Před 4 lety +1

      @@GadgetReboot For fast ADC or DAC, a high-speed DMA SPI would be the preferred protocol.

  • @manasbuzruk7472
    @manasbuzruk7472 Před 4 lety

    The best!!
    Just one doubt. What is the control register address for channel selection.

  • @kamalhussain2977
    @kamalhussain2977 Před 4 lety

    Luv the work u r doing. I want monitor the capacity of my 14.6v valence batteries shud I use amp connector to rs485 to logic level converter to 4 module relay to arduino. And please how to connect?

  • @paulwoodroffe6377
    @paulwoodroffe6377 Před rokem

    Is there a tutorial as good as this, but deals with switches?
    I'm looking to have 'several' switches on a PCF8574, but connected via a TCA9548A.

  • @jyvben1520
    @jyvben1520 Před 4 lety

    yeah, small oled screens are cheap enough to make e.g. a clock (1 oled = 1 char) , but some can not change i2c address, perfect.
    black on white = daytime high visibility probably, white on black = nighttime

  • @ErdosainNueve
    @ErdosainNueve Před 3 lety

    Hi. Sorry i ask (i think you explain this but i dont understand well english, and i do not know much about electronic). Im using a tca9548a i2c with a raspberry pi zero w. I connect the tca9548a to 3.3v. and have 4 mcp23017 connected to that tca, also that mcp23017 with the same 3.3v. from the rpizero. But, i also want to connect a ht16k33 to the sda sdc of the tca9548a but, i want to connect the ht16k33 to a 5v (power from a cellphone). When i do this my program fail to execute... but if i put the ht16k33 to 3.3v works fine... so the problem here is that the tca9548a is not playing well with the different values. How i can get to work this? i mean some modules with 3.3.v and other with 5v? Thanks!!!!!

  • @rawlc.5086
    @rawlc.5086 Před 3 lety

    Hi friend, interesting device.
    So, could you (or some one else) please tellme if i'm getting this right?
    I'm trying to work with 5 GLCD SSD1306 with a pic18f4550. But this exceeds the ram's space.
    With this device, can i just have one single oled graphic display ssd1306 on my pic's program, and just declare 5 different variables that will define the 5 different adress to each glcd? (While connecting them to this device...)
    Or, i'm still having to declare the 5 GLCDs on program to recognize them? (Which is sadly not gonna help me saving ram)
    Thanks and Have a nice day.

  • @burhanuddinbhiwaniwala618

    Hello mam.... Begin just a beginner and have started learning very basic of arduino... I came across how we can expand are I/O pin in arduino... But i was wondering can we store the status of those pins in the eeprom of arduino... So even if power cuts the expander regain its previous state before the power cut

    • @GadgetReboot
      @GadgetReboot  Před 3 lety +1

      I've never used the EEProm but apparently there's examples here for reading and writing to it www.arduino.cc/en/Reference/EEPROM
      So yeah, if pin states are known like an 8 bit byte of GPIO states, that byte should easily be able to write to EEPROM using the examples and later can be read back from that location.

    • @burhanuddinbhiwaniwala618
      @burhanuddinbhiwaniwala618 Před 3 lety

      @@GadgetReboot oh...!!! thanku mam for your reply... Although i did not dive deep in the EEPROM functionality but i have learnt how to read and write to EEPROM.... And here with expander Ic's i thought that there would be a different way of implementing them.... As ARDUINO and ESP8266 have different ways to perform the Eeprom.... But know my concept of using Eeprom with expander Ic's is clear

  • @amelliamendel131
    @amelliamendel131 Před 3 lety

    going from video to video wanting see something other than the blink sketch. My teacher gave me a big with a bunch of stuff I have 3 of these

  • @kevinhoublon8630
    @kevinhoublon8630 Před rokem

    Hello, I'm a beginner and I would like to know :
    Can I control relays with this address?
    Thank you in advance 😊.
    Cordially.

    • @GadgetReboot
      @GadgetReboot  Před rokem +1

      These are logic level control signals so some sort of relay driver would still be needed and that would be hooked up to these logic outputs. So either some sort of transistor driver or a more simple way is a driver chip like ULN2003 or ULN2803
      microcontrollerslab.com/introduction-uln2803-features/

    • @kevinhoublon8630
      @kevinhoublon8630 Před rokem

      @@GadgetReboot Hello, thank you very much for your feedback 😁. I'll check the link :).
      Have a nice weekend 😄
      Kind regards 😊

    • @kevinhoublon8630
      @kevinhoublon8630 Před rokem

      @@GadgetReboot Hello, I have another question :
      Can you use the MCP23017 (a GPIO expander : m.czcams.com/video/0yIXN2nfxAA/video.html ) with the TCA9548A multiplexer?
      Thank you in advance for your precious support 😁.
      Cordially.

  • @ujwaladhaimbekar5874
    @ujwaladhaimbekar5874 Před 3 lety

    Hello
    when I am configure TCA9548A with node mcu with temp sensor and Oximeter it's not working together but it's working on the Arduino what is problem with the node muc because same Programing is Done on the Both Board
    Please tell me???? it's Imp For my project

    • @GadgetReboot
      @GadgetReboot  Před 3 lety +1

      For NodeMcu, is the TCA9548 module connected to:
      VIN to 3.3V
      GND to ground
      SDA to D2 and
      SCL to D1
      And is it just using the normal Wire library and not a special I2C library?
      Was the TCA9548 with the 2 sensors working on a different Arduino and just not NodeMcu?
      Are there I2C pull up resistors on both of the sensors connected to TCA9548? Each I2C bus is treated as a separate one and they all need resistors if not already on a sensor or module.

    • @ujwaladhaimbekar5874
      @ujwaladhaimbekar5874 Před 3 lety

      @@GadgetReboot for the Arduino mega it's working and same Programing and connection is not working on node mcu
      FOR NODE MCU connection is Done and I am using only wire library not using special Library for that and node muc and TCA9548A Is connected to the 3.3v vin and also using 4.7k pull up resister for the SDA And SCL pin Please give me the solution it's help me too out form this problem

    • @GadgetReboot
      @GadgetReboot  Před 3 lety

      @@ujwaladhaimbekar5874 The way I would try to figure it out is first eliminate anything extra to see if it's even related to TCA9548, so does it work if just one I2C sensor is directly connected to Node MCU? Also, if the sensors are powered from 5v on mega, are they also powered from 5v for Node MCU or are those on 3.3V? The TCA9548 should be powered from 3.3v but if the sensors can't run on 3.3v they can be hooked to 5v and the TCA9548 can work with 5V sensors.
      Maybe the sensors need 5V and you may have used 3.3v and it won't work?

    • @ujwaladhaimbekar5874
      @ujwaladhaimbekar5874 Před 3 lety

      @@GadgetReboot for the Arduino mega both the sensor Are operate on 3.3v and in mega also I am connected to 3.3 v only
      When I am interface them in Separate then it's work But when I am connected them together then only oximeter work and temp sensor not shown any reading.

    • @GadgetReboot
      @GadgetReboot  Před 3 lety +1

      @@ujwaladhaimbekar5874 It would probably be easier if there were wiring diagrams for both setups and the sketch somewhere for people to see and then maybe someone can identify something easily.
      Another thing that has happened to me that made no sense with Node MCU is using a different board file for it in the Arduino IDE where suddenly some things stopped working until I changed it to other versions. Right now I am using esp8266 version 2.4.2 in the Boards manager. I remember when I used newer ones, some things didn't work.