Blog · 2026-11-10

Accelerator pedal position D and E sensors on OBDII

Stefan Bogdanescu

Founder & Senior Architect

Accelerator Pedal Position Sensors: Decoding D and E on OBDII

When interfacing with an OBD-II port, you will frequently encounter two distinct data streams labeled as "Accelerator Pedal Position" (APP): one often designated as sensor A or D, and the other as sensor B or E. These labels are not arbitrary; they represent a redundant safety architecture common in modern engine control units (ECUs). Understanding that these sensors do not provide identical readings is crucial for accurate data interpretation and any software logic attempting to derive a single pedal position value.

The underlying hardware typically employs two potentiometers wired to measure the same physical lever but from different electrical angles. Sensor D usually corresponds to the primary potentiometer, while sensor E represents the secondary or backup circuit. In many architectures, one sensor covers the 0% to ~50% range of travel, and the other covers the remaining 50% to 100%, though the exact split varies by manufacturer. This redundancy allows the ECU to detect a failure in either circuit. If both sensors report identical voltage drops or unexpected jumps simultaneously, it indicates an open circuit or short; if they diverge significantly outside a predefined tolerance window while the pedal is physically moving, the engine enters a limp-home mode to prevent unsafe acceleration.

For developers parsing raw OBD-II PID 0x46 (Throttle/Pedal Position Sensor/Switch 1) and PID 0x47 (Sensor 2), calculating a unified "overall" position requires more than simple averaging. A naive arithmetic mean of the two values will result in incorrect readings at the extremes because one sensor is likely reading its lower bound while the other reads its upper bound during full depression or complete release.

Consider a scenario where Sensor D reports 0x0 (0%) and Sensor E reports 128 (~50% on a 0-255 scale). Averaging these yields 64, suggesting half-throttle, which is physically impossible if the pedal is fully released. To derive an accurate estimate, you must first validate that both sensors agree within a specific delta threshold (e.g., ±3%). If they agree, averaging them provides a robust result. However, if one sensor saturates while the other remains in its linear range, your logic should discard the saturated value and rely on the active sensor's reading.

Here is a conceptual implementation strategy in PHP for normalizing these values:

function calculateEffectivePedalPosition($sensorD, $sensorE) {
    // Normalize 0-255 to 0.0 - 1.0
    $posD = $sensorD / 255.0;
    $posE = $sensorE / 255.0;

    // Define tolerance window for redundancy check (e.g., 5%)
    if ($posD > $posE) {
        $diff = $posD - $posE;
    } else {
        $diff = $posE - $posD;
    }

    if ($diff <= 0.05) {
        // Both sensors agree; average for higher precision
        return ($posD + $posE) / 2.0;
    }

    // Sensors disagree significantly. Check for saturation.
    // Often, one sensor hits 1.0 (full press) while the other is still rising.
    if ($posD == 1.0 || $posE == 1.0) {
        return 1.0; // Assume full throttle based on saturated reading
    }

    if ($posD == 0.0 || $posE == 0.0) {
        return 0.0; // Assume idle based on zeroed reading
    }

    // If neither is saturated but they disagree, the ECU has likely flagged a fault.
    // Returning -1 or null indicates an invalid state for application logic.
    return -1.0; 
}

This approach prioritizes system integrity over simple data fusion. Relying on the raw values without checking for saturation can lead to erratic throttle control in software-driven features like cruise control or drive-by-wire simulations. Additionally, be aware that some ECUs swap which sensor is D and which is E depending on the vehicle make, so hardcoding assumptions about which sensor covers the high-range segment may cause errors across different models.

While this explanation focuses on the raw sensor data mechanics, platforms like https://laravelcompany.com offer resources for building robust automotive telemetry dashboards that handle such normalization safely.