Communication between 3 arduinos

Hello everyone

I am not experienced in the communication between arduinos to send data. So I was wondering if it is possible to let 3 arduino mega send data to each other.

All 3 arduino mega have the same purpose. The reason I need 3 of them is because I need 160 I/O and 40 Analog inputs. I know other boards/plc can be used aswell but i found this more quick to program for myself and has a faster devilery time. It will be used in my final school project.

The data the arduinos need of each other is a simple high or low state. When a sensor gets the correct value the other arduinos need to know this, because of the timing.

Also because communication has a sort of delay I was wondering if anyone knows what it is, because the system i'm making requires a precision of 0,1ms. So if the communication has a time of lets say 10ms, I know where I have to put my sensors.

I hope you guys understand and can help me a bit out how to let 3 arduino mega communicate with each other.

It would be easy to communicate between 3 Megas. A can talk to B using Serial1. B can talk to C using Serial2

However that may be too slow. if you just want to communicate a HIGH or LOW just connect an OUTPUT I/O pin on one Mega to an INPUT_PULLUP I/O pin on the other one. This may not work if they are far apart.

If you want to send a whole byte you could connect the 8 I/O pins from a single I/O port and write and read them with a single PORTx or PINx instruction

...R

Thanks!

It is indeed HIGH or LOW, so just use the digital I/O and connect the arduinos with each other with the ground correct?

DeurmatNL: It is indeed HIGH or LOW, so just use the digital I/O and connect the arduinos with each other with the ground correct?

I guess you have already tried and found that it works.

...R