Skip to content

OBD-II Code · Sensors

P0040

HO2S Signals Swapped Bank 1/Bank 2

low severitySafe to drive$50-$300

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

Common symptoms

  • Multiple O2 + fuel-trim codes
  • Poor running

Likely causes

  • Wiring crossed at sensor connectors
  • Wrong sensor location during repair

Where to start

  1. Try the cheapest cause first. Start by checking: wiring crossed at sensor connectors.
  2. Cost & scope. $50-$300
  3. If the code returns after the fix: escalate to a shop or scanner with live-data and freeze-frame. A code that re-sets means the underlying fault is still there.
Read the full diagnostic procedure

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: 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. 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). 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. 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. Replacing both sensors with new units while the harness is still crossed will set the same P0040 within one drive cycle.

Vehicle-specific patterns

Vehicle-specific patterns: 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-2013 Chrysler 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-2014 Ford 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-2012 Toyota 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-2013 BMW 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).

Related codes

Look up another code

← All OBD-II codes

More free tools

VIN DecoderDecode year, make, model, engine, recalls.Maintenance ScheduleOil, timing belt, fluids, by vehicle.Gas CostWeekly, monthly, annual fuel math.Tire SizeOEM vs new — diameter delta + speedo error.

See all 10 tools