Optimal protocol for Arduino-Arduino communication

Hi :),

For my project I think I am putting an Arduino through a big workload, so I'm looking into splitting the task between multiple arduinos. At the moment I want to have a single master and a few slaves.

What is the optimal communication protocol in this case? I assume SPI is the fastest? I2C has the advantage of less wiring, but it seems slower. UART can't work here because I have more than 2 devices.

Correct me if I'm wrong; but afaik I should use SPI for fastest transmission. But use I2C when there are too many devices. (SPI requires an extra pin on the master for every slave)

UART can't work here because I have more than 2 devices.

UART serial works very well if you use multidrop TTL-RS422 or RS485 serial adapters. RS422 and RS485 are industry standards.

I2C and SPI intended for device to device communications over short distances, such as on a single PCB and are unreliable, and/or don't work at all with long cables.

jremington:
UART serial works very well if you use multidrop TTL-RS422 or RS485 serial adapters. RS422 and RS485 are industry standards.

Sorry I don't understand what you mean. Can you please elaborate?

jremington:
I2C and SPI intended for device to device communications over short distances, such as on a single PCB and are unreliable, and/or don't work at all with long cables.

In my case my devices are on the same board; which comms protocol would you recommend?

What is the expected data transfer rate? How many slaves are there?

GolamMostafa:
What is the expected data transfer rate? How many slaves are there?

I'm not sure tbh. I guess as fast as possible. Probably 1 master and 2 or 3 slaves at most.

ningaman151:
I'm not sure tbh. I guess as fast as possible. Probably 1 master and 2 or 3 slaves at most.

AS fast as possible leaves NO time to process the data. Get realistic and give some thought as to how fast you can process a message and then you will know how many bytes per second you have left for communication.
Paul

Sorry I don't understand what you mean. Can you please elaborate?

Use your favorite search engine to learn about RS-422 or RS-485 serial adapters. They allow you to connect a master and several slaves.

ningaman151:
For my project I think I am putting an Arduino through a big workload, so I'm looking into splitting the task between multiple arduinos. At the moment I want to have a single master and a few slaves.

What Arduino are you using and what is that big workload?

The computational differences between the Arduino compatible microcontrollers are significant.

ningaman151:
I'm not sure tbh. I guess as fast as possible. Probably 1 master and 2 or 3 slaves at most.

  1. If using UNO-Master and 3xNANO-Slave, you can go for data transfer rate of 400 kBit/sec (fast mde) in I2C Protocol.

  2. If using UNO-Master and 3xNANO-Slave, you can go for data transfer rate of 8 Mbit/sec using SPI Protocol.

Actually I've been thinking about using an Arduino mega master and nano slaves. This opens up UART as an option.

What are your thoughts on this?

jremington:
Use your favorite search engine to learn about RS-422 or RS-485 serial adapters. They allow you to connect a master and several slaves.

I've read through a couple of tutorials and they didn't provide anything useful other than to use the MAX485 module.

Can you share the link of a good source please?

Hardware UART supports as high as 2 Mbit/sec; where, 10-bit makes a frame. So, you can send 200 000 characters (usually ASCII formatted) in one second, which is 100 000 bytes/sec of information. On the other hand, 400 000 bits/sec (50 000 bytes/sec) could be sent using I2C and 8000 000 bit/s (1000 000 bytes/sec) could be sent using SPI Port. Build the project and check which protocol works reliably and robustly.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.