Introduction: I2C - Communicating Arduinos

Picture of I2C - Communicating Arduinos

This lab was created by Stephen Mathis and Cody Self.

In this lab, we created an I2C bus using two Arduinos; one master and one slave.

Here is a list of items used to make this I2C bus:

  • 2 Arduinos
  • Jumper Wires
  • 220 (Ohm) Resistors
  • 2x LED's
  • 2x Breadboards

Step 1: Step 1: Connect the 2 Arduinos

Picture of Step 1: Connect the 2 Arduinos
  1. Start by using a Jumper Wire to connect the GND lines on each Arduino.
    • The GND line has to be the same for both Arduinos for it to work.
  2. Connect pins A4 and A5 on both Arduinos.
    • Again, the connected pins have to be identical for both Arduinos to work.

Step 2: Step 2: Conecting the Arduinos to the LED Communication

Picture of Step 2: Conecting the Arduinos to the LED Communication
  1. Attach an LED to the Breadboard.
  2. Connect a 220 (Ohm) Resistor to the long lead of the LED
  3. Connect the Resistor to Pin 13 on the master Arduino.
  4. Connect a Jumper Wire from the short lead of the LED to the GND pin on the Arduino.
  5. Repeat steps 1-4 for the Slave Arduino.

Step 3: Step 3: the Code

Here is the code for the Slave and Master Arduino.

Comments

Swansong (author)2017-09-21

Thanks for sharing :)