I'm working on a project for a music show and I'm in a bit of a pickle. I got an Arduino Uno (Master) that must send a simple message (three-digit numbers) to multiple slaves Arduino, but after some research, I found out that the RS-232 protocol can only support point-to-point connection. I ordered RS-485 modules to fix that, but the show is in a few days and I fear it will not arrive in time.
My question is can I connect the master's TX pin + ground to multiple slaves RX pins + ground without connection with the slaves TX pins to the master's RX pin.
What I need it the master device to send/broadcast a 3-digit signal which will be received by all slave devices, which will all react to it at the same time. I don't need the slaves to send messages to the master.
No that is not the case. Not sure how you came to that conclusion? The famous DMX protocol uses that sort of standard.
You need a TTL to RS-232 converter for the Uno and a RS-232 to TTL converter for each one of your nodes. The RS232 signal is connected to every RS-232 to TTL converter.
You need some form of address so that each Uno node checks for its own address and only takes notice of the data intended for it.
However, the range of the RS-232 standard is poor as it is only single ended, where as a RS485 is a differential bus.
I'm kind of new to this kind of networking, I have a Uno with a CQRobot DMX shield, which is my "master" here and I want it to send the same 3-digit signal to every Arduino devices connected to it. All the devices are 15-50 feet away from the master.
In that fashion, the signal sent from the master is intended to ALL slaves at the same time. No individual addressing necessary (if that's possible of course).
As for the TTL converter, it would be a problem since I don't have any and I don't have time to order them.
You technically could use any protocol over any physical connection. In case of only 1 master and many slaves just use your TTL to RS-232 like it would be RS-485 modules.
It does not matter what you have. You may even connect directly UART of 2 Arduinos and you code must work or must not work the same way. You choose TX and RX pins in your code. Your code or the library that imlements some protocol knows nothing about the physical connection type, it just has TX and RX pins. So just choose same baudrate and send test data there.
... and you must set Enable pin for common RS-484 modules (maybe RS-232 also have enable pin, honestly I don't remember).
So I would just connect the master TX pin and ground to the slaves RX pins + ground then do a serial println on the master and serial.read on the slaves ?
They control parts of the decor, each with their own Arduino driving the part. I'm in the process of testing the whole thing, but I hit a wall when I read about the range, And I saw that Arduino has a built-in RS-232 which could work with longer distances as long as the Baud rate is low.
That might be pushing it for RS232, it will be fine with RS485.
One alternative would be to use the straight TTL signal from the Arduino but drive it up to 12V, Then use a simple potential divider at each Arduino to cut the voltage down to 5V for the RX. I would use high absolute values in the 30 to 70K range so the load in the TX is not so great.
the UART on an Arduino is not technically RS232. It uses the same encoding / decoding as RS232 but the signal is inverter (a UART 1 = an RS232 0).
And the voltage is different UART = 0 to 5V while the RS232 ranges from +5V to +15V = 0 and -5V to -15V = 0. I may have the actual voltages wrong but you get the difference.
Second but is .... how long a run do you have between Arduinos' ? RS232 is specified for up to 50 feet. The UART logic level signals are not guaranteed at any distance. The UART signal needs the designer to handle it as if it were any digital signal.
Hi @pg213, in order to connect multiple slaves to the RS-485 master, you may use the daisy chain method, I will attach a picture to help you understand well, once you do the daisy chain, you will have 2 wire outputs of D+ and D- , connect these to the MAX-485 module to convert to TTL logic and then connect that to your arduino. I would recommend you to poll the data first using MODBUS Poll and RS-485 to USB converter if that is available.
The wires coming to the IOT gateway should go in the Max 485 module
Thank you for all your help, sorry for the long delay, I was very busy because of the show (the reason for my post)
Since time was not on my side, I simplified the system by connection both Arduinos with a DPDT switch and reprogramming them so each time the switch is pressed, the system goes to the next effect. I used XLR cable to pass the signal (I remember reading about the risk of interference on long cables and since XLR cables are shielded, it couldn't hurt) It's really not what I had in mind, but it worked.
I'll take in mind all the precious information everyone gave me to build a better system in the future, thank you all !