Site Information

 Loading... Please wait...

Blog

Arduino J1939 Shield For Data Traffic Simulation And Vehicle Application Development

Posted by Wilfried Voss on

Arduino J1939 Shield For Data Traffic Simulation And Vehicle Application DevelopmentFirst of all, my apologies for a "misleading" title that included the term "J1939 Shield." I picked the topic after noticing increased search traffic for the term. In all consequence, there is no real J1939 Shield but an Arduino CAN Bus Shield with supporting J1939 protocol stack software.

As a matter of fact, there a several ways integrate an SAE J1939 protocol stack, depending on the type of Arduino board. On one side there are the Arduino Uno and Mega 2560, and on the other the Arduino Due with its ARM Cortex-M3 processor - Things are always different with the Due. Nevertheless, the Arduino Due is my preferred choice when it comes to ease of programming combined with great performance.

J1939 Development with the Arduino Uno and Mega 2560

CAN Bus Or SAE J1939 Development Kit With Arduino Uno

We at Copperhill Technologies have created CAN Bus programming and development kit that includes the Arduino Uno CPU board with CAN Bus Shield, and it is complemented by a book "Controller Area Network Prototyping with Arduino" plus sample programs. And yes, there is also a J1939 protocol stack available, which I will reference in the following.

The book guides the reader through the process of acquiring all necessary hardware and software components, i.e. the jARDCAN system, the implementation of the CAN driver, and the implementation of programs (Arduino Sketches) to read, send, process, and display data from and to a CAN network.The collection of programming examples cumulates into a full-fledged USB-to-CAN Gateway communicating with a Windows/Linux PC.

The book, in combination with the Arduino CAN Bus kit, will enable you to achieve CAN functionality literally within only a few hours.

The topics include:

  • Introduction to Controller Area Network
  • Prototyping Hardware and its Variants
  • Arduino CAN Shields
  • CAN Driver Implementation and Library Functions
  • Simple CAN Test Programs
  • CAN Network Monitoring, Simulation, and Diagnostics Program
  • CAN Data Display via Windows/Linux GUI

All sample programs are available as a free-of-charge download at the jARDCAN product page.

But coming back to the topic of J1939, the development of a J1939 protocol is actually not a big deal for an experienced programmer, the only obstacle being that you have to spend some good money on the official document, the SAE J1939 Standards Collection. I have been through the process, and I deem my code as good as any commercially available protocol stacks. And yes, I have successfully tested my code against a number of commercially available J1939 devices.

The (pre-compiled) code is also available as a free download at the product page of our book "SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino" - You don't need to buy the book to use the code, but it explains the functionality in detail. 

For more information on the SAE J1939 protocol stack, see also our post "ARD1939 - SAE J1939 Protocol Stack for Aduino".

J1939 Development with the Arduino Due

Arduino-Based ECU Development Board With Dual CAN Bus Interface

The ARD1939 code, as described for the Arduino Uno and Mega 2560, itself is directly compatible with the Arduino Due, however, the Arduino Due CAN Bus driver software required some modifications. Basically, I needed to adjust the CAN Bus function calls to the same functionality as used for the Uno and Mega 2560. And yes, that code is also available as a free download at SAE J1939 Protocol Stack Sketch for Arduino Due.

However, let's also have a look at the hardware, because besides the Arduino Due you will also need a CAN Bus shield, and it's not the same as for the Arduino Uno or Mega 2560. The Due's ARM processor already comes with two integrated CAN controllers, which are, however, in need of CAN transceivers to be able to communicate with a CAN or J1939 vehicle network.

We have developed a few solutions and one of them might match your requirements:

As I mentioned before, I recommend getting our book "SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino", which explains the functionality in detail. 

Simulating J1939 Data Traffic

SAE J1939 ECU Simulator Board With USB Port

All solutions as explained here, may it be the Arduino Uno, Mega 2560, or Due, will provide you the means to monitor and even simulate SAE J1939 data traffic. However, in order to establish a communication in absence of a real-world diesel engine, you would need two such devices, one to simulate traffic, and the other receiving and processing the information.

For a more convenient method of programming a data traffic simulation, we have created our SAE J1939 ECU Simulator Board With USB Port. The board is supported by our jCOM1939 Monitor, an SAE J1939 Monitoring, Analyzer and ECU Simulation software under Windows.

The jCOM1939 Monitor Software is the perfect tool to monitor, analyze, and simulate SAE J1939 data traffic. The system combines our jCOM.J1939.USB that functions as an SAE J1939 to USB (or UART) gateway. A comprehensive and easy-to-use, easy-to-understand Windows software displays not only SAE J1939 data traffic; it also allows to scan the network, simulate an ECU (incl. full node address negotiation features), and respond to data request messages.

CAN Bus Bridge (CAN-to-CAN) Application With Arduino Due

Basically, there are two scenarios where a CAN Bridge application is of use:1. Connecting two separate CAN Bus networks.2. Network length extension.While the first scenario is more or less self-explanatory, let's look a little closer into the network length extension: The physical CAN network length depends primarily on the CAN baud rate, i.e. the higher [...]

Read More »


RS232 to USB Converter With Arduino Due Or Mega 2560

Just about everyone who is involved with serial communication will have his/her RS232 to USB converter. Today's PCs don't even bother to support RS232. Consequently, a USB converter is mandatory to monitor RS232 data traffic. All this appears to render the following project obsolete. However, when it comes to a protocol converter, i.e. the conversion [...]

Read More »


CAN Bus Data Traffic Simulation With Arduino Due

When working on a CAN bus or SAE J1939 project, it can be extremely helpful when the expected CAN Bus data traffic can be simulated rather than connecting your system to a running vehicle or automation control. The following project does exactly that with little effort for designing CAN data frames and their frequency. As [...]

Read More »


Interrupt-Controlled Timer Function For The Arduino Due

The Arduino Due is a microcontroller board based on the Atmel SAM3X8E ARM Cortex-M3 CPU. It is the first Arduino board based on a 32-bit ARM core microcontroller. It has 54 digital input/output pins (of which 12 can be used as PWM outputs), 12 analog inputs, 4 UARTs (hardware serial ports), a 84 MHz clock, [...]

Read More »


Monitoring SAE J1708/J1587 Data Traffic Using The Arduino Mega2560 Or Arduino Due

First of all, let me point out that this post is merely about monitoring SAE J1708/J1587 data traffic, i.e. the mere reading of data frames. SAE J1708, the hardware layer, is based on RS485, however, with a small hardware modification that allows message collision detection and prevention. In the following, I am using an RS485 [...]

Read More »


How To Use The Native USB Of The Arduino Due For High-Speed Communication

It seems to be an obvious statement, but there are many applications for the Arduino Due that require high-speed communication in a range that goes beyond regular UART baud rates, i.e. several Mbits/sec. Naturally, USB comes to mind, but surprisingly there are some obstacles when it comes to accessing the Arduino Due's USB ports. The [...]

Read More »


Arduino Or Raspberry Pi - Which System Is Better Suited For CAN Bus Projects?

To say it upfront, the choice between the Arduino platform and the Raspberry Pi is primarily a personal matter, depending on factors like knowledge of programming and programming languages, preferences for operating systems, and, after all, hardware knowledge. Both system architectures, while being very different from each other, provide vast software and hardware support for [...]

Read More »


Arduino Due: Dual CAN Port Test Sketch With LED CAN Traffic Indicators

In a previous post ( Arduino Due: Dual CAN Port Test Sketch), I demonstrated how to read and write the two CAN ports on the Arduino Due. The post explains that the two CAN ports on the Arduino Due are practically useless without their respective CAN transceivers. CAN transceivers convert a regular TTL signal from the CAN controller [...]

Read More »


Dual CAN Bus Interface For Arduino Due: Controlling the LEDs

The following explains how to control the LEDs on our jCOM.CAN.DUE and jCOM.CAN.DUE-X boards. The experienced Arduino programmer may frown since all necessary information is available (LED1 = GPIO 14; LED2 = GPIO 15). Consequently, this post is for the novice Arduino programmer or those who are primarily interested in embedded Controller Area Network programming. Just as a reminder, [...]

Read More »