Hi, i will have one main unit of Arduino and 2-3 other Arduinos as sensors.
I thinking what is simples way to two way communication between them on wire with max length of 10m. There will be almost no data between them but if it will goes it will be important ;). Sensor need to send one command when activated, and get command to light color led or not. Speed and transmission type is unimportant, just the simples way to communicate them.
I have a project I want to use a Mega as master and some Uno's as slaves, I tried to look into SPI, but is seamed overly complicated. So now I'm think of using serial. one channel for each slave. So that would let me have 4 (?) slaves on one Mega.
I want to use I2C, but the slaves are connected to their own BMS-chip (BQ76940) via I2C, and they have fixed adress. So the Uno's can be on the same I2C net.
I see now that I could have spesified a little more, as you can not read my mind.
The wiering is no problem. Or it is actually prefered as I can have only one powersupply for all controllers.
The RS-485 would in my case be an unneccesary harware layer. I dont think my envirement is that noisy, and it is just a couple of meters wire max. If I have some trubble with noise, I wil try using shielded cable.
The SPI is fine in regards to wireing. I was thinking about the code, sorry for not beeing clear on that.
SPI might not be more conplicatet that I2C or UART, but as far as I understand both I2C and URAT have dedicated input-buffer in hardware. SPI does not?
So the SPI-code needs cearfull timing with interrupts, atleast on the slave side. There might be the same on I2C and UART, but then it is hidden in the library some where.