RS485 board/A real bus/10. Wiring a real bus
A real bus · 10 of 11

Wiring a real bus

Off the desk, three things decide whether a bus works: A and B on one twisted pair, a ground wire run with them, and one line from end to end with the 120 Ω at its two ends. Each is cheap to get right and expensive to find later.

Three choices

Cable, ground and shape
a bus that holds up
Cable
Ground
Shape
Noise
cancels
Common ground
yes
Cable ends
2, both terminated
A bus that holds up. A and B on one twisted pair, GND alongside on a third wire, one line from end to end, and the 120 Ω kept only on boards 1 and 4.

A and B on one twisted pair

The whole trick of RS485 is that noise lands on A and B alike and cancels in the difference. That only holds while the two wires are the same distance from every source of noise, which is what twisting them does. Two loose wires a centimetre apart pick up different amounts, and the difference carries some of it through.

Network cable is a good, cheap choice: its pairs are about 100 Ω, close enough to the 120 Ω terminators. Use both wires of one pair for A and B.

Ground goes with the pair

The receiver reads A − B, but it still needs A and B to sit within −7 V to +12 V of its own ground. Two boards on separate supplies have no common ground unless a wire gives them one, and their grounds can drift volts apart — enough to push A and B outside that range, where the receiver reads nothing or reads garbage.

That is what the middle screw of the terminal is for: GND to GND, along the cable, with A and B. A third wire of the same cable, or a wire from the next pair, does it.

On a desk this is easy to miss. Two boards powered from the same computer already share its ground through the USB cables, so the bus works without the GND wire, and then fails the day one board moves to its own power supply.

One line, end to end

Run the cable past every board, from the first to the last, and keep the short stub from the cable to each board's terminal as short as you can. That is a daisy chain, and it has exactly two ends, which is where the two 120 Ω resistors go. Take them off every other board, as in Only the two ends keep it.

A star — branches from a centre point to each board — has as many ends as it has branches, and there is no right place for two terminators. It works on a short, slow bus and misbehaves on a long, fast one.

Before you power it

With everything wired and the power off, measure across A and B at any terminal. About 60 Ω means two terminators, one at each end. About 120 means one is missing; under about 50 means some middle board still has its resistor.

When it does not work

Can I use network cable?

Yes, and it is a good choice: four twisted pairs of about 100 Ω. Put A and B on the two wires of one pair, orange and orange-white for example, and use a wire from another pair for GND. A from one pair and B from another is two loose wires as far as noise is concerned.

Do I really need the GND wire if both ends are earthed?

Run it. Two earths in different places can sit volts apart, and the receivers need A and B within −7 to +12 V of their own ground. The ground wire keeps every board close to the same zero. Between buildings, or near heavy machinery, use isolated transceivers, which these boards are not.

How long can the stubs to each board be?

As short as you can make them. A stub is a branch off the bus, and every branch is an unterminated end. A few centimetres of wire from the pair to the terminal is fine at 9600 baud; a metre-long tail is asking for echoes on a long, fast bus.

How far can I go?

The standard covers about 1200 m, at slow speeds. At 9600 baud on decent twisted pair with both ends terminated, hundreds of metres is ordinary. Go slower before you go further: every halving of the baud rate doubles the time each bit has to settle.

Where this goes next

Where to look first, symptom by symptom.

When nothing arrives

Edit this page — content/books/rs485/wiring-a-real-bus.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum