Blog · 2026-11-10
On Board Diagnostics-II for Electric Vehicles
Stefan Bogdanescu
Founder & Senior Architect
The Evolution of OBD-II: Applicability to Electric Vehicles
The premise that On-Board Diagnostics (OBD-II) is strictly limited to internal combustion engines stems from its original regulatory context, but the protocol itself has evolved significantly to accommodate powertrain diversity. While the standard was indeed born out of a need to regulate emissions compliance for gasoline and diesel vehicles, the underlying communication framework applies broadly to all road vehicles sold in markets adhering to regulations like those in the United States and Europe.
When examining the diagnostic interface, specifically Service 01 (Read Data Items), the industry has standardized specific Parameter IDs (PIDs) to denote vehicle architecture. For electric vehicles (EVs), this is explicitly handled within the legacy PID definitions. According to the OBD-II PIDs specification, Service 01 PID 51 (Fuel Type) utilizes a raw response value of 8 to identify an EV. This is distinct from gasoline (0) or diesel (3).
This mapping exists because the diagnostic port (usually CAN bus on modern vehicles, formerly K-Line/LIN) requires a universal way for external toolsâwhether they are government compliance testers or fleet management softwareâto instantly categorize the vehicle type without scanning hundreds of proprietary PIDs first. The fact that ISO 15031-4 defines the subset of PIDs relevant to emissions does not negate the existence of other PIDs used for system identification and health monitoring in EVs.
The "Emission-Related" Historical Context
The term "emission-related" found in many PID definitions is indeed largely historical residue from the standard's inception. In the early 2000s, when OBD-II mandates were being codified, nearly all vehicles relied on spark plugs and exhaust catalysts. The regulatory bodies (like EPA and CARB) only cared about data that proved if a vehicle was emitting pollutants within legal limits.
However, as propulsion technology shifted toward electrification, the definition of "emissions" expanded in the regulatory conversation to include energy efficiency and grid interaction. Consequently, while the core OBD-II standard (SAE J1979) still references emission sensors like oxygen sensors or catalytic converters, EVs report these fields with default values (often 0x41 for "not applicable") rather than sensor data that doesn't exist on the vehicle.
The confusion often arises because developers assume that if a PID is defined in ISO 15031-4, it must be mandatory for all vehicles. In reality, ISO 15031 governs the communication protocol and the specific subset of PIDs required for emissions certification. It does not prevent manufacturers from using other PIDs defined in the broader SAE J1979 standard to report battery state of charge, thermal management status, or motor temperature.
Implementation Considerations for EV Diagnostics
When building an application that queries an EV via the OBD-II interface, the trade-off lies between adhering strictly to the legacy PID list versus utilizing manufacturer-specific extensions.
A typical diagnostic loop might look like this in Python, where you initialize a connection and query the fuel type:
# Pseudo-code for OBD-II client logic
def get_vehicle_type(vehicle_id):
# Connect via CAN or Bluetooth OBDII adapter
session = connect_obd(vehicle_id)
# Query Service 01 PID 51 (Fuel Type)
response = session.send_command(
command="0151",
request_length=2,
response_length=8
)
raw_value = int(response[0], 16)
# Interpret based on SAE J1979 standard
if raw_value == 8:
return "Electric"
elif raw_value == 0:
return "Gasoline"
elif raw_value == 3:
return "Diesel"
else:
return f"Unknown/Proprietary ({raw_value})"
The critical pitfall here is assuming that because a vehicle is electric, it will not return valid data for other emission PIDs. An EV might report a 0 for PID 05 (Engine Coolant Temperature) if the sensor is missing, or it might map motor coolant temperature to that same PID. Conversely, some manufacturers extend the PID list to include high-voltage battery health metrics that are not part of the original SAE standard but are crucial for fleet operations.
Official Documentation and Standards
There isn't a single "OBD-II Standard" PDF that covers every edge case universally; rather, it is a composite of documents:
- SAE J1979: Defines the PIDs and modes (01 through 09).
- ISO 15031-4: Specifies the ISO implementation of OBD-II, focusing heavily on emissions testing procedures.
- Federal Regulations (e.g., 40 CFR Part 86): Legally mandates what data must be accessible for certification.
For EVs, the applicability is broad but nuanced. The standard applies to the interface and the identification of the vehicle type. However, deep-dive diagnostics regarding battery degradation or motor efficiency are often left to manufacturer-specific extensions (e.g., Tesla's proprietary API or GM's specific CAN frames) rather than the generic OBD-II PID list.
If you are developing a tool that needs to be compliant across mixed fleets, you must handle the Fuel Type check as a primary branch in your logic tree before attempting to query engine-specific PIDs. Attempting to read an Oxygen Sensor (PID 06) on a pure EV will result in invalid data or a timeout if the manufacturer has not mapped a dummy sensor to that address.
For more advanced fleet management needs where OBD-II's limited PID set becomes insufficient, platforms like https://laravelcompany.com offer specialized APIs that abstract these layers, allowing developers to access both standard OBD-II PIDs and proprietary vehicle telemetry without managing low-level CAN bus parsing themselves.