Arduino to Arduino comuication

I'm in the process of looking into a design where i will have one master and 4 slaves but not sure which is the better method I2C or RS485 serial will be to slow I think or any other method, But needs to a be reliable data transfer. I need to send a on (turn relay on)signal to the slaves then the master will request a voltage and current samples continuosly I know this could not be done at the same time so it would have to request from slave one then two then to display on a LCD at the master, The main goal is that they need to be isolated and have there own supply feed the I2C method I know I would have to use digital I2C isolator's not sure about Rs485

Which would be the best method ?

Thanks

Hi,

What is the real speed requirement? How many bytes per second? What response time?

What is the distance of master to slaves? What is the topography? Like a Star, like a highway with multiple ‘stops’??

I'm a fan of RS-485, but it depends on the answers to Terry's questions.

The speed requirements, I know this sounds stupid but never really thought about that much say once a second to receive the data from the 4 slaves if possible. Each slave will send 2 float values say 12.36 for volts and 25.56 for the Amps for an example.
The distance is not that far from each other say 200mm from the master to the first slave then 100-150mm between the other 3 slaves so they will be in line like a daisy chain

Why the need for multiple Arduinos if the distances are so short?

Each slave will be classed has a controller where they will creating a Pwm signal controlling a relay and measuring voltage from 4 batteries but need to be isolated from each other this is why I need 4 well 4 mini Arduinos. All these will be controlled via the master which will tell them when they need to carry out the stuff they need to do

Hi,

Pwm signal controlling a relay

How?

Tom.. :slight_smile:

Sorry should said the Pwm signal will be used for something else otherwise I would of used one Arduino and digital I2C isolator’s and some opto-isolator’s for the relays

but need to be isolated from each other

"Isolated" in what sense? Because using any standard comms hardware like RS-485 will not galvanically isolate the various boards.

Hi,
If you need galvanic isolation.

https://www.maximintegrated.com/en/products/interface/transceivers/rs-485-rs-422-transceivers/isolated-rs-485-rs-422-transceivers.html

https://www.maximintegrated.com/en/products/interface/transceivers/rs-485-rs-422-transceivers/isolated-rs-485-rs-422-transceivers.html

Tom.... :slight_smile:

Graynomad:
"Isolated" in what sense? Because using any standard comms hardware like RS-485 will not galvanically isolate the various boards.

I need them to be isolated from each other as these are individual batteries been monitored and cannot have a common ground.
Thanks Tom I will look into that method

Steveiboy:
I’m in the process of looking into a design where i will have one master and 4 slaves but not sure which is the better method I2C or RS485 serial will be to slow I think or any other method, But needs to a be reliable data transfer. I need to send a on (turn relay on)signal to the slaves then the master will request a voltage and current samples continuosly I know this could not be done at the same time so it would have to request from slave one then two then to display on a LCD at the master, The main goal is that they need to be isolated and have there own supply feed the I2C method I know I would have to use digital I2C isolator’s not sure about Rs485

Which would be the best method ?

Thanks

First off: punctuation helps greatly for the reader to understand what you’re saying. Just a tip.

To ensure galvanic separation of systems, you will need to use optocouplers.

As we’ve learned from another thread on the electronics forum, i2c is not suited for optocouplers. SPI supports optocouplers as all lines are unidirectional, as does USART serial. Not sure how RS485 extends/limits parameters for USART comm.

Anyways, RX/TX communication is point-to-point. Using this efficiently probably means using SoftSerial, defining separate channels to each slave. For a low number of slaves, this should be a viable solution.

The alternative is using SPI, but afaik the SPI library available for Arduino does not support SPI slave mode.

Sounds like the solution is RX/TX on separate channels, or alternatively, if the number of slaves increases, you can connect all slaves to single RX/TX lines, and include dedicated “slave-select” lines as used in SPI, to simply determine which slave communication is targeted at, and consequently which slave is allowed to signal back on the bus.

Just my two cents.

I was thinking of using something like Silicon Labs Si8420AB Digital Isolators which is for I2C

First off: punctuation helps greatly for the reader to understand what you’re saying. Just a tip

I’ve taken this on board but some people like myself struggle in explaining and getting what’s in my head down on paper, fingers can’t work as fast as my brain wants them to type and I’m no brain box I put this down to my Dyslexia

I have built a system with two software serial links from one master to two slaves. SW serial has the disadvantage that you can only be listening to one incoming at a time, and also, if you get overlapping receipts, all bets are off.

What I did was to expand the SW serial interface to four lines: the usual (Rx/Tx), and a line from slave to master indicating ready-to-send, as well as a line from master to slave indicating clear-to-send, sort of like the good ol' fashioned serial of many years ago.

That way, the master polls the ready-to-send lines of the slaves, and activates the clear-to-send lines as desired. No communications will get lost in the shuffle.

Of course, four wires are more than two, so this would be limited to about four slaves on an uno or uno sibling.