100% found this document useful (1 vote)
176 views

CAN Bus Explained - A Simple Intro (2023) - CSS Electronics

The document provides a simple introduction to CAN bus technology. It explains that CAN bus acts as the "nervous system" that enables electronic control units (ECUs) in vehicles to communicate with each other over a two-wire bus. The key benefits of CAN bus are that it provides a simple, low-cost, easily accessible, and robust communication standard. It has a history dating back to 1986 when Bosch first developed the CAN protocol, and it became a standard in 1993. CAN bus is now widely used in automotive, maritime, aviation, and industrial applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
176 views

CAN Bus Explained - A Simple Intro (2023) - CSS Electronics

The document provides a simple introduction to CAN bus technology. It explains that CAN bus acts as the "nervous system" that enables electronic control units (ECUs) in vehicles to communicate with each other over a two-wire bus. The key benefits of CAN bus are that it provides a simple, low-cost, easily accessible, and robust communication standard. It has a history dating back to 1986 when Bosch first developed the CAN protocol, and it became a standard in 1993. CAN bus is now widely used in automotive, maritime, aviation, and industrial applications.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Products Software
Case Studies Docs
Guides Contact

CAN Bus Explained - A Simple Intro


[2023]

▶a simple intro to
CAN
Need a simple, practical intro to CAN bus?

In this tutorial we explain the Controller Area Network (CAN bus) 'for dummies' incl.
message interpretation, CAN logging - and the link to OBD2, J1939 and CANopen.

Read on to learn why this has become the #1 guide on CAN bus.

You can also view our CAN protocol intro above or get the PDF.

In this article
1. What is CAN bus?
2. Top 4 benefits of the CAN protocol
3. CAN history & future
4. What is a CAN frame?
https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 1/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

5. CAN logging use cases


6. How to log CAN data
7. How to decode CAN data
8. CAN vs. J1939, OBD2 & CANopen

Author: Martin Falch (updated April 2022)

Download as PDF

CAN High

CAN Low

What is CAN bus?


Your car is like a human body:

The Controller Area Network (CAN bus) is the nervous system, enabling
communication.

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 2/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

In turn, 'nodes' or 'electronic control units' (ECUs) are like parts of the body,
interconnected via the CAN bus. Information sensed by one part can be shared with
another.

So what is an ECU?

In an automotive CAN bus system, ECUs can e.g. be the engine control unit, airbags,
audio system etc. A modern car may have up to 70 ECUs - and each of them may
have information that needs to be shared with other parts of the network.

CAN Low

CAN High

ECU 1 ECU 2 ECU 3

prepare, accept, accept,


send check, receive check, ignore

This is where the CAN standard comes in handy:

The CAN bus system enables each ECU to communicate with all other ECUs - without
complex dedicated wiring.

Specifically, an ECU can prepare and broadcast information (e.g. sensor data) via the
CAN bus (consisting of two wires, CAN low and CAN high). The broadcasted data is
accepted by all other ECUs on the CAN network - and each ECU can then check the
data and decide whether to receive or ignore it.

CAN bus physical & data link layer (OSI)


In more technical terms, the controller area network is described by a data link layer
and physical layer. In the case of high speed CAN, ISO 11898-1 describes the data link
layer, while ISO 11898-2 describes the physical layer. The role of CAN is often
presented in the 7 layer OSI model as per the illustration.

The CAN bus physical layer defines things like cable types, electrical signal levels, node
requirements, cable impedance etc. For example, ISO 11898-2 dictates a number of
things, including below:
https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 3/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Baud rate: CAN nodes must be connected via a two wire bus with baud rates up to 1
Mbit/s (Classical CAN) or 5 Mbit/s (CAN FD)
Cable length: Maximal CAN cable lengths should be between 500 meters (125 kbit/s)
and 40 meters (1 Mbit/s)
Termination: The CAN bus must be properly terminated using a 120 Ohms CAN bus
termination resistor at each end of the bus

7 layer OSI model

Application

CAN sub layers


Presentation

Logic link control


Session

Media access control ISO 11898-1


Transport
Acceptance filtering, overload notification,
recovery management, data
Physical coding encapsulation/decapsulation, frame
Network coding (stuffing/destuffing), error
handling, acknowledgement, ...

Data link Physical media attachment


ISO 11898-2
Physical Physical media dependent Bit encoding/decoding, bit timing,
synchronization, ...

High speed CAN, low speed CAN, LIN bus, ... +

Top 4 benefits of CAN bus


The CAN bus standard is used in practically all vehicles and many machines due to
below key benefits:

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 4/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Simple & low cost


ECUs communicate via a single CAN system instead of via direct complex analogue
signal lines - reducing errors, weight, wiring and costs

Easy access
The CAN bus provides 'one point-of-entry' to communicate with all network ECUs -
enabling central diagnostics, data logging and configuration

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 5/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Extremely robust
The system is robust towards electric disturbances and electromagnetic interference
- ideal for safety critical applications (e.g. vehicles)

Efficient
CAN frames are prioritized by ID so that top priority data gets immediate bus access,
without causing interruption of other frames or CAN errors

The CAN bus history in short


Pre CAN: Car ECUs relied on complex point-to-point wiring
1986: Bosch developed the CAN protocol as a solution

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 6/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

1991: Bosch published CAN 2.0 (CAN 2.0A: 11 bit, 2.0B: 29 bit)
1993: CAN is adopted as international standard (ISO 11898)
2003: ISO 11898 becomes a standard series
2012: Bosch released the CAN FD 1.0 (flexible data rate)
2015: The CAN FD protocol is standardized (ISO 11898-1)
2016: The physical CAN layer for data-rates up to 5 Mbit/s standardized in ISO
11898-2

Today, CAN is standard in automotives (cars, trucks, buses, tractors, ...), ships,
planes, EV batteries, machinery and more.

Bosch launches CAN is standardized CAN FD is standardized Start of CAN XL


the CAN protocol (ISO 11898) (ISO 11898-1) development

CAN ISO
11898 CAN FD ISO
11898-1 CAN XL
1986 1993 2015 2018

1991 2003 2016


CAN 2.0A
(11-bit)
ISO ISO
CAN 2.0B ISO
11898-1 11898-2
11898-2
(29-bit)

Bosch publishes CAN 2.0 Separation of data link Physical CAN layer for
(CAN 2.0A, CAN2.0B) and physical layer data-rates up to 5 Mbit/s

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 7/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

The future of CAN bus


Looking ahead, the CAN bus protocol will stay relevant - though it will be impacted
by major trends:

A need for increasingly advanced vehicle functionality


The rise of cloud computing
Growth in Internet of Things (IoT) and connected vehicles
The impact of autonomous vehicles
The use of AI in data analysis (see e.g. our ChatGPT + CAN bus intro)

In particular, the rise in connected vehicles (V2X) and cloud will lead to a rapid
growth in vehicle telematics and IoT CAN loggers.

In turn, bringing the CAN bus network 'online' also exposes vehicles to security risks
- and may require a shift to new CAN protocols like CAN FD.

The rise of CAN FD +

What is a CAN frame?


Communication over the CAN bus is done via CAN frames.

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 8/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Below is a standard CAN frame with 11 bits identifier (CAN 2.0A), which is the type
used in most cars. The extended 29-bit identifier frame (CAN 2.0B) is identical except
the longer ID. It is e.g. used in the J1939 protocol for heavy-duty vehicles.

Note that the CAN ID and Data are highlighted - these are important when recording
CAN bus data, as we'll see below.

Standard CAN frame

1 11 1 6 0-64 16 2 7
#bits

SOF ID RTR Control Data CRC ACK EOF


Start of Standard Remote Trans- Cyclic Redundancy Acknow- End of
Frame Identifier mission Request Check ledgement Frame

The 8 CAN bus protocol message fields +

CAN bus errors +

Logging CAN data - example use cases


There are several common use cases for recording CAN bus data frames:

Logging/streaming data from cars

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 9/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

OBD2 data from cars can e.g. be used to reduce fuel costs, improve driving, test
prototype parts and insurance

obd2 logging →

Heavy duty fleet telematics


J1939 data from trucks, buses, tractors etc. can be used in fleet management to
reduce costs or improve safety

j1939 telematics →

Predictive maintenance
Vehicles and machinery can be monitored via IoT CAN loggers in the cloud to predict
and avoid breakdowns

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 10/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

predictive maintenance →

Vehicle/machine blackbox
A CAN logger can serve as a 'blackbox' for vehicles or equipment, providing data for
e.g. disputes or diagnostics

can bus blackbox →

Do you have a CAN logging use case? Reach out for free sparring!

contact us →

How to log CAN bus data


As mentioned, two CAN fields are important for CAN logging:
The CAN ID and the Data.

To record CAN data you need a CAN logger. This lets you log timestamped CAN data
to an SD card. In some cases, you need a CAN interface to stream data to a PC - e.g.
for car hacking.

Connecting to the CAN bus +

Example: Raw CAN sample data (J1939) +

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 11/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Example: CANedge CAN logger


The CANedge1 lets you easily record data from any CAN bus to an 8-32 GB SD card.
Simply connect it to e.g. a car or truck to start logging - and decode the data via free
software/APIs.

Further, the CANedge2 (WiFi) and CANedge3 (3G/4G) let you push data to your own
server - and update devices over-the-air.

learn about the canedge

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 12/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

How to decode raw CAN data to 'physical


values'
If you review the raw CAN bus data sample above, you will probably notice
something:

Raw CAN bus data is not human-readable.

To interpret it, you need to decode the CAN frames into scaled engineering values
aka physical values (km/h, degC, ...).

Below we show step-by-step how this works:

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 13/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

Extracting CAN signals from raw CAN frames +

The challenge of proprietary CAN data +

CAN database files (DBC) - J1939 example +

Example: Decoded CAN sample data (physical values) +

What is the link between CAN, J1939, OBD2,


CANopen, ...?
The Controller Area Network provides the basis for communication - but not a lot
more.

For example, the CAN standard does not specify how to handle messages larger than 8
bytes - or how to decode the raw data. Therefore a set of standardized protocols exist
to further specify how data is communicated between CAN nodes of a given network.

Some of the most common standards include SAE J1939, OBD2 and CANopen. Further,
these higher-layer protocols will increasingly be based on the 'next generation' of CAN,
CAN FD (e.g. CANopen FD and J1939-17/22).
https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 14/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

a simple intro to

J1939
SAE J1939
J1939 is the standard in-vehicle network for heavy-duty vehicles (e.g. trucks & buses).
J1939 parameters (e.g. RPM, speed, ...) are identified by a suspect parameter number
(SPN), which are grouped in parameter groups identified by a PG number (PGN).

j1939 intro →

j1939 telematics →

a simple intro to

OBD2
OBD2
On-board diagnostics (OBD, ISO 15765) is a self-diagnostic and reporting capability
that e.g. mechanics use to identify car issues. OBD2 specifies diagnostic trouble
codes (DTCs) and real-time data (e.g. speed, RPM), which can be recorded via OBD2
loggers.
https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 15/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

obd2 intro →

obd2 logging →

a simple intro to

CANopen
CANopen
CANopen is used widely in embedded control applications, incl. e.g. industrial
automation. It is based on CAN, meaning that a CAN bus data logger is also able to
log CANopen data. This is key in e.g. machine diagnostics or optimizing production.

canopen intro →

canopen logger →

a simple intro to

CAN FD
CAN FD

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 16/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

CAN bus with flexible data-rate (CAN FD) is an extension of the Classical CAN data
link layer. It increases the payload from 8 to 64 bytes and allows for a higher data bit
rate, dependent on the CAN transceiver. This enables increasingly data-intensive use
cases like EVs.

can fd intro →

can fd logger →

Other CAN based protocols +

For more intros, see our guides section - or download the 'Ultimate Guide' PDF.

Need to log/stream CAN bus data?


Get your CAN logger today!

buy now contact us →

Recommended for you

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 17/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

J1939
logger
CANedge

J1939 DATA LOGGER - SIMPLE TELEMATICS

OBD2
logger
CANedge/CLX000

OBD2 DATA LOGGER - LOG VEHICLE DATA EASILY

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 18/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

CANopen
logger
CANedge

CANOPEN DATA ANALYZER - EASILY ANALYZE MACHINES

Contact

CSS Electronics | VAT ID: DK36711949


Soeren Frichs Vej 38K (Office 35)
8230 Aabyhoej, Denmark

[email protected]
+45 91 25 25 63

Terms of Service
Returns and Refunds

Privacy Policy
About Us

CO2 Neutral Since 2015

Newsletter

Email address subscribe

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 19/20
8/27/23, 10:26 PM CAN Bus Explained - A Simple Intro [2023] – CSS Electronics

© 2023, CSS Electronics

https://www.csselectronics.com/pages/can-bus-simple-intro-tutorial 20/20

You might also like