

The Gravity 1-8 I2C Multiplexer by DFRobot is a versatile module designed to expand the capabilities of a single I2C bus. It allows up to eight I2C devices to be connected simultaneously, even if they share the same I2C address. By dynamically switching between different channels, this multiplexer eliminates address conflicts and simplifies the integration of multiple I2C devices in a single project.








Below are the key technical details of the Gravity 1-8 I2C Multiplexer:
| Parameter | Specification |
|---|---|
| Operating Voltage | 3.3V to 5V |
| Communication Protocol | I2C |
| Default I2C Address | 0x70 (modifiable via solder pads) |
| Number of Channels | 8 |
| Maximum I2C Speed | 400 kHz |
| Dimensions | 42mm x 32mm |
| Mounting Holes | 3mm diameter |
The Gravity 1-8 I2C Multiplexer features the following pin layout:
| Pin Name | Description |
|---|---|
| VIN | Power input (3.3V to 5V). |
| GND | Ground connection. |
| SDA | I2C data line (connect to the master device's SDA). |
| SCL | I2C clock line (connect to the master device's SCL). |
| CH0-CH7 | Eight I2C channels for connecting devices. Each channel has its own SDA and SCL. |
Below is an example of how to use the Gravity 1-8 I2C Multiplexer with an Arduino UNO:
#include <Wire.h>
// Define the I2C address of the multiplexer
#define TCA9548A_ADDR 0x70
// Function to select a specific channel on the multiplexer
void selectChannel(uint8_t channel) {
if (channel > 7) return; // Ensure the channel is within range (0-7)
Wire.beginTransmission(TCA9548A_ADDR);
Wire.write(1 << channel); // Activate the desired channel
Wire.endTransmission();
}
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
Serial.println("Initializing I2C Multiplexer...");
selectChannel(0); // Select channel 0 as an example
}
void loop() {
// Example: Communicate with a device on channel 0
selectChannel(0); // Ensure channel 0 is active
Wire.beginTransmission(0x40); // Replace 0x40 with the I2C address of your device
Wire.write(0x00); // Example command to the device
Wire.endTransmission();
delay(1000); // Wait for 1 second before repeating
}
I2C Devices Not Responding:
selectChannel() function.Address Conflicts Persist:
Communication Errors at High Speeds:
Q: Can I use more than one multiplexer in a single project?
A: Yes, you can use multiple multiplexers by assigning each a unique I2C address. Modify the solder pads on the board to change the address.
Q: Do I need to deactivate a channel after use?
A: No, the multiplexer automatically deactivates other channels when a new channel is selected.
Q: Can I connect devices with different voltage levels?
A: No, all devices connected to the multiplexer must operate at the same voltage level as the multiplexer (3.3V or 5V). Use level shifters if necessary.
Q: How do I check if the multiplexer is working?
A: Use an I2C scanner sketch to detect the multiplexer at its default address (0x70). If detected, the multiplexer is functioning correctly.