which i2c multiplexer is appropriate to install multiple HMC5883L sensors on UNO

which i2c multiplexer is appropriate to install multiple HMC5883L sensors on UNO arduino board?
i want to see the outputs of multiple hmc5883l. but their I2CBUS addresses are the same. so i have to use i2cmultiplexer.

Check - Overview | Adafruit TCA9548A 1-to-8 I2C Multiplexer Breakout | Adafruit Learning System

thank you.
is this mauled CD74HC4067 or PCA9555 GPIO ok??

When using a analog multiplexer, the SCL lines can be connected to all Slaves and the SDA can be multiplexed to each Slave. However, every unused SDA line must be held high with a pullup resistor.

Therefor the CD74HC4067 can be used if you have to, but the Adafruit TCA9548A module is a lot easier.
The PCA9555 is a I2C GPIO expander, that can not be used to multiplex the I2C bus.

thank you. your information is very good. i have another one question. i read the TCA9538 data sheet. is is not similar to TCA9548. is TCA9538 good, too?? because i cant find TCA9548 in my country .

The TCA9538 is a I2C GPIO expander, just like the PCA9555. They provide extra input and output pins.

You can use a common multiplexer to switch the SDA for the different sensors. But you have to be careful with the pullup resistors. Every SDA before and after the multiplexer must have a pullup resistor and the SCL may not have too many pullup resistors.
Multiplexer tutorial: Gammon Forum : Electronics : Microprocessors : 74HC4051 multiplexer / demultiplexer.

The Arduino Uno is a 5V board with 5V SDA and SCL signals.
The HMC5883L is a 3.3V sensor with 3.3V SDA and SCL signals.
If you connect the HMC5883L to the Arduino Uno without I2C level shifter, it might not work.

The special chips, like the TCA9548A, have often the I2C level shifting included in the chip.

You could try a software I2C library. Most of them can create multiple instances for multiple software-I2C busses.

There are a number of possibilities, but you need extra hardware. Do you have a I2C level shifter ? Suppose you use the Arduino Uno, with I2C level shifter to a multiplexer for 8 HMC5883L. Perhaps you have to remove pullup resistors from the HMC5883L modules, then 8 magnetometers is no problem.

I see another problem: The I2C bus is slow. Requesting data from a number of sensors is therefor slow. Is requesting data from the sensors about 10 times per second okay ? Or do you want it faster ?


thank you very much. i fine some thing. first of all, i think i need output data rate about 80hz or 100 hz… so i think 10 times per second sounds bad.
i get some information from you and i can wiring such the image i attached.
what is your opinion?
is it correct? when the i0-0 is selected, i can read the HMC5883L outputs and use its library. actually, the arduino is ready to read the HMC#1
when the i0-1 is selected the arduino is ready to read the HMC#2

. sorry my picture has low quality

The PCA9555 provides extra input and output pins. It is not an multiplexer. You can not use it for the SDA signal.

There is no I2C level shifter.

THANK YOU VERY MUCH. i understand your explanation. so i think the these breakout modules are appropriate:
1: TCA9548
2: PCA9544A
3: LTC4314

can i buy its ic and use it like this :

i want to bye the raw breakout and fix the ic onto it.
is it good?

Yes, all of those are I2C multiplexers with level shifting for SDA and SCL included in the chip.

The PCA9540BD code is for two I2C channels. I think it will almost be the same for the 4-channel and 8-channel multiplexers.
The LTC4314 is different, you have to read the datasheet or find code for it.