RS485 is a bus protocol, so all of the devices will be connected to the same pins and the protocol will ensure that only one slave device is communicating on the shared bus at a time.
The end of the transmission line does need to be terminated with a resistor that matches the characteristic impedance of the line, typically this is 120 Ohms and can often be built-in to a lot of RS485 devices.
You can certainly connect multiple devices to a single RS485 port, but whether or not it works will depend on the functionality available in the sensors and the protocol that you implement in the gateway. RS485 is the physical layer - it defines the electrical capabilities of the devices and the arrangement of the wiring between them. To get them all talking you need the protocol, which defines how data is formatted and how communication is managed. Your gateway supports the MODBUS protocol in RTU mode which is most likely what the sensors also support, but you will need to confirm this from the specifications for the particular devices. Other options for your protocol might be available. While the wiring is going to be essentially the same for all of them you should not proceed until you know the protocol to be used. What are the sensors and what are the protocols that they support? When you know that you can look at the requirements like cable lengths and data speeds to determine what protocols best suit the particular environment, are most reliable, have appropriate provision for expansion, are easiest to implement and maintain, etc.
Multiple RS485 devices can be daisy chained. DO NOT connect in a star type configuration. As stated 120Ω terminating resistors are required AT THE ENDS of the cable run only, connected across the line between A and B. Some RS485 devices seem to have these terminations built in. This is fine for the end devices which you gateway device will be one but will have to be removed or disconnected in the intermediate devices so that only 2 terminations remain in the string. Like I say AT THE ENDS only.
To determine if these terminating resistors are present is fairly easy. With the devices unpowered measure the DC resistance between A and B on each device. If this measures about 120Ω the resistors are there and need to be disconnected on the intermediate units. There may be a link or solder bridge to do this. If these terminating resistors are NOT present they will have to be fitted at the ENDS of the cable run.
Note I am stressing the word ENDS here. This is very important for correct operation of the RS485 system of transmission and prevents reflections from a mismatched cable termination from corrupting the data signal.
Agree with Roberts comment re termination resistor etc.
I used RS-485 as the underlying comms protocol for the theatrical DMX-512 system.
See this post re testing etc - it also contains links to other doco about RS-485
You need to have the individual devices respond to individual addresses if sending info, or have some end-to-end protocol to allow devices to receive / respond to appropriate commands if you are expecting them to provide data back to a central point. Note RS-485 is not really suitable for ethernet-style Carrier sense / collision detection modes
Another point worth considering.
RS485 is only the carrier of information. It will send whatever you ask it to, both ways.
Having provided the carrier medium it would then be up to the user to set up communications with satellite devices. If info is sent from one every other one will receive it. It is up to whatever is hanging off the RS485 system to sort it. The RS485 system as such has no say in what happens after the info is sent.
And you can get our latest projects and tips straight away by following us on: