Instrumentation & Automation
ru
wap
Application for Windows ⁄ Android
Alexander Bratsuk, Kiev.

RS485 interface

Introduction

The RS232 interface was widely used in its time, mainly due to the fact that it was supported on the hardware level by the first computers. Its main purpose is the connection between the computer and the peripheral device. The main disadvantages:

This did not allow it to be widely used in industrial communication lines when designing large networks. The RS485 interface developed has solved many of these problems. As mentioned above, the RS232 interface did not have enough noise immunity - the transmitter and receiver compared the voltage on the data lines and the handshake with respect to the common zero wire to detect the binary signal. A change in the potential of the neutral wire caused interference, although the level of the determination of «0» and «1» was chosen quite high - about 3 volts. Electromagnetic interference reduced both the maximum distance of the communication line and the maximum speed of data transmission and reception.

In the implementation of the RS485 interface, the principle of detecting a useful signal is laid by differential comparison of potentials on a two-wire line, usually in the form of a twisted pair. The potential of the zero wire does not matter. In addition, in-phase electromagnetic interference does not make a big difference to the differential, difference signal in the twisted pair. This allowed to increase the length of the communication line to 1200 meters at a speed of 100 kbs (speed at a line length of 12 meters - 35 Mbs). The sensitivity of the receiver is about 200 mV.

RS485 devices

Since the RS485 line consists of a twisted pair, it is logical to assume that the devices are connected to it by two contacts:

Optionally, a third wire can also be used as a null bus.

The block diagram of master-slave of the interface RS485

Schematically, the circuit of the device-client of the RS485 interface can be considered as a certain block, in which there is a receiver and a data transmitter, where the inputs of one are combined with the outputs of the other.
There is also a processor unit that controls the actions of the transmitter, based on the program contained in it.
It causes the receiver to continuously listen to the communication line, and when the data on the line is intended for this unit, it is determined by the device address, processes the incoming packet and, if necessary, issues its response in the form of a set of binary pulses to the same line.

Design RS485 network

The topology of the RS485 network interface, is another of its main advantages. This is the only interface that can connect a single line from a twisted pair of multiple transmitters and receivers that are connected in parallel. To a single line, you can connect 32 devices with an input resistance of 12 kOm. When using modern high input resistance devices, their number can reach 256. Using signal repeaters (repeaters), the number of devices can reach tens of thousands located one from another for kilometers. Without complex network equipment and software, it is possible to create a branched network of various devices, besides it is easily expandable - if desired, simply screw a new device to the two pins, having adjusted something in the control program.

Design RS485 network

Therefore, the RS485 interface has gained immense popularity for communicating with each other computers, PLC controllers, sensors, secondary devices. It is based on the systems of process control, instrumentation and automation. In the industry, old cable trays, shields, tons of cables are replaced by a thin line of twisted pair that unites sensors, displays, and secondary devices. In the figure, at the beginning and end of the line, terminating resistors R, with a resistance of 100 Om (to eliminate the reflection effect of the signal) are applied.

How the RS485 interface works

Typically, all devices on the network can either receive data from the network (listen), or transfer data to the network, to a common line. When the device receives data, the output of its transmitter is in the Z-state (with high impedance) and does not affect the operation of the line in any way and does not interfere with other devices. Each device in the network in advance, in its settings assigned its own unique network address. And so everything is connected, all devices are listening. What's next? Someone should be the first to speak.

Typically, a host is assigned to the network, which initiates the operation of the entire line. A host can be, for example, a computer or a PLC panel connected to an interface. The host sends and receives data from other devices on the network, manages these devices according to the algorithm of the program installed in it. In turn, the host can be a slave of a completely different line of the RS485 interface, which is higher. So multi-level networks are organized.

On the principles of RS485, well-known interfaces like Profibus and Modbus are built.