🚌

Understanding the CAN Bus System

Apr 28, 2025

CAN Bus Explained - A Simple Intro

This guide provides an introduction to the Controller Area Network (CAN bus), covering its components, benefits, history, and how to log and decode data.

Table of Contents

  1. What is CAN bus?
  2. Top 4 Benefits of CAN Protocol
  3. CAN History & Future
  4. CAN OSI Model
  5. What is a CAN Frame?
  6. CAN Higher-Layer Protocols
  7. How to Log CAN Data
  8. How to Decode CAN Data

What is CAN bus?

  • Purpose: Allows ECUs (Electronic Control Units) within vehicles to communicate without a host computer.
  • Analogy: Functions like a nervous system with ECUs as body parts.
  • Physical Connection: Uses a two-wire system (CAN high and CAN low).

What is an ECU?

  • Controls vehicle functions like engine, transmission, brakes, etc.
  • Consists of a microcontroller, CAN controller, and CAN transceiver.

CAN bus Variants

  • Low-speed CAN: Fault-tolerant, being replaced by LIN bus.
  • High-speed CAN: Most common, focus of this guide.
  • CAN FD: Longer payloads, faster speed.
  • CAN XL: Bridges gap to Automotive Ethernet.

Top 4 Benefits

  1. Simple & Low Cost: Reduces wiring complexity, weight, and cost.
  2. Easy Access: Centralized diagnostics and data logging.
  3. Extremely Robust: Resistant to EMI and supports error detection.
  4. Efficient: Prioritizes frames by ID for bus access.

CAN History & Future

  • Developed by Bosch in 1986, standardized in 1993.
  • Future trends include higher data rates, connected vehicles, and open vs. proprietary data handling.

CAN OSI Model

  • CAN bus is described by data link layer (ISO 11898-1) and physical layer (ISO 11898-2).
  • Represents the two lowest layers in the OSI model.

What is a CAN Frame?

  • Communication occurs via CAN frames.
  • Components: SOF, ID, RTR, Control, Data, CRC, ACK, EOF.
  • Four frame types: Data frame, Error frame, Remote frame, Overload frame.

CAN Higher-Layer Protocols

  • Provide additional structure for communication beyond basic CAN.
  • Examples: OBD2, UDS, CCP/XCP, CANopen, SAE J1939, NMEA 2000, ISOBUS.

How to Log CAN Data

  1. Select Hardware: Choose between CAN-to-USB, CAN-to-SD, or CAN-to-cloud.
  2. Identify Adapter Cable: Options include OBD2, J1939, M12, contactless.
  3. Configure Device: Match baud-rate, configure request messages.
  4. Review Raw Data: Analyze data with tools like asammdf.

How to Decode CAN Data

  1. Understand Signal Extraction: Requires byte order, bit start/length, offset, scale.
  2. Get a DBC File: Necessary for decoding; can be obtained from OEMs or reverse engineering.
  3. Use Software/API: Tools like asammdf GUI, MATLAB, Python for analysis.

Use Cases

  • Logging/streaming from cars, heavy-duty fleet telematics, predictive maintenance, and blackbox logging.

For more detailed exploration, consider downloading the 'Ultimate CAN Guide' PDF.