Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamHow does CAN bus system work in cars?
A CAN bus — Controller Area Network — is the communication network that lets the electronic modules in a car talk to each other over a shared pair of wires instead of using separate wires for every signal.
In a car, ECUs such as the engine controller, transmission controller, ABS module, airbag module, body control module, instrument cluster, and steering system exchange short digital messages over the CAN bus.
Key ideas:
In simple terms: CAN bus is the car’s internal digital communication backbone.
Modern vehicles contain many electronic control units, commonly called ECUs. Examples include:
| ECU | Typical function |
|---|---|
| Engine Control Module | Fuel injection, ignition, torque control |
| Transmission Control Module | Gear shifting |
| ABS / ESC module | Wheel speed monitoring, braking control |
| Airbag ECU | Crash detection and restraint deployment |
| Body Control Module | Lights, locks, windows, wipers |
| Instrument cluster | Gauges and warning lamps |
| Power steering ECU | Steering assist |
| Climate control ECU | HVAC control |
| Infotainment unit | Media, navigation, display |
Before networked vehicle electronics, signals were often sent with dedicated wires. For example, if the engine ECU needed to send engine speed to the dashboard, transmission ECU, and traction control system, it might require multiple separate signal paths.
CAN solves this by allowing one ECU to broadcast a message once, and multiple other ECUs can use it.
Example:
This reduces:
This is especially important because wiring harnesses are among the heaviest and most complex parts of a modern vehicle.
A typical high-speed automotive CAN bus uses a twisted pair of wires:
The two wires carry opposite voltage changes. The receiver does not mainly care about the voltage of each wire relative to chassis ground. Instead, it measures the difference between CANH and CANL.
This is called differential signaling.
Typical classical high-speed CAN voltage levels are approximately:
| Bus state | Logic value | CANH | CANL | Differential voltage |
|---|---|---|---|---|
| Recessive | 1 | ~2.5 V | ~2.5 V | ~0 V |
| Dominant | 0 | ~3.5 V | ~1.5 V | ~2 V |
The exact values can vary slightly depending on the transceiver and vehicle, but the concept is the same.
The important rule is:
A dominant bit overrides a recessive bit on the bus. This is fundamental to CAN arbitration.
Cars are electrically noisy environments. They contain:
If noise couples into both CAN wires equally, the receiver largely rejects it because it measures:
\[ V{diff} = V{CANH} - V_{CANL} \]
For example, suppose electrical noise adds +0.5 V to both wires.
Recessive state:
\[ CANH = 3.0V,\quad CANL = 3.0V \]
The differential voltage is still:
\[ 3.0V - 3.0V = 0V \]
So the receiver still sees a recessive bit.
That is why CAN is much more robust than a simple single-ended signal wire.
A proper high-speed CAN bus has termination resistors at the two physical ends of the main bus.
Usually:
Since they are in parallel, the resistance measured between CANH and CANL on an unpowered healthy bus is usually about:
\[ R_{total} = 120\Omega \parallel 120\Omega = 60\Omega \]
This is a common diagnostic check.
The terminations serve two main purposes:
Prevent signal reflections
CAN edges are fast enough that long wiring behaves like a transmission line. Without correct termination, reflections can distort bits.
Maintain signal integrity
Proper termination helps the differential signal remain clean at high bit rates.
Typical diagnostic interpretation:
| Measured resistance between CANH and CANL | Possible meaning |
|---|---|
| ~60 Ω | Both terminators likely present |
| ~120 Ω | One terminator missing or disconnected |
| Very low resistance | Short between CANH and CANL |
| Infinite/open | Bus wiring or both terminators open |
This measurement should usually be done with the vehicle powered down and modules asleep, following the manufacturer’s service procedure.
CAN does not work like a typical computer network where every message has a source and destination IP address.
Instead, CAN is message-based.
A CAN frame contains an identifier, often called the CAN ID. The ID describes the meaning and priority of the message.
For example:
| CAN ID | Possible meaning |
|---|---|
| 0x100 | Engine speed and torque |
| 0x180 | Wheel speeds |
| 0x220 | Coolant temperature |
| 0x300 | Door and lock status |
| 0x3F0 | Dashboard warning lamp status |
These IDs are examples only. Actual IDs are manufacturer-specific unless they are part of a standardized diagnostic protocol.
Every ECU connected to the bus receives the message electrically, but each ECU filters messages based on ID.
For example:
This makes CAN efficient because one transmitted message can be used by many receivers.
A classical CAN data frame contains several fields.
Simplified structure:
| Field | Purpose |
|---|---|
| Start of Frame | Marks the beginning of a CAN message |
| Arbitration Field | Contains the message ID and priority information |
| Control Field | Contains information such as payload length |
| Data Field | Contains the actual data, 0 to 8 bytes in classical CAN |
| CRC Field | Error-checking code |
| ACK Field | Receivers acknowledge valid reception |
| End of Frame | Marks the end of the message |
Classical CAN supports two main identifier formats:
| Format | Identifier length |
|---|---|
| Standard CAN, CAN 2.0A | 11-bit ID |
| Extended CAN, CAN 2.0B | 29-bit ID |
Classical CAN payload length is up to 8 bytes.
Example CAN frame conceptually:
ID: 0x100
DLC: 8
Data: 09 C4 1A 00 5F 20 00 00
The raw bytes need interpretation according to the vehicle manufacturer’s database, often called a DBC file in engineering contexts.
For example, two bytes might represent engine speed:
\[ RPM = \frac{RawValue}{4} \]
If the raw value is 10000:
\[ RPM = \frac{10000}{4} = 2500 \]
The CAN bus itself does not know that the value means “2500 rpm.” It only transports bytes. The meaning is defined by the vehicle’s communication specification.
One of the cleverest parts of CAN is its arbitration system.
Because all ECUs share the same wires, two modules may try to transmit at the same time. CAN handles this automatically using non-destructive bitwise arbitration.
The rule is:
Priority is based on the CAN ID:
Example:
Suppose two ECUs start transmitting at the same time.
ECU A ID: 0b0010 0000 000
ECU B ID: 0b0100 0000 000
They transmit bit by bit. At the first bit where one sends 0 and the other sends 1:
The message is not destroyed. This is why CAN arbitration is called non-destructive.
This mechanism allows safety-critical or time-critical messages to be assigned high priority.
For example:
| Message type | Typical priority |
|---|---|
| Brake/ABS/stability control data | High |
| Engine torque control | High |
| Steering data | High |
| Body comfort features | Medium/low |
| Window switch status | Low |
| Seat adjustment | Low |
CAN was designed for harsh real-time environments, so it has multiple error-detection mechanisms.
Common error checks include:
| Error type | Meaning |
|---|---|
| CRC error | Received data does not match the checksum |
| Bit error | Transmitter reads a different bit than it sent |
| Stuff error | Bit-stuffing rule violated |
| Form error | Fixed-format part of the frame is invalid |
| ACK error | No receiver acknowledged the message |
CAN also uses bit stuffing. After five consecutive bits of the same value, the transmitter inserts a bit of the opposite value. This guarantees enough signal transitions for synchronization.
If a node detects an error, it transmits an error frame, which causes all nodes to discard the corrupted message. The transmitter then retries later.
CAN also has fault confinement. Each node maintains internal error counters:
Depending on these counters, a node may enter different states:
| State | Meaning |
|---|---|
| Error active | Normal operation |
| Error passive | Node has seen many errors and reduces its ability to disturb the bus |
| Bus-off | Node disconnects itself logically from the bus to protect the network |
This prevents one faulty ECU from continuously destroying communication for all other modules.
Different CAN networks in a vehicle may operate at different speeds.
Typical values:
| Network type | Typical speed | Typical use |
|---|---|---|
| High-speed CAN | 500 kbit/s to 1 Mbit/s | Powertrain, chassis, ABS, stability control |
| Medium-speed CAN | 125 kbit/s to 250 kbit/s | Body electronics |
| Low-speed/fault-tolerant CAN | ~40 kbit/s to 125 kbit/s | Comfort systems, older body networks |
A vehicle may contain several CAN buses, for example:
These buses are often connected through a gateway module.
The gateway decides which messages should be passed between networks. For example, engine speed from the powertrain CAN may be forwarded to the instrument cluster on another bus.
CAN remains widely used in vehicles because it is robust, inexpensive, deterministic enough for many control functions, and well understood by manufacturers and suppliers.
However, modern vehicles now require much more bandwidth because of:
Because of this, CAN is increasingly used together with newer networks.
CAN FD, or CAN Flexible Data-rate, is an extension of classical CAN.
Compared with classical CAN:
| Feature | Classical CAN | CAN FD |
|---|---|---|
| Payload | Up to 8 bytes | Up to 64 bytes |
| Arbitration phase | Same CAN-style arbitration | Same CAN-style arbitration |
| Data phase speed | Usually same as arbitration | Can be faster |
| Use case | Traditional vehicle control | Higher data volume control and diagnostics |
CAN FD is useful when systems need more data per message but still want CAN-like robustness and arbitration.
Automotive Ethernet is increasingly used for high-bandwidth systems such as:
CAN is not disappearing; rather, it is becoming one layer in a mixed in-vehicle network. Safety and body-control messages may still use CAN or CAN FD, while high-bandwidth sensor data may use Ethernet.
CAN is also commonly used alongside LIN, or Local Interconnect Network.
LIN is:
Typical LIN applications:
In many vehicles, a door module may communicate with the main vehicle network over CAN, while controlling smaller local devices over LIN.
During wheel slip:
All of this happens through CAN frames.
A diagnostic scan tool connects through the OBD-II port. In many vehicles, high-speed CAN is available at:
| OBD-II pin | Function |
|---|---|
| Pin 6 | CAN High |
| Pin 14 | CAN Low |
The scan tool sends diagnostic requests. ECUs respond with diagnostic trouble codes, live data, identification information, or test results.
For example:
A technician or engineer usually checks the CAN system in stages.
Look for:
With power off and the system safely isolated:
Abnormal readings can indicate:
With power on, typical idle voltages may be around:
During communication:
If one line is stuck at battery voltage, ground, or an abnormal fixed voltage, there may be a short or failed transceiver.
An oscilloscope is the best tool for seeing CAN signal quality.
A healthy CAN waveform should show:
A diagnostic scan tool can show:
Common diagnostic trouble codes include U-codes, such as network communication errors.
CAN is a network protocol used inside the car.
OBD-II is a diagnostic standard/interface. Many modern OBD-II systems use CAN as the physical and data-link layer for diagnostics, but CAN and OBD-II are not identical.
Many normal vehicle CAN messages are proprietary. Without the manufacturer’s database, the raw data may be difficult to interpret.
For example, a frame such as:
ID: 0x218
Data: 34 A1 00 7F 12 00 00 00
does not mean much unless you know:
This decoding information is usually contained in engineering databases such as DBC files.
Traditional CAN was designed for reliability, not cybersecurity. Most classical CAN frames do not include encryption, authentication, or source verification.
That means if an attacker gains access to the bus through a compromised module, diagnostic connector, telematics unit, or poorly designed aftermarket device, they may be able to inject malicious messages.
Modern vehicles mitigate this with:
A CAN bus in a car is a robust two-wire communication system that allows many ECUs to exchange short digital messages over a shared network.
The essential principles are:
In practical terms, CAN bus is the reason a car’s engine controller, brakes, dashboard, body electronics, and diagnostic systems can coordinate quickly and reliably using only a small number of wires.