I²C Bus: Working, Features, and Applications
Introduction
The Inter-Integrated Circuit (I²C) Bus, pronounced as “I-squared-C” or “I-two-C”, is a widely used serial communication protocol developed by Philips Semiconductors (now NXP Semiconductors) in 1982. It is primarily used to connect low-speed peripherals such as sensors, EEPROMs, ADCs, and microcontrollers in embedded systems. It allows multiple integrated circuits (ICs) to communicate with each other using only two wires — making it efficient, low-cost, and ideal for short-distance communication within a circuit board.
The I²C bus provides an efficient way for multiple devices to communicate over just two wires, minimizing pin count and PCB complexity.
Basic Concept
The I²C bus allows communication between a master (usually a microcontroller) and one or more slave devices. All devices share two common lines:
-
SCL (Serial Clock Line): Carries the clock signal generated by the master.
-
SDA (Serial Data Line): Carries the data between master and slave devices.
Both lines are open-drain, meaning they must be connected to a pull-up resistor to maintain a high logic level.
Key Features of I²C Bus
-
Two-wire interface: Uses only SDA and SCL lines.
-
Multi-master and multi-slave communication: Multiple devices can share the same bus.
-
Addressable devices: Each slave has a unique 7-bit or 10-bit address.
-
Bidirectional data transfer: Devices can both send and receive data.
-
Clock synchronization: Controlled by the master device.
-
Speed modes:
-
Standard Mode: up to 100 kbps
-
Fast Mode: up to 400 kbps
-
Fast Mode Plus: up to 1 Mbps
-
High-Speed Mode: up to 3.4 Mbps
-
I²C Bus Architecture
The bus operates in a master-slave configuration, where:
-
The Master initiates communication, generates the clock signal, and controls the bus.
-
The Slave responds to the master based on its assigned address.
Multiple devices can be connected in parallel to the same bus lines, and communication is coordinated using unique addresses to avoid conflicts.
How I²C Communication Works
1. Start Condition
The master initiates communication by pulling the SDA line low while SCL is high.
2. Address Frame
The master sends the 7-bit (or 10-bit) address of the target slave, followed by a Read/Write (R/W) bit:
-
‘0’ indicates a write operation.
-
‘1’ indicates a read operation.
3. Acknowledge (ACK/NACK)
After every byte of data, the receiver sends an ACK (acknowledge) bit by pulling the SDA line low during the next clock pulse.
4. Data Transfer
Data is transmitted in 8-bit bytes. The master can either send or request data from the slave depending on the R/W bit.
5. Stop Condition
The master ends communication by releasing the SDA line high while SCL is high.
I²C Bus Timing Diagram
A typical I²C timing diagram shows:
-
The start and stop conditions.
-
The address and data frames.
-
Clock synchronization on the SCL line.
-
Acknowledge bits after each data byte.
Example of Single Byte Transfer
Advantages of I²C Bus
-
Requires only two wires for multiple devices.
-
Supports multi-master communication.
-
Simple hardware implementation.
-
Device addressing makes expansion easy.
-
Efficient for short-distance, intra-board communication.
Limitations
-
Slower compared to SPI and UART for high-speed data.
-
Limited bus length due to capacitance effects.
-
Requires pull-up resistors, which affect speed.
-
More complex software handling than UART.
Applications of I²C Bus
The I²C bus is commonly used in:
-
Embedded systems for sensor interfacing.
-
Consumer electronics (e.g., smartphones, cameras, and TVs).
-
Real-time clocks (RTC) and memory chips (EEPROM, Flash).
-
Power management ICs (PMICs) and battery monitors.
-
LCD controllers and other display modules.
-
Industrial and automotive systems for inter-device communication.
Conclusion
The I²C bus remains one of the most popular and versatile communication protocols in electronics. Its simplicity, two-wire design, and multi-device support make it ideal for connecting low-speed peripherals in compact systems. Whether in microcontrollers, sensors, or embedded boards, I²C continues to be a fundamental backbone of digital communication.