I2C Arduino Uno Tutorial for Beginners

Published By

If your application requires communication between separate integrated circuits, I²C technology may be the solution. Since it emerged in 1982, I2C makes it possible to work with multiple nodes while only using two wires for signaling. This technology, also known as IIC or I2C – or, as a slightly different version, Two-Wire Interface (TWI) – is still in use today, and since 2006, users are free to implement it. You can find I²C in a variety of different technologies, including peripherals that work with the various Arduino boards available.

I2C Wiring: Setting Up the Physical Wiring

Image: Jeremy S. Cook

Let’s start first with the basics of what you’ll need to get an I²C module running. For this tutorial, we’ll assume you’re using an Arduino Uno, though you can use any Arduino or even a different computing system. Find more information on Arduino’s Wire library documentation, a piece of code that’s usually involved with I²C technology. Set up your board as follows:

  • SDA (Serial Data Line): A4
  • SCL (Serial Clock Line): A5
  • Vcc: +5V, or potentially +3.3V depending on the module
  • Gnd: Gnd
  • Interrupt: Depends on the module and programming

You’ll also need to attach SDA and SCL to a positive voltage through a pull-up resistor. We use a 4.7kohm value for this setup, which is standard, but not essential. Some boards even include built-in accommodations for these resistors. Take note: you only need one resistor for each line, even if you’ve chained together multiple modules.

I²C modules include a default value for their address, but to set them up you’ll need to use jumpers or connect certain solder pads. If you’re unsure about your device’s address, and especially if you’re only going to use one I²C device in your project, use a program called Arduino I2C Scanner to see each connected device’s address.

Arduino I2C Example