Site Information

 Loading... Please wait...

SAE J1939 Programming with Arduino - J1939 Data Traffic Monitoring

Posted by Wilfried Voss on

This post is part of a series about SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino.

SAE J1939 ECU Programming & Vehicle Bus Simulation with Arduino

In the following Arduino sketch, “data traffic monitoring” means nothing else but receiving and displaying SAE J1939 data messages (Refer also to chapter Receiving J1939 Message Frames).

Rather than creating a new project, we will only need to add a few code lines to the previous network scanner project, specifically the switch(lPGN) section (refer to the code in the default section):

After filtering the Address Claimed message, we also allow any other PGN we receive from the vehicle bus. In this case, we display not only the PGN but also the source address (transmitting node), the destination address (receiving node), and the actual data.

Note: For variations of this project, you can filter more, specific PGNs or even filter messages by, for instance, destination address (where destination address is the address of this control application).

In order to test the sketch, we will, yet again, need another J1939 node, i.e. another Arduino with CAN shield to create the data traffic. In the following example, I used the project as described in chapter SAE J1939 Simulation Example. The result is just as expected:

A Comprehensible Guide to J1939

SAE J1939 has become the accepted industry standard and the vehicle network technology of choice for off-highway machines in applications, such as construction, material handling, and forestry machines. J1939 is a higher-layer protocol based on Controller Area Network (CAN). It provides serial data communications between microprocessor systems (also called Electronic Control Units - ECU) in any kind of heavy duty vehicles. The messages exchanged between these units can be data such as vehicle road speed, torque control message from the transmission to the engine, oil temperature, and many more.

A Comprehensible Guide to J1939 is the first work on J1939 besides the SAE J1939 standards collection. It provides profound information on the J1939 message format and network management combined with a high level of readability.