Doing engineering a lot of times will mention RS485 control line, what is it in the end? Today I talk about RS485-related applications, in-depth understanding of RS485, you will find that there is really a lot of knowledge inside, then we will choose some of the usual weak power will be taken into account for your understanding.
First, what is the RS485 bus
Industrial sites often need to collect multi-point data, analog signals or switching signals, generally used RS485 bus, RS-485 using half-duplex mode of operation, support for multi-point data communication.RS-485 bus network topology is generally used to terminate the matching of the bus-type structure. That is, a bus is used to connect each node in series, and does not support ring or star network.
RS485 no specific physical shape, according to the actual situation of the project and the interface, RS485 using differential signaling negative logic, +2V ~ +6V said "0", - 6V ~ - 2V said "1".
RS485 has two-wire and four-wire wiring, four-wire system can only realize the point-to-point communication, now rarely used, now more two-wire wiring system, this wiring system for the bus topology in the same bus can be connected to a maximum of 32 nodes.
The communication distance of 485 bus can reach 1200 meters. According to the theory of 485 bus structure, under the premise of ideal environment, 485 bus transmission distance can reach 1200 meters. The condition is that the communication cable is of high quality, the baud rate is 9600, and only one 485 device is loaded in order to make the communication distance reach 1200 meters, so usually the actual stable communication distance of 485 bus is often less than 1200 meters. If the load of 485 devices, wire impedance is not in line with the standard, wire diameter is too thin, poor quality converter, equipment lightning protection complex and baud rate increase and other factors will reduce the communication distance.
Second, RS485 cable
In general occasions using ordinary twisted-pair cable can be, in a more demanding environment can be used with a shielded layer of coaxial cable. In the use of RS485 interface, for a particular transmission line, from the RS485 interface to the load of the data signal transmission of the maximum allowable cable length and the baud rate of signal transmission is inversely proportional to the length of the data is mainly affected by the signal distortion and noise and other effects.
Theoretically, the longest transmission distance of RS485 can reach 1200 meters, but in practice the transmission distance is shorter than 1200 meters, depending on the surrounding environment. In the transmission process can be used to increase the relay method of signal amplification, you can add up to eight relays, that is, theoretically the maximum transmission distance of RS485 can reach 9.6 kilometers. If you really need long-distance transmission, you can use optical fiber as the transmission medium, transceiver ends each with a photoelectric converter, multi-mode fiber transmission distance is 5 ~ 10 km, while the use of single-mode fiber up to 50 kilometers of transmission distance.
Third, RS485 wiring installation considerations
1,What kind of communication line should be used for 485 bus? How many devices can be connected to a bus?
RVSP shielded twisted-pair cable must be used. Shielded twisted-pair cable specifications used, and the distance of the 485 communication line and the number of devices hooked up, as shown in the table below. The use of shielded twisted-pair cables helps to reduce and eliminate the distributed capacitance generated between the two 485 communication lines as well as the common mode interference generated from around the communication lines.
It has been said that the 485 bus can take 128 devices for communication.
In fact, not all 485 converters are able to take 128 devices, according to the 485 converter chip model and 485 device chip model to determine, only according to the indicators of the lower chip to determine its load capacity. General 485 chip load capacity has three levels - 32 units, 128 units and 256 units. In addition to the theoretical nominal often actually can not be reached, the longer the communication distance, the higher the baud rate, the finer the wire diameter, the poorer the quality of the wire, the poorer the quality of the converter, the converter of the power supply is not enough (passive converter), lightning protection, the stronger, all of which will reduce the real number of loads.
Most of the engineers are accustomed to using category 5 network cable or super category 5 network cable as 485 communication cable, which is wrong. This is because:
(1) Ordinary network cable has no shielding layer and cannot prevent common mode interference.
(2) You can not use too thin wire diameter network cable, will lead to a reduction in transmission distance and can be hooked up to reduce the number of devices, at least 0.4mm square or with a standard network cable.
(3) Network cable is a single strand of copper wire, compared with multi-core wire is easy to break.
2,Why grounding
The 485 transceiver works properly when the specified common mode voltage is between -7V and +12V. If it is out of this range it will affect the communication and seriously damage the communication interface. Common mode interference will increase the above common mode voltage. One of the effective means of eliminating common-mode interference is to use the shield of the 485 communication line as a ground, the machine, computer and other equipment in the network ground connected together, and by a point of reliable access to earth.
3, 485 communication line should be how to route
Communication lines as far away as possible from high-voltage power lines, fluorescent lights and other sources of interference, communication lines can not be avoided with the power line and other sources of interference when the communication line should be perpendicular to the power line, can not be parallel, and can not be bundled together, and the use of high-quality twisted-pair cable routing.
4, why 485 bus should be hand in hand structure, and can not use the star structure?
Star structure will produce reflected signals, which will affect the 485 communication. The length of the branch line from the bus to each terminal device should be as short as possible, generally not exceeding 5 meters. The branch line, if not connected to the terminal, will have reflected signals, which will produce strong interference to the communication, and should be removed, and it is best to connect a 120Ω termination resistor at both ends of the RS485 device.
The puller is connected as shown:

The star connection is shown in the figure:

5. Can there be contacts from device to device on the 485 bus?
In the same network system, use the same kind of cable to minimize the joints in the line. Make sure the joints are well soldered and tightly wrapped to avoid looseness and oxidation. Ensure a single, continuous signal path as a bus.
6,What is meant by common mode interference and differential mode interference? How to eliminate interference on the communication line?
485 communication line consists of two twisted wires, it is through the two communication lines between the voltage difference between the way to pass the signal, so it is called differential voltage transmission. Differential mode interference is transmitted between the two signal lines and is a symmetrical interference. The method of eliminating differential mode interference is to add a bias resistor (matching resistor in the dome) in the circuit and to use a twisted pair of wires; common mode interference is transmitted between the signal lines and the ground, and belongs to asymmetric interference. Methods to eliminate common mode interference include:
(1) Use shielded twisted-pair wires and effective grounding.
(2) Strong electric field places should also consider the use of galvanized pipe shielding.
(3) Wiring away from high-voltage lines, not to mention high-voltage power lines and signal lines bundled together.
(4) Use linear regulated power supply or high quality switching power supply (ripple interference less than 50mV).
7,What circumstances should I add terminating resistors to the 485 bus?
Generally there is no need to increase the terminating resistor, only in the case that the 485 communication distance is more than 300 meters, it is necessary to increase the terminating resistor at the beginning and the end of the 485 communication. Especially when the number of devices on the 485 bus is small. When the number of devices is large (e.g. more than 22). Generally it is not necessary to increase the termination resistor, because the termination resistor will reduce the loading capacity of the 485 bus. The connection of the 120Ω matching resistor of the ball machine terminal is as follows: The ball machine terminal 120Ω matching resistor can be connected by dialing the code through the dip switch dialing on the chassis of the ball machine. When the ball machine is shipped from the factory, the 120Ω matching resistor is not connected by default, you can connect the 120Ω matching resistor to the line by dialing the 10th position of the dip switch to ON. On the contrary, if the 120Ω matching resistor is not accessed, just dial the 10th position to OFF.
8, the actual application of the problem
The actual construction and use of users often use star-shaped connection, the terminal resistor must be connected to the line distance between the two farthest devices (as shown below, 1 # and 15 # equipment), but because the connection does not meet the requirements of the RS485 industry standard, so in the distance between the various equipment lines, it is prone to signal reflections, anti-jamming ability to reduce the problem, resulting in a decline in the reliability of the control signal. . At this time, the phenomenon of the ball machine is completely uncontrolled, or can not stop their own operation.

For this case, it is recommended to use the addition of an RS485 distributor. This product effectively converts the star connection into a connection that conforms to the connection specified in the RS485 industry standard, thus avoiding problems and improving communication reliability, as shown in the figure below.

9, no relay maximum transmission distance recommended cable
(1) Ordinary twisted shielded cable STP-120Ω (for RS485 & CAN) one pair 20 AWG, cable O.D. 7.7mm or so. Suitable for indoor, pipeline and general industrial environments. When used, the shield is grounded at one end!
(2) Ordinary twisted shielded cable STP-120Ω (for RS485 & CAN) one pair 18 AWG, cable O.D. about 8.2mm. Suitable for indoor, pipeline and general industrial environments. When used, the shield is grounded at one end!
(3) Armored twisted shielded cable ASTP-120Ω (for RS485 & CAN) one pair 18 AWG, cable O.D. 12.3mm or so. It can be used in places with severe interference, frequent rodent infestation, and requirements for lightning and explosion protection. It is recommended to ground both ends of the armor layer and one end of the inner shield.
Fourth, RS485 common faults and solutions
First, how to prevent failures?
In order to reduce communication failures put forward the following suggestions.
1, it is recommended that users use and purchase the 485 converter provided by the manufacturer or the manufacturer to specify the recommended brand of 485 converter.
2, the manufacturer will do a lot of testing work with its matching 485 converter, and will require the 485 converter manufacturer in accordance with its fixed performance parameters for production and quality testing, so it has a better compatibility with access control equipment. Do not be greedy for cheap purchase of miscellaneous manufacturers of 485 converter.
3, strictly in accordance with the construction specification of the 485 bus construction, put an end to any fluke.
4,Adopt scientific and reserved solutions for the 485 bus project with longer lines and more loads.
5, if the communication distance is too long, such as more than 500 meters, it is recommended to use repeaters or 485HUB to solve the problem.
6, if the number of loads is too much, such as a bus more than 30 units, it is recommended to use 485HUB to solve the problem.
7, site commissioning with all the commissioning equipment. On-site commissioning must carry a few can be connected to a long distance and multi-load converter, a commonly used computer laptop, test path break multimeter, a few 120 ohm terminal resistor.
Second, the use of 485 bus structure of several common communication failures are the following?
1,Communication is not on, no response.
2,Data can be uploaded, but not downloaded.
3,System prompts interference during communication, or the communication indicator keeps flashing when there is no communication.
4,Sometimes you can communicate, sometimes you can not communicate, some instructions can pass, some instructions can not pass.
Third, what are the debugging methods for failure?
Before debugging to first ensure that the equipment is wired correctly, and the construction is in line with the norms. Can be used according to the problems encountered in the following debugging methods.
1, common ground method:
With a line or shielded wire to connect all 485 devices GND ground, so that you can avoid the existence of all devices affecting the communication potential difference between.

2. Terminating resistor method:
Improve the communication quality by connecting 120 ohm terminating resistors in parallel on 485+ and 485- of the last 485 device.
3. Intermediate segment disconnection method:
By disconnecting in the middle to check whether the equipment load is too much, the communication distance is too long, and the influence of a certain device on the whole communication line.
4, pull the line alone method:
Individual simple pull a line to the device, which can be used to rule out whether the wiring caused by communication failures.
5, replace the converter method:
Carry a few converters, so you can rule out whether the quality of the converter affects the quality of communication.
6, laptop debugging method:
First of all, to ensure that they carry a computer laptop is a normal communication device, use it to replace the customer's computer for communication, if normal, it shows that the customer's computer serial port may be damaged or injured.
In the weak power intelligent engineering, RS485 application is a lot, the most common application in the access control system, BA system, intelligent lighting system, parking management system, etc., with the continuous popularization of digital network, now RS485 in the weak power application is less and less.




