I2C, SPI, UART & RS-485 DISCUSSION

Two I2C sensors with the same fixed address: what are my options?

Started by dewmith I2C address conflictI2C multiplexerTCA9548Aaddress translationsoftware I2C
4 replies 248 views 5 participants
Latest activity · 30 Sep 2026

Two I2C sensors with the same fixed address: what are my options?

dewmith I2C, SPI, UART & RS-485 Forum
#1

I need two identical sensors on one microcontroller, and this part has a single fixed I2C address with no address pin. With both connected, the readings are obviously the two devices answering at once.

What are the usual ways to handle this, and which is the least painful when the design might grow to four or eight of the same sensor later?

Community replies 4

Re: Two I2C sensors with the same fixed address: what are my options?

#2

First check the datasheet for an address option you may have missed. Many parts have an ADDR pin, a solder jumper on the breakout, or order codes with different addresses. Some devices, certain time-of-flight sensors for example, boot at a default address and let you assign a new one over I2C; you hold the others in reset with their shutdown pins and bring them up one at a time.

Re: Two I2C sensors with the same fixed address: what are my options?

#3

If the address really is fixed, an I2C multiplexer is the standard answer. A TCA9548A-type switch gives eight downstream channels; you write one byte to the mux to select a channel, then talk to the sensor as usual. The mux has its own address pins, so several can share a bus. This scales cleanly to eight identical sensors and costs only one extra write per channel change.

Re: Two I2C sensors with the same fixed address: what are my options?

#4

For just two sensors, a second bus is simpler than a mux. Many microcontrollers have two hardware I2C peripherals, and if not, a bit-banged software I2C on two spare pins is fine for slow sensors. The cost is pins and, for the software bus, CPU time and a lower maximum clock rate.

Re: Two I2C sensors with the same fixed address: what are my options?

#5

Two other approaches exist. An address translator IC sits in front of one device and changes the address it appears at, which keeps everything on one bus with no firmware channel switching. And some people gate SDA or power to each sensor with a transistor, but that is fragile: an unpowered device can load the bus through its protection diodes, so a proper bus switch is the safer way to do the same thing.

For a design that may grow to eight, the multiplexer is the one to plan for.

TEP COMMUNITY