+1 500 000 products in offer
7000 packages per day
+300 000 clients from 150 countries
Yes, multiple devices can be connected to the I²C bus, as long as each device has a unique address. When two or more devices have the same address, a communication conflict arises, which can be resolved in two ways: by changing the address of the device (if possible) or by using an I²C multiplexer, which allows communication to be split into separate channels.
The I²C (Inter-Integrated Circuit) bus is a serial communication standard that allows many electronic circuits to exchange data using only two lines: SDA(data) and SCL (clock). In this system, one chip acts as master (usually an Arduino) and the others are slaves: sensors, transducers or other peripheral modules. Each is identified by the I²C address, stored as 7 or 10 bits. The Arduino, as the master, sends over the bus the address of the device it wants to connect to. If there is more than one device with the same address on the line, they both respond at the same time, causing interference and transmission errors.
Many sensors and I²C modules allow to manually change the address, to avoid conflicts. This is most often done by setting the address pins (labelled A0, A1, A2, etc.) accordingly, which allow the address to be shifted up or down by several binary values. For example, the temperature sensor BMP280 has a default address of 0x76, but by changing the state of the address pin it can operate at address 0x77. This allows two such sensors to be connected to a single bus without the need for additional circuitry. Some devices do not have the ability to change the address hardware-wise, but allow this to be done software-wise by writing the configuration to an internal register. However, in cheaper or simpler modules, the address is sometimes permanently assigned by the manufacturer, which is a limitation in larger measurement systems.
If several identical sensors with the same address need to be used in a project, a I²C multiplexer, such as the PCA9548A chip, is used. It works like an electronic switch: the Arduino connects to the multiplexer at its unique address and then activates one of the eight channels to which a particular sensor is connected. This ensures that only one device with a particular address is active on the bus at any given time, while the others are isolated. This solution is commonly used in multi-sensor systems, e.g. temperature sensor arrays, soil moisture measurement systems or environmental analysers. The multiplexer eliminates the problem of address collisions without having to modify the hardware.
It is important to remember that I²C is an interface designed for communication over short distances - usually up to a few tens of centimetres. With more devices and longer cables, the capacitance of the bus increases, which can cause signal interference. It is therefore recommended to use pull-up resistors (pull-up) with appropriate values and to run the cables in a way that minimises interference. It is also good practice to regularly scan the bus using a simple program (I²C Scanner) that detects all active addresses. This allows you to quickly identify conflicts and ensure that each device is responding to the correct address.
Transfer Multisort Elektronik (TME) is one of the world’s largest global distributors of electronic components, electrotechnical parts, workshop equipment, and industrial automation. The catalog includes over 1,500,000 products from 1,300 leading manufacturers. TME’s modern logistics centers in Łódź and Rzgów (Poland), with a combined area of over 40,000 m², ship nearly 6,000 packages daily to customers in more than 150 countries.
TME also invests in the development of knowledge and skills of young engineers and electronics enthusiasts through the TME Education project, and supports the tech community by organizing the TechMasterEvent series, promoting innovation and experience exchange.