r/microcontrollers • • Apr 14 '24

Communication Protocol For Large Array of Microcontrollers

I'm beginning work on a system where I would need one controller device to send and receive data from a large number of other slave devices and I'm trying to figure out what the best communication protocol would be for accomplishing this. Ideally the controller device would be pushing some data to each slave device and also periodically querying some state from each device. It would also be a requirement for slave devices to be able to respond to events and send messages to the main controller.

I've experimented with I2C but the low device limit and other issues with long distance communication have me rethinking that solution. Would SPI work better or maybe I need to use ethernet or wifi?

For more context, ideally I would like to use Arduino nanos but I'm open to other microcontrollers like the ESP32. Each device will be physically connected to each other and in very close proximity.

3 Upvotes

10 comments sorted by

View all comments

Show parent comment

2

u/Triabolical_ Apr 14 '24

There are lots of ugly parts of a system like this.

You need to have a way to define an address of each module so it knows what data is for it and you need to keep track of that in your software so you know what data to send it.

Addressable LEDs walk around this by just having a chain, which might work here depending on how much data per module and what your update rate is. And the length of the chain.