SAE J1939 is a set of standards developed by the Society of Automotive Engineers (SAE) for communication and diagnostics among electronic components in heavy-duty vehicles. It operates over a Controller Area Network (CAN) bus, enabling seamless data exchange between various vehicle subsystems such as engines, transmissions, and braking systems.
This protocol is widely used in industries such as commercial trucking, agriculture, construction, and marine applications. Its robust design ensures reliable communication in harsh environments, making it a preferred choice for heavy-duty and off-road vehicles.
SAE J1939 operates on a CAN bus and defines a standardized communication protocol for vehicle networks. Below are the key technical details:
SAE J1939 uses a standard 9-pin Deutsch connector (commonly referred to as the J1939-13 connector). Below is the pinout:
Pin | Signal Name | Description |
---|---|---|
1 | Battery (-) | Ground connection |
2 | Battery (+) | Power supply (12V or 24V) |
3 | CAN High (CAN_H) | CAN bus high line |
4 | Reserved | Reserved for future use |
5 | CAN Shield | Shielding for CAN bus |
6 | CAN Low (CAN_L) | CAN bus low line |
7 | Reserved | Reserved for future use |
8 | Reserved | Reserved for future use |
9 | CAN Shield | Additional shielding for CAN bus |
Below is an example of how to interface an Arduino UNO with an SAE J1939 network using an MCP2515 CAN module:
#include <SPI.h>
#include <mcp_can.h>
// Define the SPI CS pin for the MCP2515 CAN module
#define CAN_CS_PIN 10
// Initialize the MCP_CAN object
MCP_CAN CAN(CAN_CS_PIN);
void setup() {
Serial.begin(115200);
while (!Serial);
// Initialize the CAN bus at 250 kbps (standard for SAE J1939)
if (CAN.begin(MCP_ANY, 250000, MCP_8MHZ) == CAN_OK) {
Serial.println("CAN bus initialized successfully!");
} else {
Serial.println("Error initializing CAN bus.");
while (1);
}
// Set the CAN bus to normal mode
CAN.setMode(MCP_NORMAL);
Serial.println("CAN bus set to normal mode.");
}
void loop() {
// Example: Send a J1939 message with a 29-bit identifier
unsigned long id = 0x18FF50E5; // Example J1939 PGN and source address
byte data[8] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08};
if (CAN.sendMsgBuf(id, 1, 8, data) == CAN_OK) {
Serial.println("Message sent successfully!");
} else {
Serial.println("Error sending message.");
}
delay(1000); // Wait 1 second before sending the next message
}
id
and data
values with appropriate values for your application.No Communication on the CAN Bus
Address Conflicts
High Error Rates
Power Supply Issues
Q: Can SAE J1939 be used with 500 kbps CAN networks?
A: Yes, while 250 kbps is the standard, some applications support 500 kbps. Ensure all devices on the network are configured for the same data rate.
Q: How many devices can be connected to an SAE J1939 network?
A: Up to 30 devices can typically be connected, but this depends on the specific implementation and network load.
Q: Is SAE J1939 compatible with standard CAN protocols?
A: SAE J1939 is built on the CAN protocol but uses a specific 29-bit identifier format and additional protocol layers. Compatibility depends on the implementation.