YOU WILL NEED THIS BOARD

I2C Switch
4 Channel PCA9546 I2C Multiplexer for the Raspberry Pi and Single-Board Computers
£5.59 ex VAT
C Library to use with I2C Switch Raspberry Pi development board.
The example C programs can be found in /ABElectronics_C_Libraries/I2CSwitch/demos
Downloading and Installing the library
To download to your Raspberry Pi type in the terminal:
git clone https://github.com/abelectronicsuk/ABElectronics_C_Libraries.git
Functions
switch_channel(uint8_t address, uint8_t channel)
Enable the specified I2C channel and disable other channels
Parameter: (uint8_t) address - I2C address for the target device. Default = 0x70
Parameter: (uint8_t) channel - 1 to 4
Returns: (char) 0 = success, -1 = error switching to channel
set_channel_state(uint8_t address, uint8_t channel, uint8_t state)
Sets the state of the specified I2C channel.
All other channels keep their existing state.
Parameter: (uint8_t) address - I2C address for the target device. Default = 0x70
Parameter: (uint8_t) channel - 1 to 4
Parameter: (uint8_t) state - 0 = channel off, 1 = channel on
Returns: (char) 0 = success, -1 = error setting channel state
get_channel_state(uint8_t address, uint8_t channel)
Gets the state of the specified I2C channel
Parameter: (uint8_t) address - I2C address for the target device. Default = 0x70
Parameter: (uint8_t) channel - 1 to 4
Returns: (char) 0 = channel off, 1 = channel on, -1 = error getting channel state
reset()
Reset the I2C switch. All channels are set to off.
Returns: (char) 0 = reset complete, -1 = reset failed
Also useful for your Raspberry Pi project
Temperature & Sensing
1 Wire Pi Plus
Connect dozens of 1-Wire sensors - temperature, iButtons, EEPROMs - via a single GPIO pin. Stacks directly on the 40-pin header.
Analogue I/O
ADC Pi
Read up to 8 analogue inputs - perfect for pairing with your temperature sensors or other analogue-output devices.
All-in-one
Expander Pi
Combines ADC, DAC, 32 GPIO ports and a real-time clock on one board. The most versatile board for complex Raspberry Pi projects.