Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

ide: I2C communication

Thomas Gumbricht bio photo By Thomas Gumbricht

I2C communication bus

Some Arduino components ommunicate with the board (Arduino) using the I2C protocol (communication bus). I2C is very popular because it can carry signals from multiple sensors (devices). This is possible because each sensor is given a unique serial address (id). The sensor data is sent in a serial address format using only two (2) wires: Serial Clock (or SCL) and Serial Data (or SDA). The SCL line is the clock signal which synchronize the data transfer between the devices on the I2C bus and it’s generated by the master device. The other line is the SDA line which carries the data.

Dedicated SCL and SDA ports

Most of Arduino’s standard boards have dedicated ports for SCL and SDA and come with the latest software versions capable of handling I2C. Arduino boards that lack dedicated SCL and SDA ports instead use A4 and A5 as I2C ports. For example Arduino Nano.

If instead you are using a board from a partner, you probably need to configure Arduino IDE for that particular board. As an example, you can look at the manuals for how to configure Arduino for the Adafruit’s Metro Express board.

I2C software ports

Arduino have a page on Software I2C library that outline how to setup up I2C programmatically. One of the alternatives linked on that page is to the GitHub repo SlowSoftI2CMaster. You can install this I2C software port as an Arduino library from the menu:

Sketch -> Include Library -> Manage Libraries

The basics for handling libraries is explained on Ardiuons official page Installing Additional Arduino Libraries.

Connecting multiple I2C modules

Connecting multiple I2C device on Arduino Uno R3