2
\$\begingroup\$

I'm working on a project that involves some long-distance communication using RS-485 and MAX485 and MAX3485 ICs. My project features custom PCBs (essentially Arduino/Teensy Shields) which react and respond to commands issued by one another. To properly test my sketches I've bought a USB-RS485 adapter board so I can use a PC to send commands in lieu of a complete "network" of devices.

I've opted to use RJ45 connectors as Ethernet cables are easy to make and obtain. The problem is looking online and at my USB-RS485 board there are different pinouts for an RJ45 connector. I'm using half duplex, just two wires and a ground/ground pair.

The pinout diagrams I've seen say to use Pins 1 and 2 for the A/B pairs, and others say 4 and 5 for them. My USB-RS485 adapter board (and corresponding RS485 breakout module (a Sparkfun clone) purchased for testing) both use pins 7 and 8 for the A/B pair. I've also seen Pins 1 and 7 be the A/B pair too.

I'm confused. Is there a "standard" pinout? Does it matter so long as everything connected matches? If there is a correct set of pins, what are they?

\$\endgroup\$
1
  • \$\begingroup\$ There's no official standard that I know of. The main requirement is that the A/B signal are on a common pair. \$\endgroup\$
    – Kartman
    Aug 29, 2021 at 8:20

1 Answer 1

5
\$\begingroup\$

RS-485 is an electrical standard, so it does not define any connector or pinout.

So if manufacturers want to use a 8P8C connector, they are free to do so and to define a pinout they want to use with it, and there is no single correct pinout.

If you want to be compatible with standard wiring and cabling used for Ethernet, the only limitation is that the RS-485 data pins must be sent over a twisted pair, so not just any random pinout will do.

The pinout of pairs used for Ethernet is 1-2, 3-6, 4-5 and 7-8, so that is why you have seen pins 1-2 or 4-5 or 7-8 being used for RS-485. However the choise of pins 1&7 will not result into a pair of wires in standard infrastructure cabling, so that might use custom cabling that is not compatible with existing infrastructure cabling.

However, there is also a downside of using the same connectors and wiring pairs than Ethernet does. If you accidentally connect a RS-485 device data pair to Ethernet device data pair, it might damage the Ethernet device transformer with unexpected voltage and current. Which explains why one of the pinouts you saw used pins 1&7 for data pair, as it is likely that an Ethernet device survives being connected to it just fine.

Also only the RS-485 data pair between devices is not enough, a common ground reference between RS-485 transceivers is also needed, and typically one pair is also dedicated for the ground connection.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ So as long as all the devices in the system use the same two pins and use a twisted pair it doesn't matter? Does my ground line need connecting on all daisy-chained devices or at just one node? \$\endgroup\$
    – Jamie
    Aug 29, 2021 at 18:23
  • \$\begingroup\$ That's right. And all devices must share a common bus reference somehow to talk reliably over the bus - even isolated devices. But what that means is a subject to pages worth of application notes how to build a working RS-485 bus from various chip manufacturers. \$\endgroup\$
    – Justme
    Aug 29, 2021 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.