Automotive CAN Bus Teaching Experiment System Based on J1939
2026-04-06 07:21:54··#1
Abstract: To meet the training requirements of the J1939 protocol, an automotive bus training experimental system based on the J1939 protocol was constructed. The system hardware consists of a computer, a Kvaser CAN bus analyzer, and automotive CAN bus modules based on the J1939 protocol, including instrument panel modules, body electrical modules, and engine ECU modules. The system interface was designed by Warwick X-Analyser, and the test results are displayed intuitively on the monitor. The system monitors automotive J939 data in real time and can record, display waveforms, and print them completely. Keywords: J1939 protocol, automotive CAN bus, experimental system. With the development of automotive electronics technology, various complex electronic devices are increasingly used in automobiles. To improve signal utilization, it is required that a large amount of data information can be shared among different ECUs, and a large number of control signals can be exchanged in real time. Traditional wiring harnesses are far from meeting this demand. The CAN bus and the vehicle network communication standard based on it provide a solution to the above problems. [1] The SAE J1939 protocol is a vehicle network serial communication and control protocol based on the CAN bus, released by the Society of Automotive Engineers (SAE). It is used for trucks and their trailers, buses, construction equipment, and agricultural equipment. It is a high-speed communication standard used to support real-time closed-loop control between electronic control units distributed in different locations of the vehicle. The data transmission rate is 250Kb/s. The communication physical layer and data link layer are based on CAN2.0, and the network layer and application layer protocols are defined. [2-3] In response to the teaching and training requirements of the J1939 protocol, an automotive teaching experimental system based on the J1939 protocol was constructed. The system monitors the data of the automotive CAN bus in real time and can record, display waveforms, and print them completely. 1 System Principle and Hardware Structure 1.1 System Principle In the system, the CAN bus module communicates with the computer through the CAN bus analyzer to carry out data acquisition and transmission for teaching and training. Students conduct experimental operations to intuitively understand data transmission and reception, master the characteristics of the CAN bus and the J1939 protocol, understand the meaning and role of the physical layer, data link layer, and application layer, and finally develop the system. The CAN bus module system can collect truck road driving status data and control power devices such as lights, door and window motors, and solenoid valves. The instrument panel module communicates with the vehicle's general control module and window control module via CAN to collect vehicle switch status data. It displays various information such as vehicle status, fault information, and alarm information through LED lights, an LCD screen, and a rotary dial, enabling human-machine interaction and real-time truck control. 1.2 System Hardware Composition The system consists of three parts: a J1939-based automotive CAN bus module system, including an instrument panel module, a general vehicle module, and a vehicle-specific module (window control module); a CAN bus analyzer, consisting of a USB-based Kvaser USB CANⅡ bus adapter and Warwick X-Analyser software; and a laptop computer. The system hardware structure diagram is shown in Figure 1: [align=center] Figure 1 System Hardware Structure Diagram[/align] 2 System Hardware In the J1939-based automotive CAN bus module system, the instrument panel has the functions of displaying and storing vehicle parameters, communicating with the engine ECU, and simultaneously realizing process control of the load. Based on the switch status on the instrument panel and the status of switches and sensors connected to the body general control module, it generates power output and communicates with the body general control module. The body general control module is responsible for feeding back the switch and sensor status of its area to the instrument panel module via the CAN bus, and receiving control commands to drive the power output interface to achieve on/off control. In the actual vehicle, the instrument panel controller is located directly in front of the driver's seat in the cab; the front control module is located under the control panel between the driver's seat and the passenger seat in the cab; the body general module is located on the frame; and the window control module is located under the control panel between the driver's seat and the passenger seat in the cab. 2.1 Instrument Panel Module The instrument panel module can digitally display parameters such as vehicle speed, fuel level, water temperature, air pressure, and engine speed. The instrument panel module offers programmable icon display functionality. For example, if the vehicle speed exceeds 3 km/h and the door is not properly closed, a message "Please close the door" will be displayed at the bottom. This message will disappear after the door is closed. It features 9 high-brightness LED indicator lights; fault diagnosis capabilities, enabling real-time monitoring of bus status and electrical load short/open circuit conditions, displaying fault information in Chinese; the ability to acquire, display, and store engine-related parameters; a real-time display of the vehicle's current status; 48 non-isolated digital inputs, 6 resistive analog inputs, 3 module address inputs, 1 ACC switch input, 1 one-wire temperature sensor input, and 4 ground-controlled system wake-up signal inputs; 6 high-side switch outputs, 1 constant power output, 2 ACC power outputs, 3 B7 signal outputs, 1 odometer sensor simulation signal output, and 3 sleep signal outputs. 2.2 Vehicle Body General Control Module The vehicle body general control module has 12 non-isolated digital inputs, 1 pulse input, 1 charging indication detection input with excitation current supply; 4 resistive analog inputs, and 4 module address line inputs. It has 11 high-side switch outputs, 2 constant power outputs, and 1 power output with reverse current protection. The module has a safe operating mode. The vehicle body general control module measures vehicle speed and travel, engine speed, fuel level, engine coolant temperature, front and rear axle air pressure, engine oil pressure alarm, left and right steering control and display, etc. 2.3 Window Control Module The window control module supports 433 MHz, 868 MHz, and 915 MHz communication frequencies; 2 high-power full-bridge motor drive channels; 4 high-power high-side switch output channels; 12 digital input interfaces; short-circuit, overvoltage, and overheat protection functions; anti-pinch function for window drive; and power interface fault diagnosis function. The input interface has 24 non-isolated digital inputs and 4 module address line inputs. The output interface includes 4 high-side switch outputs, 2 constant power outputs, and 8 full-bridge switch outputs. 2.4 Kvaser USB-CAN II is a USB-based dual-channel CAN bus analyzer. One channel is used to measure high-speed CAN signals, and the other channel can be used to measure high-speed CAN, low-speed CAN, or single-wire CAN. This system uses a dual-channel high-speed CAN analyzer (ISO 11898 compatible, transceiver is TJA1050). Key features: quick and easy installation, plug and play; supports standard frames with 11-bit identifiers and extended frames with 29-bit identifiers. Each CAN message is time-stamped with 10μs accuracy. Automatic switching power supply powers both CAN (primary) and USB (secondary), reducing laptop power consumption. Supports "listen-only" mode for analysis tools. Supports major operating systems Windows, WinCE, and Linux. Application support includes Kvaser CanKing, Warwick XA, ATI Apollo, National Instruments (NI) LabVIEW, NI DIAdem, and other application software. 3 System Software The system connects to the computer via Kvaser USB Can II and uses X-Analyser for Kvaser CAN software (XA) to monitor and analyze the system bus communication message information. The original data display interface of the automotive CAN bus module is shown in Figure 2. XA is used for testing, analyzing, simulating, and monitoring CAN bus and LIN bus networks. Its main features are: (1) It allows users to access and monitor bus data using various rules such as triggering and filtering on higher-level protocols, such as SAE J1939, NMEA, DeviceNet, and CANopen. (2) It supports automotive industry standard file formats and is compatible with related tools. (3) It simulates nodes or networks by setting X-Script options or Keil interfaces. [align=center] Figure 2 Original data display interface of CAN bus[/align] 4 System Analysis In response to the J1939 training requirements, the system can monitor the data of the J1939 automotive CAN bus in real time during teaching, especially in practical operation, and can completely record, display waveforms, and print them. 4.1 Changes in Instrument Panel Display (1) Vehicle Speed and Distance Measurement and Display: The system measures the vehicle speed in real time and displays the current speed on the speedometer. The speed display unit is Km/h. The input of the vehicle speed sensor is a pulse wave (pulse generated by a function pulse generator). When the frequency of the input pulse wave reaches 200Hz, the vehicle speed reaches the maximum value of 180Km/h. When the vehicle speed is not 0, the system measures the distance traveled by the vehicle in real time and displays it on the multi-function display area of the LCD screen on the instrument panel. The unit is Km, accurate to 0.1Km. At the same time, the system intermittently stores the total mileage of the vehicle in 1Km units and displays it on the multi-function display area of the LCD screen on the instrument panel. (2) Fuel Quantity Measurement and Display: The fuel quantity is measured by the fuel quantity sensor. The display adopts a dimensionless method. F indicates that the fuel is full and E indicates that the fuel quantity is 0. When the sensor resistance changes from 0 to 200Ω, it corresponds to F to E on the fuel quantity gauge. (3) Measurement and display of front and rear axle air pressure: The system measures the front and rear axle air pressure in real time and displays it on the instrument panel. The front and rear axle air pressures are measured by air pressure sensor 1 and air pressure sensor 2, respectively. When the resistance of the air pressure sensor changes from 0 to 200Ω, it corresponds to 0 to 12 on the air pressure gauge. (4) Left and right steering control and display: Left and right steering is controlled by two switches. When the steering switch is off, the output is 5V; when the steering switch is on, the output is a pulse with a low voltage of 5V and a high voltage of 24V, and the corresponding steering indicator light on the instrument panel flashes. 4.2 Data acquisition results The XA data acquisition of the system is shown in Table 1. Taking the steering switch as an example: when the left turn signal is off, the data is 08, and when it is on, it alternates between 08 and 8A. When the right turn signal is on, the data is 00, and when it is on, it alternates between 00 and 02, as shown in Figure 3. The function pulse generator generates pulses to simulate vehicle speed changes, as shown in Figure 4. Table 1 X-Analyser Data Acquisition Table Figure 3 J1939 Data Display Interface Figure 4 Speed Waveform Based on J1939 5 Conclusion This paper introduces an automotive teaching experiment system based on the J1939 protocol. The system can monitor the data of the automotive CAN bus in real time and can completely record, display waveforms, and print them. In the system, the CAN bus module system communicates with the computer through a CAN bus analyzer to perform data acquisition and transmission for teaching and training. Students conduct experiments to intuitively understand data transmission and reception, master the characteristics of the CAN bus and the J1939 protocol, understand the meaning and role of the physical layer, data link layer, and application layer, and finally develop the system. The innovation of this paper is that the system uses a real vehicle CAN bus module system based on J1939 as hardware. Through a CAN bus analyzer, an intuitive human-machine interface is used to describe the data format of J1939 on the module and the physical values of sensors, allowing students to quickly understand the high-level protocol and master the key points of ECU development based on J1939. The project's economic benefits are 100,000 yuan. References [1] Liu Jia, Huang Ying, Huang Qian. Development of engine virtual instrument and fault diagnosis system based on SAE J1939 protocol [J]. Automotive Technology. 2007, (6): 22-25 [2] SAE J1939 Standards Collection. Recommended Practice for a Serial Control and Communication Vehicle Network. Society of Automotive Engineers, 2003 [3] Gao Yan, Gao Song, Zhao Ming. Application status and prospect of SAE J1939 protocol in bus [J]. Industrial Control Computer, 2006, 19 (4): 68-70 [4] Wu Weibin, Hong Tiansheng, Li Zhen et al. Ignition timing lamp detection system based on virtual instrument technology [J]. Transactions of the Chinese Society for Agricultural Machinery. 2006, (6): 50-53 [5] Wu Weibin, Hong Tiansheng, Li Zhen et al. Gasoline engine ECU simulation test system based on virtual instrument technology [J]. Microcomputer Information. 2006, 3-2: 205-208 [6] Wu Weibin, Hong Tiansheng, Li Zhen, et al. Gasoline engine ignition advance angle test system based on virtual instrument technology [J]. Wuhan University of Technology (Transportation Science and Engineering Edition). 2007, 31(5): 860-863.