serial-bench one bench, five serial buses - read-only archive

serial-bench / RS-485 / msg #4

Four hundred metres between two buildings, and the ground that was not one

From
Ivo Kallas <ivo@rawsocket.cloud>
Date
Wed, 19 Nov 2025 09:00:00 +0200
Subject
Four hundred metres between two buildings, and the ground that was not one
Message-ID
<20251119.0900.rs485iso@rawsocket.cloud>
List-Id
serial-bench.rawsocket.cloud
X-Bus
RS-485
X-Topic
RS-485, two-wire half duplex, 19 200 bit/s

Six devices in a workshop reported to a logger in the office across the yard. The link dropped frames every weekday between roughly 06:40 and 07:20 and then behaved impeccably for the remaining twenty-three hours. A fault with office hours is a gift: it means something in the building schedule is the stimulus.

I inherited this run rather than building it, and the first thing I did was wrong. I assumed 400 m at 19 200 bit/s might be pushing the cable, so I spent an evening on termination and bias resistors. A bit cell at that rate is 52.1 µs and the round trip on 400 m is about 4 µs, which is under eight per cent of a cell. Termination there is housekeeping, not a cure. The cable was never the problem.

The measurement that changed the question

RS-485 is differential, which people hear as «immune». It is not immune; it is tolerant within a window. A common receiver accepts the pair anywhere from −7 V to +12 V relative to its own ground, and outside that window the input stage stops being a comparator and the data is whatever the silicon feels like.

So I stopped probing the data and probed the grounds. I clipped a differential probe between the ground stud in the workshop cabinet and the ground at the logger, with the pair disconnected, and logged for a morning.

Potential between the two building grounds, 2025-11-12, data pair disconnected
TimeRMSWorst excursionFrame errors that minute
05:300.4 V1.1 V0
06:380.5 V1.3 V0
06:421.9 V28 V61
07:051.8 V24 V47
07:260.6 V1.4 V0
11:000.4 V0.9 V0

The steady 1.9 V RMS is unpleasant but harmless - well inside the window. The excursions to 24–28 V are not. They start when the workshop ventilation and the heat pump come up on their morning timer and they stop when the inrush is over. For those tens of milliseconds the receiver in the office sees a pair that is lifted clean out of its common-mode range, and it reports exactly what you would expect: framing and checksum errors, not silence.

I should say what I did not establish. I did not instrument the switchgear, so I cannot name which load produces the transient or whether it couples through the earth path or through the cable's capacitance. The correlation with the timer is strong across four mornings, and that was enough to justify the fix, but it is correlation.

What I changed, in the order I changed it

Isolated transceiver at the workshop end
A transceiver with an integrated isolation barrier rated 2.5 kV, fed from a small isolated DC-DC converter. The point is that the far end no longer has an opinion about what «ground» means; the pair floats with the transient instead of fighting it.
Shield bonded at one end only
The cable screen was previously clamped in both cabinets, which turns it into a conductor between two grounds that differ - the thing I had just measured. It is now bonded in the office cabinet and left floating, insulated, at the workshop end.
Failsafe bias at one node, not three
Two of the six devices had their internal bias jumpers fitted, and so did the logger. Three sets of pull-up and pull-down resistors in parallel load the pair and shrink the idle differential voltage. I left bias enabled only at the logger and measured 215 mV on an idle bus afterwards, comfortably above the 200 mV a receiver needs to call the line idle rather than guess.
Termination corrected while I was in there
120 Ω at the logger and at the last workshop device, and the spare resistor that somebody had fitted at device four removed. This changed nothing measurable at 19 200 bit/s. I did it so that the next person raising the bit rate does not inherit my shortcut.

Result

Three weeks of logs after the change: zero frame errors, including on mornings when I confirmed the ground transient was still there at 26 V peak. The electrical problem in the yard has not gone away - the link simply stopped caring about it, which on a 400 m run between two separately earthed buildings is the best outcome available.

If a differential link fails on a schedule, measure the grounds before you touch the data pair. Five minutes with a probe between two earth studs answered a question that two evenings of resistor swapping had not.