What purpose? Maybe you don't have enough I/O Pins or Analog In's. Maybe you want to do separate tasks on the same project but still want to communicate between the Arduino's. Or maybe you just need to do a simple thing more complicated.
There are many ways to send a command to another Microcontroller:
UART - Requires pins 0 and 1. The problem with UART is that only one device can send data to another. And also it's already in use by the USB port of the Arduino to connect to the computer.
DIGITAL I/O - Basically put a pin HIGH and read it on the other Arduino. But with this you have a
limited number of commands and devices.
I2C - I2C Requires Analog Pins 4 and 5 and two pull-up resistors. You can connect more than 100 Arduino's on the same 2 pins. It's simple, reliable and easy-to-use.
Remove these ads by
Signing UpStep 1I2C Basics
I2C (pronounced I-squared-C) created by Philips Semiconductors and commonly written as "I2C" stands for Inter-Integrated Circuit and allows communication of data between I2C devices over two wires. It sends information serially using one line for data (SDA) and one for clock (SCL).
Master and Slave
The I2C protocol defines the concept of master and slave devices. A master device is the device that is in charge of the bus. This device controls the clock and generates the START and STOP signals. Slave devices listen to the commands sent by the Master and respond to them.
Basic details:
Transfer rate: 10 Kb/s (low speed) - 100Kb/s
SDA - Serial DAta line
SCL - Serial CLock line
128 possible addresses
16 reserved addresses
112 devices max
Devices have to share both 5V (Power) and GND (Ground)
| « Previous Step | Download PDFView All Steps | Next Step » |









































my wire seen it not do it, i have 0022
Justin
A little sidenote for when working with an Arduino Mega: Comm-Pins are 20 and 21. But well... figuring that out takes 5 minutes. On the other hand: you just saved them ;-)
The fact is that you don't need an extra wire per slave. :-)
That's the beauty of I2C. You simply put on each slave unique address and put the master to talk with that specific address...and it works. Simple and reliable.
:-)
I mixed I2C and SPI (Serial Peripheral Interface) where you need a chip select per slave.
Thanks for the instructable anyway.
If you add more slaves on the bus, you need an extra wire per slave (or some multiplexing circuit).
Apart from that, a nice an clear instructable.