How to identify RS485 wires

On a 2-wire RS485 connection. What is the easiest way to find out which wire is D+ and which is D- if there are no markings on any of them??

Use a digital multimeter, and measure which is more positive than the other (i e, which way gives you a positive bias reading, and which way gives you a negative bias reading.)

Thanks, I will try that. I assume this would be in relation to signal Ground, right?

Can same method be used with TX and RX for RS232?

For RS485, you actually measure the two lines compared to each other – ground is not needed.

For UART, the “receive” might be pulled high weakly to stabilize the receiver circuit (as a “0” is the start bit.) Thus, you can’t necessarily tell TXD from RXD that way. Also, when the signal is connected, RDX for one end is TXD for the other end. Easier would be to transmit a long sequence of 0 bytes, and look at which line drops average voltage when you do (for positive logic) or gains average voltage (for actual RS-232 signals.) That will be your transmit line!

Great, thanks for the clarification.

How exactly would you go about doing this?

Hi, tapete.

There are two wires in an RS-485 bus: D- and D+ (or A and B). When the bus is transmitting a 1, D-/A will be low and D+/B will be high. For transmitting a 0, the lines swap polarity. To measure which is which, have a device on the line send 1s or 0s and measure the voltage across the two lines.

The Wikipedia article for RS-485 has more information

-Claire