What is I²C?
I²C, or Inter-Integrated Circuit, is a synchronous serial communication protocol used for short-distance communication between microcontrollers, sensors, memory chips, displays, and other peripherals.
It was designed to let multiple devices communicate using only two wires: one for data and one for clock.
Two-Wire Bus
I²C uses SDA for data and SCL for clock, reducing wiring complexity.
Master-Slave System
A master device controls communication while slave devices respond to requests using their unique addresses.
Address-Based
Each slave has an address, so multiple devices can share the same bus.
How I²C Works
In an I²C system, the master begins communication by generating a start condition. It then sends the address of the slave device it wants to talk to, followed by a read or write bit.
Start Condition
The master pulls SDA low while SCL is high to signal the start of communication.
Address Frame
The master sends the slave address and indicates whether it wants to read or write.
Acknowledge Bit
The receiving device pulls SDA low on the ninth clock pulse to confirm receipt.
Data Transfer
Data is transferred one byte at a time, with an acknowledge after each byte.
Stop Condition
The master releases SDA high while SCL is high to end communication.
Main Signals and Bus Features
SDA
Serial Data line. This carries addresses, control bits, and transferred data.
SCL
Serial Clock line. The master generates the clock to synchronize communication.
Pull-Up Resistors
I²C uses open-drain or open-collector outputs, so pull-up resistors are required to bring the lines high.
Why are pull-up resistors needed?
Devices on the I²C bus can usually pull the line low, but they do not actively drive it high. The pull-up resistors return SDA and SCL to logic high when no device is pulling them low. This is a key part of how multiple devices safely share the same bus.
Common I²C Speeds
| Mode | Typical Speed | Use Case |
|---|---|---|
| Standard Mode | 100 kbit/s | Basic sensors and simple peripherals |
| Fast Mode | 400 kbit/s | Common embedded applications |
| Fast Mode Plus | 1 Mbit/s | Higher-performance devices |
| High-Speed Mode | 3.4 Mbit/s | Specialized high-speed communication |
Advantages and Limitations
Advantages
- Only two signal wires are required
- Multiple devices can share the same bus
- Addressing makes device selection simple
- Widely supported by sensors and microcontrollers
- Good for short-distance board-level communication
Limitations
- Slower than SPI in many applications
- Requires pull-up resistors
- Bus capacitance limits distance and speed
- Debugging address conflicts can be tricky
- Less ideal for very high-speed data transfer
Where is I²C Used?
Sensors
IMUs, temperature sensors, pressure sensors, and magnetometers often use I²C.
Memory Devices
EEPROMs and configuration storage chips commonly communicate over I²C.
Displays
Small OLED and LCD modules often use I²C to minimize wiring.
Embedded Control Boards
Microcontrollers use I²C to connect low-speed peripherals on the same PCB.
Summary
I²C is one of the most important communication protocols in embedded systems. Its two-wire design, addressing system, and support for many devices make it ideal for sensors and peripheral communication on compact electronic systems.
If you understand SDA, SCL, addressing, start/stop conditions, and pull-up resistors, you already have a strong foundation in I²C fundamentals.