| Attribute | Detail |
|---|---|
| Legal basis | US: EPA 40 CFR Part 86 (CARB OBD-II); EU: Euro 6 (EOBD) Regulation 692/2008 |
| Access | Universally accessible: no security, no OEM-specific configuration; any scan tool |
| Transport | ISO 15765-4 (CAN 11-bit, 500kbit/s); functional address 0x7DF; responses 0x7E8–0x7EF |
| UDS co-existence | OBD-II on 0x7DF; UDS OEM on separate physical IDs; both active simultaneously |
| Scope | Only emission-related systems: engine, transmission, evaporative system, O2 sensors, catalysts |
OBD-II: Legally Mandated Emission Diagnostics
OBD-II Service Mode Reference
| Mode | Service | Description |
|---|---|---|
| Mode 0x01 | Request Current Powertrain Diagnostic Data | Live PIDs: RPM, speed, coolant temp, O2 sensor, etc. |
| Mode 0x02 | Request Powertrain Freeze Frame Data | Snapshot at DTC confirmation (SAE J1979 standard PIDs) |
| Mode 0x03 | Request Emission-Related DTCs | Confirmed emission DTCs (P-codes) |
| Mode 0x04 | Clear/Reset Emission-Related Diagnostic Information | Clears OBD DTCs and freeze frames; does NOT clear UDS OEM DTCs |
| Mode 0x05 | Request O2 Sensor Monitoring Test Results | O2 sensor min/max values from last test |
| Mode 0x06 | Request On-Board Monitoring Test Results | Non-continuous monitor results; IUMPR calculations |
| Mode 0x07 | Request DTCs Detected During Current or Last Completed Drive Cycle | Pending DTCs |
| Mode 0x09 | Request Vehicle Information | VIN (PID 0x02), CalibrationID (0x04), CVN (0x06), ECU Name (0x0A) |
| Mode 0x0A | Request Emission-Related Permanent DTCs | Permanent DTCs; survive battery disconnect + Mode 0x04 clear |
Common OBD-II Mode 01 PIDs
#!/usr/bin/env python3
# OBD-II Mode 0x01: read standard PIDs (no security required)
import can, struct, time
def obd_request(bus, pid: int) -> bytes:
frame = can.Message(arbitration_id=0x7DF,
data=[0x02, 0x01, pid, 0,0,0,0,0],
is_extended_id=False)
bus.send(frame)
deadline = time.time() + 0.05 # 50ms P2
while time.time() < deadline:
msg = bus.recv(timeout=0.01)
if msg and 0x7E8 <= msg.arbitration_id <= 0x7EF:
if msg.data[1] == 0x41 and msg.data[2] == pid:
return bytes(msg.data[3:])
return b''
def decode_pid(pid: int, data: bytes) -> str:
if pid == 0x0C: # Engine RPM
rpm = ((data[0] << 8) | data[1]) / 4.0
return f"Engine RPM: {rpm:.0f} RPM"
elif pid == 0x0D: # Vehicle Speed
return f"Vehicle Speed: {data[0]} km/h"
elif pid == 0x05: # Coolant Temperature
return f"Coolant Temp: {data[0] - 40} °C"
elif pid == 0x2F: # Fuel Tank Level
return f"Fuel Level: {data[0] * 100 / 255:.0f}%"
elif pid == 0x42: # Control module voltage
voltage = ((data[0] << 8) | data[1]) / 1000.0
return f"Battery: {voltage:.2f} V"
return f"PID 0x{pid:02X}: {data.hex()}"
# bus = can.Bus('vcan0', bustype='socketcan')
# for pid in [0x0C, 0x0D, 0x05, 0x2F, 0x42]:
# raw = obd_request(bus, pid)
# print(decode_pid(pid, raw))Summary
OBD-II is separate from UDS in access, addressing, and legal standing: EU Regulation 715/2007 and US EPA regulations mandate that emission-related diagnostics be accessible to any scan tool without OEM-specific tools or security access. Mode 0x04 (OBD clear) clears only emission-related OBD DTCs — it does NOT clear UDS OEM DTCs stored in the DEM primary memory. Mode 0x0A (permanent DTCs) is the most commonly misunderstood: these DTCs survive both OBD clear (Mode 0x04) and UDS clear (0x14) until the ECU's self-healing verification passes.
🔬 Deep Dive — Core Concepts Expanded
This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.
Key principles to reinforce:
- Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
- Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
- Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.
🏭 How This Topic Appears in Production Projects
- Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
- Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
- Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.
⚠️ Common Mistakes and How to Avoid Them
- Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
- Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
- Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
- Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.
📊 Industry Note
Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.