Tutorials

Learn More

I2C is a two-wire serial bus protocol originally developed by Philips Semiconductors, now NXP Semiconductors. It is mainly used for short-distance communication between integrated circuits on the same PCB or within the same system.

Unlike UART, I2C is synchronous because communication is controlled using a clock signal. Unlike SPI, I2C does not require a separate chip-select line for every peripheral device. Instead, every target device has an address, and the controller selects a device by sending that address on the bus.

The two I2C lines are:

  • SDA: Serial Data
  • SCL: Serial Clock

Both lines are bidirectional in normal I2C operation and are pulled HIGH when the bus is idle.

Why I2C is used

I2C is useful when a controller must communicate with several peripheral devices but the available number of pins is limited. A microcontroller can connect to many I2C devices using the same SDA and SCL lines, provided that each device has a unique address.

For example, a microcontroller can communicate with an RTC, EEPROM, temperature sensor, accelerometer, ADC, and display controller using only two pins.

I2C Advantages

  1. It requires only two signal lines, SDA and SCL.
  2. Multiple devices can share the same bus.
  3. Each target device is selected using an address.
  4. It supports bidirectional communication.
  5. ACK/NACK bits provide basic transfer-level handshaking.
  6. It supports multi-controller systems through arbitration.
  7. The protocol is simple and well supported by many ICs and microcontrollers.

I2C Limitations

  1. It is slower than many SPI implementations.
  2. Bus speed and reliability depend on pull-up resistance and bus capacitance.
  3. It is mainly suitable for short-distance board-level communication.
  4. Address conflicts can occur when two devices have the same fixed address.
  5. Debugging can be harder when a device holds SDA or SCL LOW.
  6. Higher-speed operation requires careful electrical design.

I2C Applications

I2C is commonly used with:

  • EEPROMs and small non-volatile memories
  • Real-time clocks
  • Temperature, pressure, humidity, and light sensors
  • Accelerometers, gyroscopes, and magnetometers
  • ADCs and DACs
  • GPIO expanders
  • Display controllers
  • Audio codecs
  • Power-management ICs
  • Battery fuel gauges
  • Touch controllers