On-board diagnostics (OBD-II) and fault codes

What OBD-II monitors (misfire, fuel system, catalyst, O2 sensors, EVAP and components), how DTCs, pending and confirmed codes, freeze frames and the MIL work, the 16-pin connector and services, with PID decoding, misfire-rate and fuel-trim numericals.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

On-board diagnostics turns the engine ECU into its own inspector: it continuously checks that every emission-related component works and tells the driver, through the malfunction indicator lamp (MIL), when something does not. Every workshop now starts a diagnosis by plugging a scan tool into the OBD connector, and emission rules (OBD requirements come with BS-VI in India) make OBD compliance part of type approval. Knowing what a code does and does not tell you saves hours of parts-swapping.

Key ideas

Purpose and history.

  • OBD-I: early, manufacturer-specific self-diagnosis — a few circuit checks, codes read by flashing a lamp or with a maker's own tool.
  • OBD-II: standardised in the USA from the 1996 model year — a common connector, common code format, common data parameters and a set of emission monitors that check component performance, not only open or short circuits. Europe adopted the equivalent EOBD; India's BS-VI regulations introduced OBD requirements in stages (take the exact thresholds and dates from the current notification).
  • The aim is to detect any fault that would push emissions above a threshold (a multiple of the emission limit), light the MIL and store information for repair.

Monitors.

  • Continuous (run all the time): misfire, fuel system (fuel-trim limits), comprehensive components (every sensor and actuator checked for range, rationality and circuit faults).
  • Non-continuous (run once per drive cycle when conditions are right): catalyst efficiency, oxygen sensors and their heaters, EGR, evaporative system leak test, secondary air, thermostat.
  • Readiness status shows which monitors have completed since codes were last cleared; inspection stations check it, so clearing codes just before a test does not hide a fault.
  • Misfire detection: the ECU watches the crankshaft's speed between firing events; a cylinder that does not fire causes a measurable slow-down. A misfire rate high enough to damage the catalyst makes the MIL flash.
  • Catalyst monitor: compares the upstream and downstream O₂ sensors. A good catalyst stores oxygen, so the downstream signal stays steady; as the catalyst ages, the downstream sensor starts to copy the upstream switching.

Diagnostic trouble codes (DTCs). Five characters, e.g. P0301:

  • 1st: system — P powertrain, B body, C chassis, U network/communication.
  • 2nd: 0 = generic (SAE/ISO-defined), 1 = manufacturer-specific (2 and 3 are split between the two depending on the letter).
  • 3rd (for P0 codes): subsystem — 1 and 2 fuel and air metering (2 = injector circuit), 3 ignition and misfire, 4 auxiliary emission controls (catalyst, EGR, EVAP), 5 vehicle speed and idle control, 6 ECU and outputs, 7 and 8 transmission.
  • 4th–5th: the specific fault. P0301 = cylinder 1 misfire detected; P0300 = random misfire; P0171 = system too lean, bank 1; P0420 = catalyst efficiency below threshold, bank 1.
  • A fault seen once sets a pending code; if it repeats on a second drive cycle it becomes confirmed and the MIL lights (two-trip logic, for most faults). Freeze-frame data record the engine conditions (rpm, load, coolant temperature, trims, speed) when the code was set.
  • A code identifies the symptom the ECU saw, not necessarily the failed part: P0171 can be caused by a vacuum leak, weak fuel pump or dirty MAF, not by the O₂ sensor.

Connector and protocols. A 16-pin connector (SAE J1962) within reach of the driver's seat: pin 4 chassis earth, pin 5 signal earth, pin 16 battery positive, pins 6 and 14 CAN high and low, pin 7 K-line. Protocols include ISO 15765-4 (CAN, used on all recent vehicles), ISO 9141-2 and ISO 14230 (KWP2000) on K-line, and SAE J1850 on older US vehicles.

Services (modes). 01 live data (PIDs), 02 freeze frame, 03 confirmed DTCs, 04 clear DTCs and reset monitors, 06 on-board monitor test results, 07 pending DTCs, 09 vehicle information (VIN, calibration ID), 0A permanent DTCs. Manufacturer-specific diagnostics (UDS, ISO 14229) go much further — coding, actuator tests, ECU flashing.

Diagnostic method. Read and record codes and freeze frame → check for technical bulletins → look at live data (trims, sensor values) → test the circuit and component → repair → clear codes → drive to complete the monitor and confirm the fix.

Formulas

Standard Service 01 PID conversions (A, B are the first and second data bytes, 0–255, from SAE J1979; check the standard for others):

Engine speed (rpm) = (256 × A + B) / 4

Vehicle speed (km/h) = A

Coolant temperature (°C) = A − 40

Fuel trim (%) = (A − 128) × 100 / 128

Calculated load (%) = A × 100 / 255

Misfire rate (%) = misfires / firing events × 100, firing events = (revolutions / 2) × z (four-stroke)

  • z: number of cylinders. The detection threshold and the window length come from the regulation and the calibration.

Catalyst switch ratio = downstream switches / upstream switches

  • Near 0 for a healthy catalyst, approaching 1 for a failed one; the pass limit is calibration-specific.

Worked examples

Example 1 (standard). A scan tool requests Service 01 PIDs 0C, 05 and 0D and receives 41 0C 1A F8, 41 05 7B and 41 0D 3C. Decode them.

  1. Engine speed: A = 0x1A = 26, B = 0xF8 = 248; rpm = (256 × 26 + 248) / 4 = 6904 / 4 = 1726 rpm.
  2. Coolant: A = 0x7B = 123; T = 123 − 40 = 83 °C.
  3. Speed: A = 0x3C = 60; v = 60 km/h.

Answer: 1726 rpm, 83 °C, 60 km/h.

Example 2 (GATE level). (a) A six-cylinder four-stroke engine runs at 2400 rpm. In a 200-revolution window the misfire monitor counts 18 misfires. Find the window duration and misfire rate. (b) On a car with code P0171, short-term trim reads A = 0x8C and long-term trim A = 0x99. Find the trims and interpret them. (c) The downstream O₂ sensor switched 8 times while the upstream one switched 40 times. Find the switch ratio.

  1. Window time = 200 rev / (2400 / 60 rev/s) = 5.0 s.
  2. Firing events = (200 / 2) × 6 = 600; misfire rate = 18 / 600 × 100 = 3.0 %.
  3. STFT: A = 140; (140 − 128) × 100 / 128 = +9.4 %. LTFT: A = 153; (153 − 128) × 100 / 128 = +19.5 %.
  4. Total about +29 % — the ECU is adding a lot of fuel to reach λ = 1, so the engine is getting unmetered air or too little fuel (vacuum leak, low fuel pressure, dirty MAF). This is consistent with P0171.
  5. Switch ratio = 8 / 40 = 0.20 — low, indicating the catalyst is still storing oxygen.

Answer: 5.0 s, 3.0 %; +9.4 % and +19.5 % (lean condition); 0.20.

Common mistakes

  • Replacing the part named in the code description without testing; codes describe what the ECU detected, not what failed.
  • Clearing codes before recording freeze-frame data, or before an emission test (readiness monitors will show "not complete").
  • Counting firing events as revolutions × cylinders in a four-stroke engine — each cylinder fires once every two revolutions.
  • Reading positive fuel trim as "running rich". Positive trim means the ECU is adding fuel because the mixture was lean.
  • Forgetting the −40 offset in coolant temperature, or decoding hex bytes as decimal.
  • Assuming the U codes are engine faults; they are network communication faults.

For GATE ME

OBD is not a core GATE topic, but it tests skills that are: reading a closed-loop system, simple counting and rate calculations, hexadecimal-to-decimal conversion and engine-cycle arithmetic (firing events per revolution). Practise the four-stroke firing-event count and percentage calculations.

Quick check

  1. What does the second character "0" in P0420 indicate?
  2. Why does the MIL flash rather than stay steady for some misfires?
  3. Decode PID 05 with A = 0x5A.
  4. What is freeze-frame data?
  5. Which connector pins carry CAN high and CAN low?

Answers: 1. A generic (SAE/ISO-defined) code. 2. The misfire rate is high enough to damage the catalytic converter. 3. 90 − 40 = 50 °C. 4. A snapshot of engine conditions stored when a DTC was set. 5. Pins 6 and 14.

Try answering each one aloud before you open it.

  1. 1.What is On-board Diagnostics (OBD-II) and why is it important in modern vehicles?Concept

    On-board Diagnostics II (OBD-II) is a standardized system in vehicles that monitors and reports on the performance of various components, especially those related to emissions. It is important because it helps in identifying and diagnosing issues early, ensuring vehicles run efficiently and comply with environmental regulations. OBD-II provides real-time data and standardized diagnostic trouble codes (DTCs) that technicians can use to pinpoint problems.

  2. 2.Explain the difference between OBD-I and OBD-II systems.Concept

    OBD-I was the first generation of on-board diagnostics, introduced in the 1980s, and it lacked standardization across manufacturers. OBD-II, introduced in the mid-1990s, is a more advanced and standardized system that provides a universal set of diagnostic trouble codes (DTCs) and a standardized connector. OBD-II also offers more comprehensive monitoring of vehicle systems and emissions controls.

  3. 3.How do diagnostic trouble codes (DTCs) work in the OBD-II system?Concept

    When a monitor detects a fault, the ECU stores a five-character DTC, first as pending and, if the fault repeats on a second drive cycle, as confirmed, which lights the MIL. The first letter gives the system: P powertrain, B body, C chassis, U network. The second character shows whether the code is generic (0) or manufacturer-specific (1). For P0 codes the third digit gives the subsystem, such as 3 for ignition and misfire or 4 for auxiliary emission controls, and the last two give the fault, so P0301 is a cylinder 1 misfire. Freeze-frame data stored with the code record the operating conditions, and the code describes the symptom detected, not necessarily the failed part.

  4. 4.Why is the OBD-II system crucial for emissions control in vehicles?Application

    The OBD-II system is crucial for emissions control because it continuously monitors the performance of the engine and emissions-related components. It ensures that vehicles meet emissions standards by detecting malfunctions that could lead to increased emissions. When a problem is detected, the system triggers a warning light on the dashboard, prompting the driver to seek repairs, thus helping to maintain low emissions levels.

  5. 5.What happens if a vehicle's OBD-II system is not functioning properly?Application

    If a vehicle's OBD-II system is not functioning properly, it may not detect or report issues with the vehicle's systems, leading to undiagnosed problems. This can result in increased emissions, reduced fuel efficiency, and potential damage to the vehicle. Additionally, the vehicle may fail emissions tests required for registration in many regions, leading to legal and financial consequences for the owner.

  6. 6.How does the OBD-II system communicate with diagnostic tools?Concept

    The OBD-II system communicates with diagnostic tools through a standardized 16-pin connector, usually located under the dashboard. Diagnostic tools connect to this port to retrieve data and trouble codes from the vehicle's computer. The communication protocol used can vary (e.g., CAN, ISO 9141-2), but the standardization ensures compatibility across different vehicles and diagnostic tools.

  7. 7.Explain how a technician would use an OBD-II scanner to diagnose a vehicle issue.Application

    A technician would connect an OBD-II scanner to the vehicle's diagnostic port. The scanner reads the diagnostic trouble codes (DTCs) stored in the vehicle's computer. The technician interprets these codes to identify the specific issues affecting the vehicle. The scanner may also provide real-time data on various sensors and systems, helping the technician to further diagnose and confirm the problem.

  8. 8.Why might a vehicle's check engine light turn on, and how does the OBD-II system help in this situation?Application

    A vehicle's check engine light may turn on due to a variety of issues, such as a loose gas cap, a faulty oxygen sensor, or an engine misfire. The OBD-II system helps by storing diagnostic trouble codes (DTCs) that correspond to the detected issue. By reading these codes with a diagnostic tool, a technician can quickly identify the cause of the light and take appropriate action to fix the problem.

  9. 9.Calculate the fuel efficiency impact if an OBD-II system detects a malfunctioning oxygen sensor that causes a 10% increase in fuel consumption. Assume the vehicle originally consumes 8 liters per 100 km.Numerical

    Original fuel consumption = 8 liters/100 km. With a 10% increase, the new consumption = 8 liters/100 km × 1.10 = 8.8 liters/100 km. Therefore, the malfunctioning oxygen sensor increases fuel consumption by 0.8 liters per 100 km.

  10. 10.If an OBD-II system logs a P0301 code, what does this indicate and how should it be addressed?Application

    A P0301 code indicates a misfire in cylinder 1 of the engine. This can be caused by issues such as a faulty spark plug, ignition coil, or fuel injector. To address this, a technician should inspect and test these components, replacing any that are found to be defective. Ensuring proper engine function will prevent further damage and maintain vehicle performance.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?