Analog Mux as Cheap I2C Mux?

Analog multiplexers work just fine for I²C signals (if you keep the impedance and parasitic cpacitance small enough, which is usually not a problem).

I²C multiplexers are more complex because they are controlled through the I²C bus itself. You need one if you do not have a spare GPIO pin to control it.

You don’t need expensive low-R analog switches. Simple parts like 74HC4066 and 74HC4053 or the single gate versions work just fine for $0.11 – and you get 2 or 3 more switches to use for other things. (But see diode solution for $0.015…)

You can just switch the SDA line alone, and leave SCL common to all chips. Thus you only need a single mux or switch.

Make sure to have a high value (100k) pullup at each chip in addition to the bus pullup.

(this works because the start condition is SDA falling. If SDA is kept high, the chip will never see START)

“… they’d all made a big mistake coming down from the trees in the first place, and some said that even the trees had been a bad move, and that no-one should ever have left the oceans.”

Using tri-state port pins for _EN1 and _EN2, you set the pin to OUTPUT-HI to BLOCK the slave, and INPUT-no-pullups to enable the slave.
A BAW56 dual diode costs $0.015.
Who needs more than a diode anyway?

SCL is common and unswitched.
Obviously the selection can only be changed when the bus is idle.

enter image description here

If this is a bit rich for you, the 2k2 master pullup can be omitted, and the 22k resistors replaced by 2k2. As one of the _EN lines is always HI, its resistor will act as the bus pullup. Now you are down to 2 resistors and 1x BAW56 vs 3 resistors+1xIC for the analog switch solution.

Leave a Comment