Skip to content
Skip to content

OBD-II Code · Sensors

P0040

HO2S Signals Swapped Bank 1/Bank 2

Severity

low

Lowest on our scale. Fix it when convenient.

Can you drive it

Only if running normally

A short trip to a shop may be reasonable if the light is steady and the car runs normally. Stop safely for a flashing light, severe shaking, overheating, loss of power, or another urgent warning. The code alone cannot confirm safety.

Indicative cost (USD)

$50–$300

Varies by vehicle, diagnosis, parts, and local labor. This is not a repair quote.

Upstream O2 sensors appear cross-wired (B1 reading B2 mixture and vice-versa).

How a shop works this

Work from evidence to part, not the other way round. A code names a circuit or a symptom; it does not name the part that failed.

  1. Note every code that is set, not just this one.

    Codes that appear together usually narrow the cause faster than any one of them read alone.

  2. Read the freeze frame — the conditions the fault was recorded under.

    Cold or warm, idle or load, road speed and engine speed. A fault that only appears cold is a different fault from one that only appears under load, even with the same code on the scanner.

  3. Confirm the fault is current rather than history.

    Clear the code and see whether it returns under those same conditions. A code that does not come back may have been logged during a repair, a flat battery, or a bad connection that has since been disturbed.

  4. Then work the likely-causes list in the order shown.

    That order is what a shop checks first for this code — wiring and connections before the component they run to, because a connector costs nothing to inspect and is a common answer.

If the code comes back after a repair, the underlying fault is still there. That is the point to bring in a scanner with live data and freeze-frame, or a shop that has one.

Common symptoms

  • Multiple O2 + fuel-trim codes
  • Poor running

Likely causes

  • Wiring crossed at sensor connectorsMost common
  • Wrong sensor location during repair
Read the full diagnostic procedureP0040 means the ECM has cross-correlated the fuel-trim response from Bank 1 Sensor 1 and Bank 2 Sensor 1 and concluded that the two upstream O2 senso…

P0040 means the ECM has cross-correlated the fuel-trim response from Bank 1 Sensor 1 and Bank 2 Sensor 1 and concluded that the two upstream O2 sensors are wired to the wrong banks — specifically, when the ECM commands a lean correction on one bank, the OPPOSITE bank's sensor is the one that responds first, which is physically impossible unless the wiring is reversed.

Cheapest-first ladder

  1. this is almost never a sensor failure and almost always a wiring fault, so the diagnostic order is wire-routing inspection BEFORE any electrical testing.
  2. Pop the hood, locate the B1S1 and B2S1 connectors, trace each wire back to its sensor, and confirm the harness is plugged into the correct bank — Bank 1 is the bank that contains cylinder 1 (which varies by manufacturer, but is typically the driver's side on RWD V8s and the firewall-side bank on transverse V6s).
  3. To verify with a scan tool: command an open-loop lean adjustment to Bank 1 via bidirectional control (or simply create a small Bank 1 vacuum leak by cracking the dipstick tube) and watch which sensor moves first — the sensor that reacts is the sensor actually on Bank 1, regardless of what the ECM labels it.
  4. The expensive misdiagnosis on P0040: this code almost always means a mechanic crossed the wires during an O2 replacement or an exhaust manifold job — verify wire routing FIRST before re-buying expensive sensors.
  5. Replacing both sensors with new units while the harness is still crossed will set the same P0040 within one drive cycle.
Vehicle-specific patternsany V6 or V8 that's had recent exhaust work, header installation, manifold replacement, or upstream O2 sensor service is the high-probability candida…

any V6 or V8 that's had recent exhaust work, header installation, manifold replacement, or upstream O2 sensor service is the high-probability candidate — the wires on most V-engines route under the intake plenum and the connectors are visually identical between banks, so it's a five-minute mistake that takes a $0 fix once diagnosed correctly.

  • 2005-2013Chrysler 5.7L Hemi (Ram, Charger, Challenger, 300C) sees P0040 commonly after aftermarket long-tube headers or after a stuck-stud manifold-bolt repair where the tech had to drop the exhaust and re-route the sensor harness.
  • 2004-2014Ford F-150/Mustang 4.6L/5.4L V8 sees P0040 after spark-plug ejection repair where the upstream O2 harness was unplugged to access the heads.
  • 2006-2012Toyota Tundra/Sequoia 5.7L 3UR-FE sees P0040 after exhaust-leak repair on the driver's side manifold (a known failure point) where the sensor leads got crossed during reinstall.
  • 2007-2013BMW N62/N63 V8 sees P0040 after valve-cover gasket service where the cylinder-bank wiring harness has to be moved aside.

Estimated repair$0 (re-route harness) to $250 (one new sensor + relabel).

Look up another code

P0040 — frequently asked

What does a P0040 code mean?

Upstream O2 sensors appear cross-wired (B1 reading B2 mixture and vice-versa).

What causes a P0040 code?

Common causes: Wiring crossed at sensor connectors; Wrong sensor location during repair.

What are the symptoms of a P0040 code?

Typical symptoms: Multiple O2 + fuel-trim codes; Poor running.

Is it safe to drive with a P0040 code?

Only if running normally. A short trip to a shop may be reasonable if the light is steady and the car runs normally. Stop safely for a flashing light, severe shaking, overheating, loss of power, or another urgent warning. The code alone cannot confirm safety. Estimated repair: $50-$300.

How do I diagnose a P0040 code?

Work from evidence to part, not the other way round. A code names a circuit or a symptom; it does not name the part that failed. 1. Note every code that is set, not just this one. 2. Read the freeze frame — the conditions the fault was recorded under. 3. Confirm the fault is current rather than history. 4. Then work the likely-causes list in the order shown.

More free tools

See all 9 tools