Hello friends, I hope you all are doing great. Today, I am going to share the new TCA9548A I2C Multiplexer Library for Proteus Simulation. Sooner or later every I2C project meets the same wall: two sensors with the same address. Many chips have one fixed address or only two to choose from, and two of them on one bus answer together. The TCA9548A is the classic way through: one small board that turns one I2C bus into eight separate channels, so the Arduino can talk to identical devices one at a time. With this library you can run a full Proteus simulation of it and watch it switch the channels.
TCA9548A I2C Multiplexer Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Other I2C parts: VL53L1X Distance Sensor · MPR121 Touch Sensor · AT24C256 EEPROM
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo puts three VL53L1X distance sensors - a robot's left, front and right eyes, all at 0x29 - on one Arduino, and it also shows exactly what goes wrong when the three are connected at once.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the VL53L0X board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the TCA9548A I2C Multiplexer Library for Proteus Simulation:
What Is the TCA9548A I2C Multiplexer?
A 1-to-8 I2C switch. On one side it has the host bus - SDA and SCL from the microcontroller. On the other it has eight channels, SD0 and SC0 to SD7 and SC7, each a little I2C bus of its own. Inside are eight pairs of switches. The TCA9548A is itself an I2C device, and it has exactly one register: write a byte, and every bit that is 1 closes the switches of that channel. Write 0x01 and channel 0 is connected; write 0x08 and it is channel 3; write 0x00 and the host bus stands alone.
| TCA9548A | |
|---|---|
| Channels | 8 (SD0 / SC0 ... SD7 / SC7) |
| Address | 0x70 - 0x77 (A2 A1 A0) |
| Register | one byte: bit n = channel n connected |
| Takes effect | at the STOP after the write |
| Reset | RST low: all channels off |
| Supply | 1.65 - 5.5 V |
| Pins (module) | VIN GND SDA SCL RST A0 A1 A2, SD0 - SC7 |
Switches, Not a Bridge
The important word is "switch". The TCA9548A does not copy messages from one bus to another; it simply connects the wires, both ways, while a channel is selected. A device on channel 3 sees the Arduino's clock and data directly, and the Arduino sees the device's ACK and data directly. That is why it works with any I2C device, any speed up to 400 kHz, reads, writes and clock stretching alike - and why each channel needs its own pull-up resistors, which sensor modules usually have.
Selecting a Channel
Selecting is one ordinary I2C write: the multiplexer's address, one byte, STOP. The new switches close at that STOP, so the next transaction already goes to the new channel. Reading one byte from the multiplexer returns the register, a handy check that the selection arrived. Several bits can be set at once - useful when devices on different channels have different addresses - and with the three address pins up to eight multiplexers can share one bus, 64 channels in all.
Why Same-Address Devices Clash
I2C lines are open drain: a device can only pull a line low, and a line is high only when nobody pulls. Put two devices with the same address on one bus and they both answer every byte at the same time. Each bit on the wire becomes the AND of what the two sent - a 0 from either wins. Both ACK, so the host sees no error at all; it just receives a mixture of two answers. The multiplexer's cure is to keep them apart, one channel at a time. The model makes the lines a true wired-AND, so you can see the clash for yourself.
Features of the TCA9548A I2C Multiplexer Library for Proteus Simulation
- A real-looking board: the 25 x 42 mm board at its real size, with a green LED beside every connected channel while the simulation runs.
- The real register: written and read over I2C, with the switches changing at the STOP.
- Real switching: SDA and SCL bridged both ways to every connected channel - ACKs, reads and clock stretching pass, clashes happen as on the chip.
- RST and the address pins: A0 - A2 wired or set by a property, RST clears the register.
- A pop-up: the eight switches, the pin levels and traffic of every channel, the last transactions with their channels - graphs, an event log and a check page.
- A complete package: about 1.6 MB with the library, our VL53L1X sensors, our Arduino UNO V4.0 and the demo, without the source code of the model.
The TCA9548A in Proteus
The device is MUXTCA9548ATEP in TEPTCA9548A.LIB, under Modules > Interface, with the prefix U and the model TEPTCA9548A.DLL. Search TCA9548A or multiplexer in Pick Devices. On the left are VIN, GND, SDA, SCL, RST and A0 to A2; on the right the sixteen channel pins. One property: ADDRESS, used for the address pins you leave open.
Download TCA9548A I2C Multiplexer Library for Proteus Simulation
Click the button below to download TCA9548A-I2C-Multiplexer-Library-for-Proteus-v1.0.zip (about 1.6 MB, without the source code of the models):
TCA9548A I2C Multiplexer Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPTCA9548A.LIB,TEPVL53L1X.LIBandArduinoV4TEP.LIB. - Proteus Model Files:
TEPTCA9548A.DLL,TEPVL53L1X.DLLandTEPARDUINO.DLL. - Arduino Code: the demo sketch (Wire only).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install TCA9548A I2C Multiplexer Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPTCA9548A.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for TCA9548A.
Proteus Simulation of Three Same-Address Sensors
The demo uses an A4 sheet with our Arduino UNO Library for Proteus V4.0, the multiplexer U1 at 0x70 on A4 and A5, and three sensors from our VL53L1X Distance Sensor Library for Proteus - U2 LEFT at 450 mm on channel 0, U3 FRONT at 1200 mm on channel 3 and U4 RIGHT at 800 mm on channel 6. The VL53L1X has one fixed address, 0x29, and no pin to change it, which makes it the textbook case for a multiplexer. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open TCA9548A-Three-VL53L1X-ArduinoUnoV4.pdsprj.
The Sketch
The sketch needs only the Wire library. Selecting channels is a three-line function:
bool selectChannels(byte mask) {
Wire.beginTransmission(MUX);
Wire.write(mask);
return Wire.endTransmission() == 0;
The rest is ordinary sensor code that does not even know a multiplexer is there. The main loop selects each channel in turn, waits for that sensor's next distance, reads it and clears its interrupt:
for (byte i = 0; i < 3; i++) {
selectChannels(1 << CHANNEL[i]);
while (!dataReady()) ;
const uint16_t mm = rd16(0x0096);
wr8(0x0086, 0x01); // clear the interrupt: the next distance
Before that, at start-up, the sketch scans the channels, starts each sensor with ST's Ultra Lite Driver sequence on its own channel, and deliberately connects all three at once to show the clash.
TCA9548A Simulation Results
Open the project and press Run. The demo runs 3.5 simulated seconds and took about 1 minute 47 seconds on our PC with the pop-up open and the pictures being taken. Click the multiplexer for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
The Scan
The sketch first looks for the sensors. It connects each of the eight channels in turn and knocks on address 0x29; the monitor prints "VL53L1X (0x29) found on channel: 0 3 6". At the end of the run the Check page still shows the trace of that scan: exactly one transaction on each of the five empty channels - the knocks that nobody answered.
Starting the Sensors
Each sensor is then started on its own channel. The multiplexer connects channel 0, the sketch waits for the sensor's boot flag, reads its model ID (0xEACC), writes the default configuration block of ST's Ultra Lite Driver and starts ranging; then the same on channel 3 and on channel 6. This start-up is the heavy part of the traffic: by 0.58 s the host bus had carried 1,413 device transactions, about 470 on each channel, while the multiplexer itself had received only 12 control writes. That is the whole point of the chip - it is invisible to the devices behind it, and costs one short write per channel change.
All Three at Once
Then the sketch writes 0x49 - bits 0, 3 and 6 - and all three sensors are on the bus together. The pop-up turns green with "CONNECTED - control 0x49: channel(s) 0, 3, 6" and draws the three switches closed. The control register reads back 0x49, but the distance reads 0 mm. Three sensors with the same address answer the same read at the same moment, and on an open-drain bus a 0 from any of them wins, so the Arduino receives the three answers AND-ed together: 450 (0x01C2), 1,200 (0x04B0) and 800 (0x0320) AND to exactly 0. Nothing fails and nothing is NACKed - the reading is simply wrong, which is exactly why two same-address devices must never be on connected channels at the same time.
One Channel at a Time
From then on the loop selects one channel at a time, every 200 ms: 0x01 for LEFT, 0x08 for FRONT, 0x40 for RIGHT, and 0x00 at the end of each round so that no channel stays connected. LEFT reads 448 to 451 mm, FRONT 1,196 to 1,207 mm and RIGHT 797 to 804 mm - the 450, 1,200 and 800 mm set on the three sensors, with the small ranging noise of the sensor model. A whole round takes only about 3 ms of bus time, so a pause usually catches the multiplexer between two rounds: the pop-up at 1.48 s shows "ALL OFF", while its channel list keeps counting the traffic each channel has carried - 495, 497 and 495 transactions so far on channels 0, 3 and 6.
The Graphs, the Event Log and the Check Page
The Graphs page plots the control register stepping through 0x01, 0x08 and 0x40, the number of connected channels and the transactions on the host bus climbing. The Event log lists the control writes and the first transactions passed to each channel. The Check page sums up the run: Supply green at 5.00 V with the multiplexer at 0x70; the control register at 0x00 (no channel connected) after 73 control writes and 1 read, with 0 NACKs; 1,638 device transactions passed through - 545 on channel 0, 547 on channel 3, 545 on channel 6 and 1 on each empty channel (the scan); RST high, no reset.
The Arduino's built-in serial monitor tells the whole story in order: the scan, the three model IDs, "Control register read back: 0x49", the 0 mm clash, and then one line per round with the three distances.
When to Use a Multiplexer - and When Not
Reach for a multiplexer when devices share an address you cannot change: VL53L1X and VL53L0X distance sensors, many OLED displays, most humidity sensors, the BNO055 or MPU6050 when you need more than two. It also helps on long or loaded buses, because every channel adds its own capacitance only while it is selected. You do not need one for devices with selectable addresses - three of our AT24C256 EEPROM Library for Proteus chips, for example, simply take three different addresses on one bus. And some sensors offer a software address change or an XSHUT pin to wake them one by one; that works too, but the multiplexer needs no special code per device.
Try It Yourself
- Change a sensor's DIST and watch its line on the monitor follow while the others stay put.
- Move the FRONT sensor to channel 5 (and change CHANNEL[] in the sketch): the scan finds it there.
- Pull RST to GND with a wire: the register clears and every sensor read fails until the next selection.
- Set ADDRESS to 1 and MUX to 0x71 in the sketch: up to eight multiplexers can share the bus.
- Add our EEPROM on the host side of the bus: it works alongside the multiplexer, whatever channel is selected.
Ideas to Extend the Demo
- A robot with obstacle avoidance: steer away from the nearest of the three distances.
- A row of identical temperature sensors along a greenhouse, one channel each.
- Several OLED displays at 0x3C, each showing its own page.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real TCA9548A
- Pull-ups: the host side has the module's; every channel needs its own (most sensor modules have them).
- Voltages: the channels can run at 3.3 V and 5 V - the switches pass the pull-ups' levels on each side.
- RST: leave it high (the module pulls it up); tie it to a pin if you want to reset a stuck channel.
- Address: A0 - A2 select 0x70 - 0x77; the module pulls them low.
- Clashes: never connect two same-address devices at the same time - they answer together without any error.
Troubleshooting
- No device answers on a channel: write the channel's bit to 0x70 first; check that side has pull-ups and power.
- Garbage from a device: two same-address devices are connected - select only one channel.
- The first transaction after the selection fails: the selection needs its STOP - use endTransmission() normally.
- The multiplexer itself does not answer: the address does not match A0 - A2, or RST is low.
- The part is not simulated:
TEPTCA9548A.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The register, the effect at the STOP, the two-way open-drain switching, the clashes, RST and the address pins follow the TCA9548A datasheet; the board is our own drawing.
- Our own figure: a released line is weak high.
- Not modelled: the switches' on-resistance and voltage translation, the bus capacitance, the 400 kHz timing limits.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or the chip's maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the TCA9548A I2C Multiplexer Library for Proteus Simulation. I hope it takes the address headache out of your next sensor project. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!