Using 74hc153 mux as i2c multiplexer

I try to connect 2bmp180 sensor to i2c uno bus And because they have same address ineed to use multiplexer and unfortuntly the tca9548 not available handly so ihave 74hc153 and 74hc151 My inquiry is can use 74hc1t3 as i2c multiplexer Thanks

No, sorry, I don't think that is possible. The I2C bus is bidirectional.

Dedicated chips like the PCA9544A are often used, but a normal multiplexer can be used as well: https://www.gammon.com.au/forum/?id=11976.

If you don't have that, do you have CD4016 or CD4066 type switches ? I have never heard that it is used to multiplex a I2C bus, but it should be possible.

You could also try a software I2C library for one BMP180. You might need to change a library to use the software I2C library instead of the Arduino Wire library. When you use a software I2C library for both BMP180s, then you can share the SCL signal, so you need only 3 pins.

On this forum, you can click "Modify" or "Quick Edit" to change your post and fix the typing errors.

Or an analog mux like 4052.

thanks for fast reply Koepel , did u mean by sharing scl signal that the both bmp180 scl pin in one wire Thanks advance

Yes, a single SCL pin from the Arduino board to all the SCL pins of the BMP180 chips.

In most cases, the SCL can be shared with multiple hardware I2C busses, with multiple I2C buses using software I2C libraries and with multiplexers.

My link to https://www.gammon.com.au/forum/?id=11976 and the analog mux mentioned by Smajdalf is the same thing. A analog mux is the second best option after the dedicated I2C multiplexer chips.

You only have to use a 74HC4051 or 4052 for the SDA, you can share the SCL (connect all the SCL together).

For the SoftwareWire library, you can do this:

#include <SoftwareWire.h>
SoftwareWire myWire1( 2, 4);  // bus 1: sda at 2, scl at 4
SoftwareWire myWire2( 3, 4);  // bus 2: sda at 3, scl at 4

Note: The BMP180 is a 3.3V sensor, you can damage it when connecting it to a 5V Arduino board via the I2C bus.

Just use a 74HC4052 and switch both lines. :grinning:

Simple. Need pull-ups on both slaves.

Dear all Thanks and Appreciation for you Iam little confused l have been loocked for cd4052 in market and didnot findlike that but found cd4066 (74HC4066; 74HCT4066 Quad single-pole single-throw analog switch) and cd4016 ( wuad bilateral switch analog digital multplexer ) accirding to datasheet i see the both can be used insteadof the cd4052 but i sm realy need you to correct my and advice Thanks Sermad

CD4016/ CD4066 - and most of the CD series is obsolete unless you need to use a supply voltage greater than 5 V.

The 74HC versions have vastly better performance, so please do not refer to "CD'.

The 74HC4052 is the device you want.

Thanks gentlemen
Iwill try replacing the both pot by two bmp180 and sharing the scl pin and coding
Will that be successful pls
Your advice if that correct or not
And pls can give example for using the softwarei2c lib with two bmp180
And does it need to edit the cpp file
Thanks again

Two bmp180 .pdf (219 KB)