9 Arduino matrix - which Arduino and which communication protocol to use

Hi everybody I am working on an ambitious project, and I would need a suggestion about the hardware I should use, I did a drawing of the final result I would like to achieve which in few words is a flexible matrix of maximum 9 Arduinos communicating all with the central one.

Description of my drawing (attached):

Each circle and number represent an Arduino, each Arduino is contained in a box and the lines between them represent the set of pins (around 3 or 4 pins i guess) necessary for each connection between Arduinos.

Arduino number 1 is the one which need to gain informations from all the other Arduinos. Four Arduinos (number 2) are directly connected to Arduino number one, and the four Arduinos (number 3) give information to number 2 which then give these information to number 1.

While I think to be able to manage the software issue of this project, I wanted to ask suggestions about how to manage the four connection of each Arduino with the others.

Should I use serial connections (TX RX) buying 9 Arduino mega to have 4 ways of communication for each box? (It seems to me maybe not the more economic but the more simple way) or is there a way i which I can use 9 Arduino (nano, UNO or others) and make them communicate with the I2C protocol?

Just to clarify the red lines are there just to indicate how a double connection may be redundant, but I don't expect you to solve that problem as i think to solve it trough code.


Extra question:

Should I empower each Arduino with a battery? or can I empower all the other Arduinos in the moment they get connected with Arduino number 1?

In a further phase of the project I would even need Arduino (number 1) to communicate with the computer trough a wireless communication, but I don't think there are Arduino Mega with a bluetooth or Wifi module installed

Thank you a lot for your time, hope to receive some interesting ints

Asset 1.png

Asset 1.png

Do you already have a couple of arduinos or megas to start experimenting with? If not, then that might be something you need to get started with.

Image from Original Post so we don't have to download it. See this Simple Image Posting Guide

Asset 1.png

...R

I have to say the image does not help me to understand the project.

What are the numbers?
What are the red and black lines?

I suspect that I2C would be a much simpler way to implement the communication as it operates as a bus. Have a look at this I2C Tutorial

…R

Why do the #3s each have to talk to two #2s? I would think each #2 could have its own three #3s to talk to.

2560 has 4 serial ports, that'd be simplest for hardware. Can be a breakout kind of module.

Give the master a bluetooth module to talk to a PC

CrossRoads:
2560 has 4 serial ports, that'd be simplest for hardware.

I think I2C would be even simpler (the zeal of the recent convert :slight_smile: )

...R

what's the distance between each Arduino ?

Robin2:
What are the numbers?

Hardware and code of all Arduinos (but the middle one signed with "1") are meant to be the same, I give them number in the picture to make it more easy to understand of which I am speaking. In general N°1 is the Arduino reviving data from all the others, N°2 are the Arduino directly connected with N°1 and N3° are Arduinos which are connected to N°2. While N°2 directly transmit its data to N°1, N°3 send its data to N°2 which then send them to N°1.

Robin2:
What are the red and black lines?

CrossRoads:
Why do the #3s each have to talk to two #2s? I would think each #2 could have its own three #3s to talk to.

I express myself better:
Each Arduino module in my project can be fixed in different positions, that is why each module has pins for the communication on all the four sides. Some times the pins are not used some time they are used according to their position in the matrix.

For this reason, once i position all 9 the Arduino in the matrix, there will necessary be some Arduinos connected to other Arduinos, just because they are close (I want the pins to be able to communicate by contact). I will then have to establish a hierarchy to ignore some connections which I coloured in red. Clarified this, I would like not to focus too much on this problem as I am much more concerned on the technology rather then the code.

Soon I upload another image which should be a little more clear

noiasca:
what's the distance between each Arduino ?

Its around 10 or 15 cm

Thank you all, I am willing to study hard for this project, so whatever link with further informations will be helpful!

I redesign my drawing to have less symbols :slight_smile:

Matrix<>mesh, what the hell. No real information on whast these things are supposed to do, but it looks, walks, and quacks like a network, doesn’t it? So perhaps 9x ESP-01 to make a WiFi network. I think I saw them @ $1.11 each recently.

I2C translates to Inter-Integrated Circuit, if you are leaving the PCB don't use I2C. It doesn't matter that "hey these LCD backpacks are also working", it's just not what i2c was designed for.

You could consider RS485, however I have no solution for this optional 4way connection, but it might work considering these low distances. Design wise I would use a ring topology.
Honestly, i guess a dedicated WIFI Network is indeed the easiest and most reliable solution.

I wonder if it would be possible to design each module so it has a "pass-through" connection between the 4 connectors on the sides and the Arduino on the module would connect its I2C connection to the "pass-through" connection.

That way the data could pass without needing to be picked up and re-transmitted by the Arduino on the module.

Just some blue-sky thinking

...R

noiasca:
I2C translates to Inter-Integrated Circuit, if you are leaving the PCB don't use I2C.

That is unhelpful advice

In practice I2C works fine at distances of 2 metres and more.

...R

Nick_Pyner:
Matrix<>mesh, what the hell. No real information on whast these things are supposed to do, but it looks, walks, and quacks like a network, doesn’t it? So perhaps 9x ESP-01 to make a WiFi network. I think I saw them @ $1.11 each recently.

Imagine each of the 9 Arduinos to be coloured of a different color, and that I am able to position them in any point of the 3x3 matrix. I start with the middle Arduino which as on each of its 4 sides sets of pins for the communication (serial or I2C), the software is already running and to this Arduino then I connect an Arduino (even this one with the 4 sets of pins) on a side, and another on another side and so on till when I have completed the 3x3 matrix. While I connect my central Arduino must be able to know which Arduinos are connected and where, so considering the Arduino coloured, it should know in every moment where each color is in the matrix.

noiasca:
Honestly, i guess a dedicated WIFI Network is indeed the easiest and most reliable solution.

Considering that the sets of pins on the four sides allow me not only to make them communicate, but even to know from which direction the new Arduino has been connected, I have thought about this as a wired dynamical matrix, where the wires can be connected and disconnected according to the configuration created by the user.

Anyway according to what I got so far, I could use 9 Arduino Mega and install on the central one a bluetooth module? this should work even if it is not necessary the most efficient solution right?

CrossRoads:
Why do the #3s each have to talk to two #2s? I would think each #2 could have its own three #3s to talk to.

2560 has 4 serial ports, that’d be simplest for hardware. Can be a breakout kind of module.

Give the master a bluetooth module to talk to a PC
Adafruit Bluefruit LE UART Friend - Bluetooth Low Energy (BLE) : ID 2479 : $17.50 : Adafruit Industries, Unique & fun DIY electronics and kits

banshee119:
Imagine each of the 9 Arduinos to be coloured of a different color, and that I am able to position them in any point of the 3x3 matrix. I start with the middle Arduino ......

It would be a big help if you explained the purpose of all this. What is it that you are trying to create? What will the end-product be?

...R

Robin2:
It would be a big help if you explained the purpose of all this. What is it that you are trying to create? What will the end-product be?

...R

Ok I have a video on YouTube about a first prototype:

Each module in the video is just a sensor that get connected, to Arduino (hidden under the central module); what I want to achieve is that each module has an Arduino, which would allow me to create a much more stable interface. (the code and hardware I used to recognise the sensors was sick xD)

I have watched the video but I'm sorry it does not explain anything - it looks like some star-wars game from the time of the Sinclair Spectrum

And your description in Reply #15 does not tell us any more than we already know.

What sort of sensors would one need for a space game, and why would they need to be moved around?

...R

Before going in details I want to remind that all I want is my Arduino to communicate with all the other 8 boxes containing Arduino according to the grid I drew. The connections must go trough the boxes. This is my main goal.

Robin2:
I have watched the video but I'm sorry it does not explain anything - it looks like some star-wars game from the time of the Sinclair Spectrum

And your description in Reply #15 does not tell us any more than we already know.

Yes, sorry:
In the video, as in the case I am trying to reproduce, the boxes (that are supposed to contain Arduino) change their position, this position is recorded by the main Arduino which update this information in the game. Knowing the game where (for example) the gun is, when I press the button for the gun, the bullet goes out from its position and according to its direction (among the four viable directions).

Robin2:
What sort of sensors would one need for a space game, and why would they need to be moved around?

...R

I would not focus on the space game, as the space game is something I did a trial with. In case the presence of sensor is critical for the arrangement of the communication among the Arduino I would say a button for each Arduino.

I need them to move around because even thought I am using Arduino which are all the same, their effect in the game is different and you may need a specific component in a specific place and direction according to your preferences or context.

banshee119:
Knowing the game where (for example) the gun is,

Sorry. I don't help with programs involving guns - either real or virtual. There is too much violence in the world already.

...R

Robin2:
That is unhelpful advice

In practice I2C works fine at distances of 2 metres and more.

You are just quoting one sentence of the full post. If you read my full post carefully: I have clearly formulated an alternative. You in contrast are just claiming "it works" without any proof. You didn't link any official source, no datasheets, no link to a comparable project with an external i2c mesh network. NOTHING.

Honestly: You should not judge my posting.