The I2C multiplexer allows connecting multiple I2C devices with the same address onto a single I2C bus (PCB colour may vary).
For each multiplexed output there are 4 pins - data ports SDAx, SCLx GND ground and V for power. The "V" output can be altered from the default 3.3 volts to 5 volts by cutting the PCB trace between V and 3v3 and bridging V to 5v. The 3.3v supply is taken directly from the Pi 3v3 rail so care should be taken not to overload it. On newer versions you will find solder jumpers for both V1 (4 connectors on upper side of the pHAT) and V2 (4 connectors on the lower side of the pHAT) to allow you to have a mix of 5v and 3v3 I2C devices.
The EEPROM automatically loads the correct i2c-mux overlay and turns it into 8 individual I2C busses (/dev/i2c-3 to /dev/i2c-10 for example) allowing direct communication with the I2C devices as normal (i2cdetect / i2cget / i2cset / Python SMBUS, etc).
I initially made the prototype for a 12.8V LiFePo battery monitoring system. This meant the battery monitor boards could all be of the same design without worrying about I2C address conflicts especially useful when using small package I2C devices that didn't have enough or any address options.
Whilst you can get the same I2C multiplexer IC (TCA9548A) on breakout boards the pHAT creates a compact solution which is great for remote monitoring and graphing when coupled with a Pi Zero W (can be used with any model of Pi).
Newer models have address selection solder jumpers on the bottom (A0/A1/A2) which more than one I2C multiplexer to be used.
By default the A0/A1/A2 are pulled low (center pad connected to the pad closest to the Pi GPIO header).
Examples
- A0=LOW, A1=LOW, A2=LOW is address 0x70
- A0=HIGH, A1=LOW, A2=LOW is address 0x71
- etc. (see "Address Reference" table in the datasheet for more information)
To pull high you will first need to cut the trace between centre pad and the pad closest to the Pi GPIO header, then bridge the centre pad with the pad furthest from the Pi GPIO header.
When using the default 0x70 address the overlay is loaded automatically, if you alter the address you can either load the overlay from the command line using something like "sudo dtoverlay i2c-mux pca9548 addr=0x71" or add "dtoverlay i2c-mux=pca9548,addr=0x71" to the /boot/config.txt (assuming the address has been set to 0x71).