Read this as a study guide instead

CAN bus

The CAN bus for robust multi-node communication in noisy environments.

Node A identifier 100 · 0x064
Node B identifier 200 · 0x0C8
Node C identifier 300 · 0x12C
109876543210Node A 0x06400001100100Node B 0x0C800011001000Node C 0x12C00100101100Bus (AND)00001100100winner 100 (0x064)

The same ideas, as prose

These are the exact fragments the model serves — also available as an ordered study guide.

One bus for many nodes in the noise

A point-to-point serial link ties two chips together and asks them to behave. CAN is what you reach for when that stops being enough: a whole crowd of controllers that all need to hear each other, strung along one shared wire, in a machine full of electrical noise. It was designed in the 1980s for cars, and its home turf is still vehicles and robots — anywhere a dozen small computers have to coordinate while motors and switching electronics spray interference across every wire nearby.

The letters stand for Controller Area Network, and every word earns its place. It is a network, so many nodes share one medium instead of each pair getting its own wires. It is built for a controller area — the electrically hostile insides of a machine — so noise rejection and error checking are not add-ons but the point. And it is a bus, one set of shared conductors that every node taps into and takes turns driving.

CAN gets three hard things right at once, and each is a fragment of its own: the wire itself shrugs off noise, the traffic is labeled by content rather than aimed at an address, and when several nodes talk at the same instant the bus sorts out a winner without anything colliding or being lost. Those three ideas are why a robust field bus reads so differently from a simple two-wire serial link, and why CAN has outlasted almost everything designed alongside it.

Why a car is a hostile place to send a signal

The inside of a vehicle or a robot is one of the worst places to try to send a clean digital signal. Motors switch large currents on and off, relays snap, and long wiring runs act like antennas that pick up whatever electrical noise is in the air. A digital wire only carries meaning because a receiver can tell a HIGH band from a LOW band against a shared ground, and noise is exactly what smears that reading — a spike riding on the wire can push a clean 1 down into the fog where the other end can no longer trust it.

An asynchronous serial link between two chips assumes a fairly quiet wire: one line carries the bits, both ends agree on a rate, and each side reads the voltage on that single line against ground. That works beautifully on a circuit board. Stretch it across a noisy machine and the same single-ended wire becomes a liability, because any interference it picks up is added straight into the one voltage the receiver is trying to measure.

There is also a counting problem. A two-device link has an easy answer to whose turn it is to talk, but a real machine has many nodes that all occasionally have something to say, and none of them is naturally in charge. So CAN has two jobs to solve before it can carry a single useful bit: make the wire itself resistant to noise, and give a shared line a fair, orderly rule for who gets to drive it.

Two wires that cancel the noise

noise adds the same offset to both wires; the receiver reads only the gap between them driver sets the gap receiver reads the gap CAN_H CAN_L noise: same push on both gap = CAN_H minus CAN_L shared noise cancels; the bit survives
Interference couples the same offset onto both CAN_H and CAN_L, so the receiver reading the difference between the two wires keeps the signal while the shared noise cancels.

CAN's answer to noise is to stop trusting any single wire. Instead of one line measured against ground, it uses two, called CAN_H and CAN_L, and it puts the signal in the difference between them. The receiver never asks what voltage a wire sits at; it asks how far apart the two wires are. When the pair is far apart the bus is in one state, and when they sit together at the same voltage it is in the other. This is differential signaling, and it is like two runners carrying the same rope taut between them: what matters is the distance across the rope, so a gust that shoves both of them sideways together barely changes the gap.

The reason this beats a single wire is that noise almost never hits one line and spares the other. The two wires run side by side, usually twisted together, so a spike or an interfering field couples onto both of them by nearly the same amount — a shared, common offset. Reading a single wire against ground, that offset lands straight in your measurement. Reading the difference between two wires, the shared part subtracts out: both went up together, so the gap between them barely moved, and the gap is the only thing CAN cares about.

Concretely, when the bus is idle-recessive both lines sit near the middle, around 2.5 V, so their difference is about zero. To drive the other state one line is pulled up and the other down — roughly 3.5 V and 1.5 V — opening a gap of about two volts. A burst of interference shoves both of those numbers up or down at once, but the two-volt gap between them survives, and so does the bit. That is why CAN can run reliably through a machine that would turn a plain single-ended wire to mush.

One shared pair, tapped by everyone

Physically, a CAN network is refreshingly plain: a single pair of wires running the length of the machine, with every node tapping onto the same two conductors. There is no central hub and no star of separate links — just one shared bus that the controller, the sensors, and the motor drivers all hang off of. Adding a node means wiring it onto the same pair, not running fresh cable back to some master.

Because it is one long shared line carrying fast edges, the ends of that line matter. A high-speed CAN bus is terminated with a 120-ohm resistor at each end, matching the natural impedance of the cable so that signal edges are absorbed instead of bouncing back as reflections that would garble the next bit. Two terminators, one at each far end of the trunk — not one per node — is the standard arrangement, and a bus missing them is a classic reason a network that looks wired correctly still refuses to communicate.

Classical CAN runs at up to 1 megabit per second, and there is a trade between speed and reach: the faster the bus, the shorter it has to be, because every bit of arbitration depends on a pulse reaching the whole bus within a single bit time. That is a modest rate by the standards of moving video or bulk data, and deliberately so. CAN is built to shuttle small, frequent control messages — a wheel speed, a steering command, a temperature — reliably and on time, not to move large files, and its whole design is bent toward that job.

Frames are labeled by what they carry, not who they are for

a frame is labeled by content, heard by all, kept by whoever filters for that identifier sensor node broadcasts a frame frame ID: wheel_speed shared bus: every node sees this frame brake node filter: wheel_speed ID matches: KEEP dashboard node filter: cabin_temp no match: DROP light node filter: cabin_temp no match: DROP
One node broadcasts a frame labeled by its identifier onto the shared bus; every node receives it and each keeps or drops the frame by matching the identifier against its own acceptance filter.

Most buses address a device: the controller says "peripheral number three, here is your data," and the other nodes stay quiet. CAN throws that model out. A CAN frame is not aimed at anyone. It carries an identifier — a number at the front of the frame — that describes the message's content, not its destination. An identifier means something like "engine temperature" or "left wheel speed," and the node that has that reading simply broadcasts it onto the shared bus for the whole network to hear.

Every node receives every frame, because they all share one wire, and each node decides for itself what to keep. A node is configured with acceptance filters — a list of identifiers it cares about — and it quietly ignores the rest. The brake controller keeps the wheel-speed frames and drops the cabin-temperature frames; the dashboard does the reverse. Nothing is addressed to them; they each pick their interests out of a stream everyone can see. It is like a public address system that announces each message with its subject: everyone in the building hears it, and each person acts only on the subjects that are theirs.

This inversion has real payoffs. A new node can start listening for a message without a single other node being reconfigured to talk to it, because no one was ever talking to a node in particular — they were labeling data. And because the identifier travels at the very front of every frame and describes the message's importance as well as its content, that same number is about to do a second job: decide who wins when two nodes try to talk at once.

Everyone talks at once and the bus picks a winner

each node sends its ID bit by bit; on the bus a 0 beats a 1, so the lowest ID keeps driving bit (MSB first) 1 2 3 4 5 6 Node A sends 1 0 0 1 0 1 wins Node B sends 1 0 1 stopped: listening bus reads 1 0 0 1 0 1 wired-AND: a 0 wins Node B sent 1 but the bus reads 0, so Node B loses here and stops nothing collided; Node A finishes its frame and Node B simply retries later
Two nodes send their identifiers bit by bit onto a wired-AND bus where a dominant 0 overrides a recessive 1; at the first bit where Node B sends 1 but the bus reads 0, Node B loses and stops, and the lower-identifier Node A keeps driving without any collision.

On a shared wire, the obvious fear is a collision: two nodes drive the line at the same moment and both messages turn to garbage. CAN's cleverest trick is that this collision cannot happen, because of how the bus combines drivers. The two bus states are not equals. One is dominant and one is recessive, and if any node drives the dominant state while another drives the recessive state, the bus goes dominant. The dominant bit is a logic 0 and the recessive bit is a logic 1, so the wire behaves like a shared agreement where a 0 always wins over a 1.

Now watch what happens when several nodes start transmitting at the same instant. They all send their identifiers first, one bit at a time, most significant bit leading — and here is the key move: every transmitting node also watches the bus while it drives it. As long as a node sees the same bit it sent, it keeps going. The moment a node sends a recessive 1 but reads back a dominant 0, it knows someone with a lower identifier is still talking, so it immediately stops and becomes a listener. Because a 0 beats a 1 bit by bit, the message with the lowest numeric identifier is the one still driving the bus when the identifiers finish. It is like a room where everyone calls out a number at the same instant and the lowest number is simply heard over the others, so the winner is settled without anyone stopping to argue or start over.

The beautiful part is what did not happen. The winner never noticed a fight; it transmitted its whole frame in one clean run with no interruption and no retransmission. The losers did not have their data corrupted — they simply stopped, kept their message, and will send it as soon as the bus is free again. Nothing collided, nothing was retransmitted because of a smash-up, and the highest-priority message got through first. That is why a low identifier is literally a high priority on CAN: it is the number that wins the bus, and a designer hands the lowest ones to the messages that must never wait.

The bus checks itself and re-sends what breaks

Rejecting noise at the wire is only half of robustness; the other half is catching the errors that slip through anyway. CAN builds that checking into every frame rather than leaving it to the software on each node. A frame carries a checksum — a cyclic redundancy check, or CRC, computed over its contents — and a receiver recomputes that check as the frame arrives. If the number it calculates does not match the one in the frame, the bits were disturbed in flight and the frame is known to be bad.

CAN also asks the network to vouch for each frame as it lands. Every frame has an acknowledgment slot near its end, and any node that received the frame cleanly drives that slot dominant to say "I heard that intact." A transmitter that sends a frame and sees no acknowledgment learns that nobody got a clean copy. And a node that detects any error does not stay polite about it: it transmits an error frame, a deliberate signal that stomps on the bus and tells every node to discard the message in progress.

The payoff of all this checking is automatic recovery. When a frame is flagged by a failed check, a missing acknowledgment, or an error frame, the sender does not shrug and move on — it retransmits, and it keeps arbitrating for the bus and resending until the message gets through cleanly or the node is judged faulty and takes itself off the bus. A corrupted control message on a moving machine is not something you want silently accepted or silently dropped, and CAN is built so that it is neither: errors are caught, announced, and repaired without any node's program having to orchestrate it.

The nervous system of a noisy machine

A small self-driving car is exactly the machine CAN was built for. It has a controller making decisions, sensors reporting wheel speed and orientation and distance, and motor drivers pushing real current into real motors — and those motors are throwing electrical noise across the whole chassis the entire time it runs. Wiring every one of those parts to the controller with its own private serial link would be a thicket of cable, and every one of those single-ended wires would be soaking up the interference the motors produce.

One CAN pair replaces the thicket. The controller, each sensor, and each driver tap the same two wires, and the differential signaling lets them keep talking through the noise their own motors generate. The sensors broadcast their readings labeled by content, the controller keeps the ones it needs, and when the time-critical messages and the routine ones want the bus at the same moment, arbitration makes sure the message that matters most goes first — without a collision that could drop a command mid-motion.

That is the shape of why this concept sits where it does. The foundational hardware ideas cover how one chip drives a pin or clocks bits down a wire to one other chip; CAN is the step up to a whole machine's worth of nodes sharing one robust line. When a build grows past two devices trading bytes into a fleet of parts that must coordinate reliably in a hostile electrical environment, CAN is the backbone that holds it together — the nervous system a moving, sensing, deciding machine runs on.