RS232 to RS485 Converter and Adapter Wiki
RS232 to RS485 Converter Wiki by Magneto Tech Research
What is a RS232 to RS485 converter and how is it used? How do I choose the right model and how do I connect it? What to look for when shopping for a RS232 to RS485 converter. Here are answers to all your basic (and possible advanced) RS232 to RS485 questions in an easily understandable language.
What is a RS232 to RS485 converter?
The RS232 to RS485 converter comes in many models, sizes and shapes, here are a few examples:
The main differences between these RS232 to RS485 converter units are that some of them can have a DB9 connector whereas others have a terminal screw header or RJ11 connector, some are isolated some are not, some has more than one RS485 port, some has LED lights for indicating RX/TX data flow, some are port-powered and some needs an external power supply, some are industrial strength, some are consumer products. The RS232 to RS485 itself, regardless of what model you choose, is simply a device which can convert standard RS232 data signals into RS485 signals and vice versa. Most RS232 to RS485 converters can convert data in both directions, from RS232 to RS485 and from RS485 to RS232, this is also called a bi-directional converter. We will here not go into the specifics of how the RS232 or RS485 protocol works, but if you are interested in this then there is lots of RS232 and RS485 information on Wikipedia, including how a USB to serial adapter works. We will however demonstrate the most common ways of connecting a RS232 to RS485 converter.
Types of RS232 to RS485 Converters
There are several types of RS232 to RS485 converters available, each with its own unique features and benefits. Understanding these differences can help you choose the right converter for your specific needs.
-
Port-powered Converters: These converters draw power directly from the RS232 port, eliminating the need for an external power supply. They are ideal for applications where simplicity and ease of use are paramount.
-
Externally Powered Converters: These converters require an external power supply to operate. They are often used in industrial and commercial environments where a reliable power source is available, ensuring consistent performance.
-
Industrial-grade Converters: Designed for harsh industrial environments, these converters offer features such as high-temperature operation, surge protection, and rugged construction. They are built to withstand the rigors of industrial use.
-
Bi-directional Converters: These converters can handle data transmission in both directions, allowing for full-duplex communication between devices. This feature is essential for applications that require simultaneous sending and receiving of data.
-
Isolated Converters: Providing electrical isolation between the RS232 and RS485 interfaces, these converters effectively protect against ground loops and static electricity. They are crucial for environments where electrical interference is a concern.
When should I use a RS232 to RS485 converter?
RS232 to RS485 converters are mostly used in industrial and commercial environments. The reason is that the RS485 converter can be used for multi-drop networks, meaning that you for example can connect multiple RS485 devices to one computer. Up to 32 devices can be connected in one network to communicate on a single pair of wires (plus a ground wire), and the number can even be increased by using RS485 repeaters. This type of communication is called half-duplex communication. Most quality RS485 converters can communicate in this manner of up to 4000 feet (1200 meters). The RS485 converter is also fairly resistant to noise which is one more reason why it is favored in industrial environments. Examples of uses for a RS232 to RS485 converter could be for connecting cameras, scales, meters, scanners, PLC's or most other industrial equipment to a computer.
RS232 to RS485 Circuit Schematic
Serving as an example, below schematic shows what a typical RS232 to RS485 converter circuitry looks like.
Connecting a RS232 to RS485 converter.
Okay, so how do you connect a RS232 to RS485 converter? The RS232 to RS485 converter can be used for point-to-point connections (connecting one RS232 to RS485 converter directly to another RS232 to RS485 converter) and point-to-multipoint networks (connecting one RS232 to RS485 converter to multiple RS232 to RS485 converters. Lets first take a look at the point-to-point setup which is fairly simple, it looks like this:
The RS485 Master could be a computer and the slave could for example be a camera. As you can see the data lines A- and B+ are simply connected to the RS485 Slave's A- and B+ respectively. The converters will communicate with only A- and B+ connected, however it is very important to also connect the ground wire in the finished system to establish a steady reference point to prevent data loss and other bad things. A typical RS232 to RS485 point-to-multipoint setup could look like this:
In a RS485 network only one slave and one master can communicate at a time, either transmitting or receiving, but not at the same time, so you might wonder how this is accomplished. Simply speaking the slaves (also called nodes) must be addressed, for example node 1 has address 001, node 2 has address 002 and so forth. These addresses are usually assigned and controlled by software, either the software running at the RS485 master (PC), or software programmed in each of the slaves. Sometimes the equipment connected at the RS485 slaves is addressable by hardware instead of software. Finally, some RS232 to RS485 converters are addressable (by DIP switches) itself, this is however not used very often.
Installation and Configuration
Installing and configuring an RS232 to RS485 converter is a relatively straightforward process. Here are the general steps to follow:
-
Connect the RS232 Interface: Use a standard RS232 cable to connect the RS232 interface to the converter.
-
Connect the RS485 Interface: Use a standard RS485 cable to connect the RS485 interface to the converter.
-
Configure the Converter: Depending on the model, configure the converter using dip switches or software. This step involves setting the correct communication parameters.
-
Set Communication Parameters: Adjust the baud rate and other communication settings to match the requirements of the devices being connected.
-
Test the Converter: Ensure that data is being transmitted correctly by testing the converter. This step helps verify that the setup is functioning as expected.
Termination.
In some cases, if the communication distance is long (above 1000 feet) and if the baud rate is over 115kbit it is recommended to put a resistor (typically 100 ohm) at the RS485 node (across the A and B lines). Adding the termination resistor does however dramatically increase power consumption so it should not be done, and is mostly not needed at shorter distances. Due to the increased power consumption termination is also rarely done when using port-powered converters.
Port-powered or externally powered.
Some RS232 to RS485 converters are powered from the computer's COM port (usually from either TX, RTS or DTR), others need an external power supply to work. Even with port-powered converters you should in most cases be able to communicate up to the specified 4000 feet, however adding a terminal resistor can interfere with this distance because it increases power consumption. Many port-powered RS232 to RS485 converters provides an option for supplying external power. If in doubt, use an externally powered converter, then you are sure that it gets sufficient power. I using for example a USB to Serial adapter these same assumptions can be applied.
Isolation.
RS232 to RS485 converters can be either isolated or non-isolated. An isolated RS232 to RS485 converter has optical isolators separating the data lines inside the unit, which effectively protects against noise, high voltage spikes, surges, ground-loops, and other electrical disturbances, preventing damage to your computer or connected equipment. Some RS232 to RS485 converters even have the externally power supply isolated from the rest of the converter to provide additional protection. Usually isolated converters are only used if the user wants to additionally protect the equipment connected to the network (in case the equipment is of high value), or if there are reasons to suspect high voltage spikes or similar in the network. A non-isolated converter usually only have a simple protection against static electricity and low-voltage spikes.
Applications in Commercial Environments
RS232 to RS485 converters are commonly used in various commercial environments, providing reliable and efficient communication solutions. Some common applications include:
-
Point-of-Sale Systems: Connecting point-of-sale terminals to a central server, ensuring seamless transaction processing.
-
Security Systems: Integrating security systems with alarm panels and cameras, enhancing overall security management.
-
Industrial Control Systems: Connecting industrial control systems to sensors and actuators, enabling precise control and monitoring.
-
Network Communication: Extending the communication distance between devices in a network, ensuring reliable data transmission over long distances.
Benefits of Using a RS232 to RS485 Converter
Using an RS232 to RS485 converter offers several benefits, making it a valuable addition to various applications:
-
Extended Communication Distance: RS485 converters can extend the communication distance between devices up to 4000 feet, providing flexibility in network design.
-
Increased Reliability: RS485 converters offer effective protection against high voltage spikes, surges, and ground loops, ensuring reliable data transmission.
-
Improved Data Transmission: RS485 converters provide faster and more reliable data transmission compared to RS232 converters, enhancing overall system performance.
-
Flexibility: RS485 converters can be used in a variety of applications, including industrial and commercial environments, making them a versatile solution for different communication needs.
By understanding the types, installation process, applications, troubleshooting, and benefits of RS232 to RS485 converters, you can make informed decisions and ensure optimal performance in your specific use case.
Troubleshooting and Maintenance
Maintaining and troubleshooting an RS232 to RS485 converter is relatively easy. Here are some common issues and solutions:
-
Data Transmission Errors: Ensure that the baud rate and communication parameters match the requirements of the devices being connected. Incorrect settings can lead to data errors.
-
Power Issues: Verify that the power supply is sufficient to power the converter. Insufficient power can cause the converter to malfunction.
-
Ground Loops: Check for ground loops and use an isolated converter if necessary. Ground loops can cause interference and data loss.
-
Static Electricity: Protect against static electricity by using an isolated converter or other protective measures. Static electricity can damage sensitive components.
How to choose the right RS232 to RS485 converter.
When shopping for a RS232 to RS485 converter you should first determine if you need an industrial strength or a commercial/consumer grade converter, this depends on which environment you plan to use the converter. Next you should determine if you need and isolated or non-isolated converter, where after you can decide if you need an externally powered converter or if you can use a port-powered converter. Next you can find the connector type you need, either DB9 or DB25 connectors, terminal screw header, RJ11 connector or a combination hereof. Finally you should decide if you want LED lights for the TX/RX lines, this can be very helpful when troubleshooting. What is called 'Automatic Send Data Control', which controls the data flow, is strongly recommended for most applications and devices, this feature is built into most modern RS232 to RS485 converters.
The short check list looks like this:
1. Industrial or consumer grade.
2. Isolated or non-isolated.
3. Externally powered converter or if you can use a port-powered.
4. Connector type.
5. LED lights.
The standard RS232 to RS485 converter
The portpowered isolated RS232 to RS485 converter
The isolated RS232 to RS485 / RS422 DB 25 converter
The isolated RS232 to RS485 DB 9 converter
Other resources: