CAN Bus is a robust communication system designed for reliable data exchange between multiple devices in electrically noisy environments. It is widely used in automotive systems, industrial machinery, robotics and embedded control systems.
Unlike simple serial interfaces, CAN Bus includes built-in error detection, message arbitration and fault tolerance, making it one of the most reliable communication systems available for embedded applications.
What Is CAN Bus?
CAN stands for Controller Area Network. It is both a communication protocol and a physical bus system.
A CAN system typically includes:
- Multiple nodes (microcontrollers or devices)
- A shared differential bus (CAN_H and CAN_L)
- CAN controllers inside microcontrollers
- External CAN transceivers for electrical signaling
All devices share the same bus and can communicate without a central master.
Differential Signaling
CAN Bus uses differential signaling over two wires:
- CAN_H
- CAN_L
The voltage difference between these two lines represents the signal. This makes CAN highly resistant to noise and interference.
Multi-Master Communication
CAN is a multi-master system. Any node can start transmitting when the bus is idle.
If two nodes transmit at the same time, CAN uses a priority-based arbitration system to decide which message continues without causing data corruption.
Message-Based Communication
CAN does not use device addresses like I2C or Modbus. Instead, messages have identifiers.
- Each message has an ID
- Lower ID = higher priority
- All nodes receive all messages
- Each node decides whether the message is relevant
This allows flexible and efficient communication between many devices.
Standard and Extended Frames
CAN supports two main message formats:
- Standard frame: 11-bit identifier
- Extended frame: 29-bit identifier
Extended frames allow more unique message identifiers but add overhead.
CAN Speed and Distance
CAN speed depends on cable length.
Typical values:
- 1 Mbps for short distances (up to ~40 meters)
- 500 kbps for medium distances
- 125 kbps for longer distances (hundreds of meters)
Higher speed requires shorter cable length and better wiring.
Termination Resistors
CAN Bus requires termination resistors:
- 120Ω between CAN_H and CAN_L
- Placed at both ends of the bus
Without proper termination, reflections can cause communication errors.
CAN Transceivers
Microcontrollers typically do not connect directly to CAN wires.
A CAN system uses:
- CAN controller (often built into MCU)
- CAN transceiver (external chip)
Common transceivers include:
- MCP2551
- TJA1050
- SN65HVD230 (3.3V systems)
Error Detection and Reliability
CAN includes strong error handling:
- CRC checks
- Acknowledge mechanism
- Error frames
- Automatic retransmission
Faulty nodes can remove themselves from the bus if they cause too many errors.
CAN Bus vs RS485
| Feature | CAN Bus | RS485 |
|---|---|---|
| Protocol | Built-in | External (e.g. Modbus) |
| Error Handling | Advanced | Basic |
| Bus Control | Arbitration | Software-managed |
| Complexity | Higher | Lower |
Typical CAN Applications
- Automotive networks (engine, ABS, dashboard)
- Industrial machinery
- Robotics systems
- Elevators and building automation
- Medical equipment
Common CAN Problems
- Missing termination resistors
- Wrong baud rate
- Incorrect wiring of CAN_H and CAN_L
- Ground reference issues
- Bus length too long for selected speed
When to Use CAN Bus
- Multi-device communication
- Noisy environments
- High reliability required
- Automotive or industrial systems
When Not to Use CAN Bus
- Very simple systems with only two devices
- Low-cost minimal hardware projects
- Short PCB-only communication
Conclusion
CAN Bus is one of the most reliable communication systems for embedded networks. It combines differential signaling with advanced protocol features to ensure data integrity even in harsh environments.
While it is more complex than I2C, SPI or UART, it provides significant advantages in systems where reliability and robustness are critical.
