You are on page 1of 5

05/11/12

RS485 to RS232 conv erter | Aquaticus

Search

About

Terms

Aquaticus
Projects for geeks Home Projects Technical articles

RS485 to RS232 converter


ROV R S485 R S232 MAX485 MAX232 06 De c 2006

RS485 is an alternatve for RS232 for long distances. Maximum length of the cable for RS232 is only 15m. For RS485 it is about 1200m. In addition you can connect many devices to RS485 bus (unlike RS232 only 2). Send/receive mode is selected by RTS signal. The converter was designed to be as simple as possible, so it has no some features that can be found in commercial grade products (e.g. galvanic separation).

Overview
Popular chip MAX232 is used to convert RS232 signals from/to TTL level. MAX485 converts TTL level signals to RS485 standard. RTS line is used to change transmission mode of MAX485. RTS signal is first converted to TTL level by MAX232 then connected to D E and R E / pins. 2 LEDs are used to indicate current state of the interface.

aquaticus.inf o/rs485_to_rs232

1/5

05/11/12

RS485 to RS232 conv erter | Aquaticus

Duplex
If your control system needs to receiving and sending data in the same time you must use full duplex transmission mode. It is possible (and in real world this is the most popular case) that control system first sends request message and than waits for the response. For this kind of systems half duplex communication is sufficient. This interface operates in half duplex mode at it only require 2 wires (full duplex 4 wires) and is simpler to build.

Terminator
RS485 bus must be terminated on the ends for long lines. By default it is [b]120[/b] resistor. If there are more then 2 devices on the bus, terminator is needed only on the first and last unit. Terminator can be omitted for short lines.

PCB
Single layered, size is 6348mm. PCB artwork, the schematic and part list is available as PDF documents at the end of this article.

Testing
aquaticus.inf o/rs485_to_rs232 2/5

05/11/12

RS485 to RS232 conv erter | Aquaticus

After soldering all the elements, power the device. Red LED (LED2) should be bright. Check voltage between pins 15 & 16 of MAX232 and between pins 5 & 8 of MAX485. It should be 5V.

Initial test
This test is just to prove that some parts of the converter works. It needs only PC computer; another RS485 device is not required at this stage. Connect your PC computer with converter using RS232 cable. Run Hyperterminal in Windows or any other terminal program, set 9600bps, 8N1 and handshaking None. When you click hook on and hook off icons you should notice change in green LED. Click hook on icon and type anything in terminal window, the voltage between CON2-1 and CON2-2 should change quickly. Note You can use any other serial terminal program.

Real test
To see if converter works well some data must be properly sent and received. For the real test you need another device with RS485 interface. If you have two RS485 interfaces you can check interface using simpler method. Just connect two interfaces, run 2 terminal programs and see if one terminal program can receive what you type in the other window. You must remember to switch appropriate send/receive mode for both interfaces (set appropriate state of RTS signal). When the converter is in TX mode and transmits data you can notice voltage change between A-B pins.

Programming
From programmers point of view data transmission through RS485 is the same as serial port transmission. The only difference is that you have to set appropriate state of RTS line before sending/receiving any data. Because RTS line is very often used in half-duplex converters to switch TX/RX mode, many programs can be used without any modifications. Transmission modes of converter: RTS high you can receive data RTS low you can send data For Win32 API (MS Windows) when you setup serial port set manual control of RTS line in DCB structure.
d c b . f R t s C o n t r o l=R T S _ C O N T R O L _ E N A B L E ;/ / m a n u a lR T Sc o n t r o l&R T Si n i t a l l yh i g h

d c b . f R t s C o n t r o l=R T S _ C O N T R O L _ D I S A B L E ;/ / m a n u a lR T Sc o n t r o l&R T Si n i t a l l yl o w
aquaticus.inf o/rs485_to_rs232 3/5

05/11/12

RS485 to RS232 conv erter | Aquaticus

Before transmission set appropriate RTS state: To receive data set RTS high: E s c a p e C o m m F u n c t i o n ( h S e r i a l P o r t H a n d l e ,S E T R T S ) To send data set RTS low: E s c a p e C o m m F u n c t i o n ( h S e r i a l P o r t H a n d l e ,C L R R T S ) ; Green LED indicates the current status of RTS line. Attachment RS485_to_RS232_Converter_Schematic.pdf RS485_to_RS232_Converter_PCB.pdf RS485_to_RS232_Converter_Elements.pdf RS485_to_RS232_Converter_BOM.pdf Size 38.5 KB 18.51 KB 59.61 KB 43.22 KB
0 Stars

9 comments
Leave a message...

Discussion

Com m unity

d a rk Pri n ce

5 days ago

IC1 is MAX232 and IC2 is MAX485, can you please explain basiccaly which are those ICs and How does they work??
0

Reply

Share

s pinobot Mod

> dark Prince

4 days ago

MAX232 converts RS232 voltage levels (-/+15V) to TTL level (5V). MAX485 converts TTL signals into RS485 standard (current loop). If you connect both chips on TTL side you got converter from RS232 to RS485.
0

Reply

Share

Ya n g Ste ve n Go m e z Ma ti z

2 months ago

Hello, thanks for your help. I have some problems with the connection. I try explain what is the connection. I have a Compact Logix PLC of Allen Bradley, this PLC have a serial port, this plc support modbus rtu 232, but the drive with i need communicate support modbus rtu on rs 485. For solve the problem with the phsycal layer, i replicated your rs 485 to 232 converter, and i make one wire rs 232 with a female and male db9, and i make a rj45 wire to connect with the drive with the converter. In this moment i connect all system but the drive not response, i dont write or read any register. For this communication, this converter is the most appropriate? Or the problem is on the programming? Thanks sorry for my bad english PLC: Compact logix l23E Drive: OPTIDRIVE E2
aquaticus.inf o/rs485_to_rs232 4/5

Reply

Share

s pinobot Mod

> Yang Steven Gomez Matiz

2 months ago

I guess this converter may be inappropriate for your needs. First it's half duplex which may be a problem. Secondly, the direction of communication (transmit or receive mode) must be controlled by RTS line. If you wrote PLC soft to control OPTIDRIVE controlling send/receive line - it is not an issue. In that case half duplex generates problems -- you must be sure OPTIDRIVE do not send and receive data in the same time. Make sure when you switch between send/receive mode to wait some milliseconds before sending data.
0

Reply

Share

Ya n g Ste ve n Go m e z Ma ti z

> spinobot

2 months ago

Thanks for your answer, i have another question. In my DRIVE, i have two pin (rs modbus 485 + ) and (rs modbus 485 -), in the rs converter for 485 i have two pins, A and B. What is the polarity of this terminals. Thanks you
0

Reply

Share

s pinobot Mod

> Yang Steven Gomez Matiz

2 months ago

Don't remember but would try A+ and B-

Reply

Share

Ya n g Ste ve n Go m e z Ma ti z

2 months ago

Hello, I make this converter, but i have a problem, with connect the supply to the converter, the led red and green is ON, i use a rs232 cable, and i connect with hyperterminal, when hook on and off the led green not blink, the led is ON. I revised the connections and i was change the max232 and max485 but is not solution. How are the problem?.Thanks sorry for my bad english
0

Reply

Share

s pinobot Mod

> Yang Steven Gomez Matiz

2 months ago

First, check if RS232 RTS signal is properly propagated on the board. Measure RTS voltage as you press button in terminal: - on DB9 - on max232 chip - on DE of max485

You might also like