serial-bench / RS-485 / msg #4
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.
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.
| Time | RMS | Worst excursion | Frame errors that minute |
|---|---|---|---|
| 05:30 | 0.4 V | 1.1 V | 0 |
| 06:38 | 0.5 V | 1.3 V | 0 |
| 06:42 | 1.9 V | 28 V | 61 |
| 07:05 | 1.8 V | 24 V | 47 |
| 07:26 | 0.6 V | 1.4 V | 0 |
| 11:00 | 0.4 V | 0.9 V | 0 |
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.
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.