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
- Counter debouncing:
FDC += step_up (fail), FDC −= step_down (pass); fault confirmed at threshold - Failures to confirm:
n = ⌈threshold / step_up⌉ (from zero, consecutive) - OBD PID decode example:
Engine rpm (PID 0C) = (256A + B)/4
Worked example: Decode a DTC
Given: DTC P0420
Find: Meaning.
- P = powertrain; 0 = generic (SAE); 4 = auxiliary emission controls; 20 = catalyst system efficiency below threshold, bank 1
Answer: Catalyst efficiency low, bank 1
Worked example: Decode live engine speed
Given: OBD response 41 0C 1A F8
Find: Engine rpm.
- A = 0x1A = 26, B = 0xF8 = 248
- rpm = (256 × 26 + 248)/4 = 1726
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
- Wrong: Setting DTCs on single noisy samples. — Right: Debounce with counters/timers and enabling conditions.
- Wrong: Clearing codes to pass inspection. — Right: Readiness monitors reset — inspectors check them.
Applications
- Emissions compliance: OBD monitors required by EPA/CARB and EU regulations.
- Workshop service: Scan tools read DTCs, freeze frames and run actuator tests.
- Fleet telematics: Remote DTC reading enables predictive maintenance.
Key takeaways
- OBD-II: standard connector, MIL, generic services.
- DTC format: P/C/B/U + digits.
- Debounce, confirm, freeze-frame, heal.
- Monitors and readiness drive emissions compliance.
Going further
- IUMPR: In-use monitor performance ratio ensures monitors run often enough in real driving.
- WWH-OBD: World-wide harmonised OBD built on UDS.
- Model-based diagnostics: Residuals between models and measurements isolate faults.