I2C 101

I always think that a robot without sensors is not a robot. Its just another computer, albeit in a smaller scale (slower, small memory, etc).


There are numerous sensors available on the market today and if you try to put 5 or more sensors on your robot, your MCU will soon be out of I/O pins in no time. For example a Sumovore with the Atmel brain board, can contain 4-5 edge detectors, 2 IR LEDS, 2 IR receivers, 2 motors, and 6 user programmable LEDs. That's already almost half the total pin count for the Atmega8 being used by the brain board. If you'll see its schematics, you'll see only 2 free/spare pins for your use. What if you want to customize your robot and add a compass, a thermometer and a sonar? With only two pins left you can't connect them all at once.


There's actually a simple but, relatively, unknown method of interfacing several devices. This is I2C. If you have a TV-set most probably you are already using I2C without even knowing it. Most of the readers might have actually noticed "I2C" on a data sheet of some chip or from a product on an online store, but don't know how to use it.


This simple tutorial will try to introduce I2C to the readers with the hope of enabling the reader to use I2C on his/her own robotics projects. Consider this as the culmination of all the research I made when I was studying I2C when trying to interface a third party compass to the SRV-1. If you find any errors kindly inform the author (you'll need an SoR forum account).