Turn-key PCB assembly services in prototype quantities or low-volume to mid-volume production runs

Communicating multiple Arduinos through I2C

I2C is great communication protocol allowing to interface multiple devices to only two signal wires. Using it is simple, because I2C peripheral is already included in most microcontrollers. Atmega micros on Arduino also have this peripheral sometimes called TWI (Two Wire Interface). I2C communication is normally single master and one or multiple slaves. Berryjam couldn’t find decent example where multiple slave Arduino could accept multiple tasks from master. So he wrote his own tutorial on this.

He wrote programs for master and slave(s) allowing to send any number of commands. Master sends code number to slave which its hand executes function with assigned code and returns results to master. This way he was able to interface separate arduinos to master where one is responsible for reading sensors and controlling motor, another outputs information to display and so on. In his recent code master is able to send command but also passes up to 5 arguments of data to be passed in to slave function. If you are setting project like modular home automation system, this example may be a good starting point.

[..Source link..]

Bookmark the permalink.

Comments are closed.