10The I2C Bus

Parts You'll Need for This Chapter

  • Arduino Uno or Adafruit METRO 328
  • USB cable (Type A to B for Uno, Type A to Micro-B for METRO)
  • Half-size or full-size breadboard
  • Assorted jumper wires
  • 220Ω resistors (×8)
  • 4.7kΩ resistors (×2)
  • 5 mm red LED
  • 5 mm green LEDs (×4)
  • 5 mm yellow LEDs (×3)
  • SN74HC595N shift register
  • TC74A0-5.0VAT I2C temperature sensor

You've already learned how to connect both analog and digital inputs and outputs, but what about more complicated devices? The Arduino (or any microcontroller, for that matter) can expand its capabilities by interfacing with a variety of external components. Many integrated circuits (ICs) can implement standardized digital communication protocols to facilitate communication between your microcontroller and a wide array of possible modules. This chapter explores the I2C bus (pronounced “eye squared see” or “eye two see”).

The I2C bus enables robust, high-speed, two-way communication between devices while using a minimal number of I/O pins to facilitate communication. Usual maximum speeds range from 100 kilobits per second (Kbps) up to a few megabits per second (Mbps), depending on the components and system design. An I2C bus is controlled ...

Get Exploring Arduino, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.