Diagnostics

On-board diagnostics detect and report faults. Learn OBD-II and EOBD, the malfunction indicator lamp, diagnostic trouble codes (DTC structure, status bits), freeze frames, readiness monitors, fault debouncing and healing, and the service workflow with scan tools.

When a sensor fails or emissions rise, the car must notice, record what happened and tell the driver and technician. On-board diagnostics make modern cars serviceable — and are legally required for emissions-related faults.

Good diagnostic design avoids both missed faults and false alarms.

An analogy

Diagnostics are the car's medical record: symptoms (DTCs), vital signs at the moment of illness (freeze frames), and check-up results (readiness monitors).

OBD-II basics

Since 1996 (US) / 2001 (EU petrol), cars have a standard 16-pin OBD connector and must monitor emissions-related systems. The MIL lights when an emissions fault is confirmed. Generic scan tools read DTCs and live data (service 01), freeze frames (02), stored codes (03) and clear codes (04).

DTC structure

Format: letter (P powertrain, C chassis, B body, U network) + digit (0 generic, 1 manufacturer) + subsystem digit + two-digit fault. Example: P0301 = cylinder 1 misfire; P0420 = catalyst efficiency below threshold (bank 1). UDS DTCs add a 3-byte code and status byte (testFailed, pending, confirmed, warningIndicatorRequested…).

Monitors and debouncing

Continuous monitors (misfire, fuel system, comprehensive components) and non-continuous monitors (catalyst, O₂ sensor, EVAP, EGR) run under enabling conditions. Readiness flags show whether monitors have completed (needed for inspection). Debouncing (counters/timers) confirms faults; healing clears the MIL after several good cycles.

Diagnostic design and remote diagnostics

Diagnostic concepts define fault detection, reactions (limp-home, degradation), DTC mapping and in-use monitor performance ratios (IUMPR). Remote diagnostics and predictive maintenance use telematics; standards: SAE J1979, ISO 15031, ISO 14229 (UDS), and J1939 for trucks.

Formulas

Worked example: Decode a DTC

Given: DTC P0420

Find: Meaning.

Answer: Catalyst efficiency low, bank 1

Worked example: Decode live engine speed

Given: OBD response 41 0C 1A F8

Find: Engine rpm.

Answer: 1726 rpm

Counter-based DTC debounce (C)

#include <stdint.h>
#include <stdbool.h>

#define FDC_MAX      10
#define FDC_MIN     (-10)
#define STEP_FAIL     2
#define STEP_PASS     1

typedef struct { int8_t fdc; bool confirmed; } dtc_t;

void dtc_report(dtc_t *d, bool test_failed)
{
    if (test_failed) {
        d->fdc = (d->fdc + STEP_FAIL > FDC_MAX) ? FDC_MAX : d->fdc + STEP_FAIL;
        if (d->fdc >= FDC_MAX) d->confirmed = true;      /* store DTC + freeze frame */
    } else {
        d->fdc = (d->fdc - STEP_PASS < FDC_MIN) ? FDC_MIN : d->fdc - STEP_PASS;
        /* healing: MIL off after N good drive cycles, handled by DEM */
    }
}

Debouncing prevents a single noisy sample from setting a fault; AUTOSAR DEM implements counter- and time-based debouncing.

Common mistakes

Applications

Key takeaways

Going further