Ground and a twisted pair
The receiver reads the difference between CANH and CANL, but it still needs both wires within −2 V to +7 V of its own ground. Boards on separate supplies share no ground until a wire gives them one, so GND runs with the pair. And CANH and CANL go down one twisted pair, so noise lands on both alike and cancels.
Why ground, on a differential bus
The receiver decides each bit from CANH − CANL, and a ground difference between two boards does not change that. But it moves both wires together, measured from the receiving board's ground. The SN65HVD230 works with its bus pins anywhere from −2 V to +7 V of its own GND. Past that it no longer promises to read them, and past −4 V or 16 V it can be damaged.
Two boards on separate supplies have no common ground unless a wire gives them one, and their grounds can sit volts apart. A long cable, a motor on one supply or a different mains socket is enough. The middle screw of the terminal, and the middle of the three pins, are for that wire: GND to GND, alongside CANH and CANL.
On a desk this is easy to miss. Two ESP32 boards on USB cables from the same computer already share its ground, so the bus works without the wire. Then one board moves to a battery and it stops.
Why a twisted pair
The difference cancels noise only if both wires pick up the same amount of it, and they do only if they stay the same distance from every source of it. Twisting them together does that. Two loose wires a few centimetres apart pick up different amounts, and part of the noise survives the subtraction.
So: CANH and CANL on one twisted pair, GND on a third wire of the same cable. Network cable works well, with CANH and CANL on the two wires of one pair.
The shape of the bus
Run one cable past every board, end to end, and keep the short branch from the cable to each board's terminal as short as you can: ISO 11898 allows 0.3 m. That gives the bus exactly two ends, which is where the two 120 Ω resistors go.
When it does not work
Usually because both boards take their power from the same computer, which joins their grounds through the USB cables. Move one board to its own supply, a battery or a different charger, and the bus that worked can stop. Run the wire from the start.
Yes. Put CANH and CANL on the two wires of one pair, orange and orange-white for example, and GND on a wire from another pair. CANH from one pair and CANL from another is two loose wires as far as noise is concerned.
Then the grounds can differ by more than any wire should carry, and a ground wire itself carries current between them. Use isolated CAN transceivers for that run; this board is not isolated.
Edit this page — content/books/can-bus/ground-and-twisted-pair.mdx
Questions about this product
See what other owners have asked, and read their solutions.
CAN Bus
Loading 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.