Go Down

Topic: More than one Slave RS232 (Read 859 times) previous topic - next topic



for a bigger project I need Arduinos to communicate, but I²C seems not to be good for a safe connection, because of the cable length.
Can I connect more than Arduino to the two RS 232 pins?
I know that every Data I send will be transmitted to every Board, but the first Byte could be an adressbyte, so just the right board reads the data and the others ignore it.
Is that possible?
Which other Bussystems for a long cable length with library are available?

Thank you,


The serial signals on Arduino are not RS-232, that is an electrical spec that specifies voltage levels among other things.

So, apart from that yes you can link several Arduinos on a serial connection, you just have to choose appropriate line drivers and for this sort of thing RS-485 is normally the recommended standard.

With RS-485 you implement a "half duplex" connection, which basically means only one device can talk at a time, so you do what you have been thinking, a master sends a packet to the "network", all slaves read this packet and the addressed slave takes action on it.

Depending on the nature of your application (ie how important the data reliability is) this can be very simple or quite complex.

long cable length

How long and how fast?

Rob Gray aka the GRAYnomad www.robgray.com


Jul 22, 2011, 04:46 pm Last Edit: Jul 22, 2011, 04:49 pm by Graynomad Reason: 1
Can I use it just like RS 232?

You can use 485 like 232 but not the other way around.

RS-232 is not suitable for a multi-drop bus because you cannot disable the transmitters. That's why RS-485 is popular because the transmitters can be tri-stated to allow others to talk.

Is there any good tutorial on RS 485?

I haven't looked in the last 20 years so don't really know but did a bit of Googling


I'm not sure these are good but they should give you the idea.

How does Slave to Master works?

Basically the master asks a slave for information or sends it a command, and the slave provides the information or actions the command.

Usually this is done by sending a "packet" to the bus, this packet has control information such as slave address, data length and a checksum. The slave responds either with data or just an acknowledge so the master knows the data/command was received. The master then moves on to the next slave address and the process repeats until all slaves have had a go. Then the master goes back to the first slave etc etc.

This is called a "protocol" and there are a 1000 variations. AFAIK no (simple) standard exists so you have to write your own protocol. Writing a robust protocol is not a simple job, however something quick and dirty is easily achievable. As this is for a model railway nobody will die if some data is corrupted, that always helps :)

Rob Gray aka the GRAYnomad www.robgray.com

Coding Badly

for a bigger project I need Arduinos to communicate

More than two Arduinos?


Hi Fluepke

Don't throw out IC2 without some investigation.  I plan to use it for distributing a fast clock around the layout at some point.

Design tips for using IC2

IC2 bus extender to 50 feet

Another possiblity is Onewire

Regards  bill

Go Up