P0031 on 2009-2014 Subaru Legacy 2.5L: Front O2 Sensor Heater Circuit Fixes
On a 2009-2014 Subaru Legacy with the 2.5L engine, code P0031 almost always means the internal heater in the front oxygen sensor has failed. The most common fix is to replace the front Air/Fuel (A/F) ratio sensor. Before replacing, it's wise to check the A/F sensor fuse (often a 15A fuse in the interior fuse panel). Expect to pay around $100-$180 for a quality aftermarket part from Denso (the OEM supplier) and $160-$250 for a genuine Subaru part. Part numbers vary by year, for example, 2010-2012
- P0031 on your Legacy almost certainly means the front Air/Fuel sensor needs to be replaced.
- Before buying parts, take two minutes to check the O2/AF sensor fuse; it's a rare but possible cause.
- Use a high-quality replacement sensor from Denso (the original equipment manufacturer) or a genuine Subaru part to ensure compatibility and avoid repeat failures.
- The old sensor may be seized in the exhaust. Be prepared with penetrating oil and the correct O2 sensor socket for removal.
What's Unique About the 2009-2014 Subaru Legacy
On this generation of Subaru Legacy and its platform mates (Outback, Forester), the P0031 code is a very common and straightforward issue. Unlike some vehicles where wiring or fuse problems are frequent culprits, on the EJ25 engine the cause is almost always the A/F sensor's internal heater failing due to age and heat cycles. It's important to note that Subaru uses a more sophisticated wideband Air/Fuel sensor in the front position, not a conventional, cheaper oxygen sensor. Using the correct OEM-equivalent part from a brand like Denso is highly recommended by mechanics and owners to avoid compatibility issues or immediate failure of the new part.
Generation note: The 2009-2014 range covers the end of the fourth generation (2009) and the majority of the fifth generation (2010-2014). While the P0031 code has the same meaning and primary cause for both, the specific part number for the front A/F sensor differs. The 2009 model (part of the 4th gen) uses a different sensor than the 2010-2012 models (5th gen, EJ253 engine), which in turn use a different sensor than the 2013-2014 models (5th gen, FB25B engine). Always verify the part number for your specific year and engine.
Symptoms You May Notice
- Check Engine Light is on
- Cruise control is disabled (a common Subaru feature when a CEL is active)
- Reduced fuel economy
- Rough idle, especially when the engine is cold
- Failure to pass an emissions test.
- Replacing the rear oxygen sensor (Sensor 2). The code P0031 specifically points to Sensor 1, which is the sensor before the catalytic converter.
- Assuming a new, cheap aftermarket sensor is good. Many owners in forums report getting a P0031 code immediately after installing a non-OEM or incorrect Denso part number, suggesting it was faulty or incompatible out of the box. Sticking with Denso (the OEM manufacturer) with the correct part number for the vehicle's specific year is highly recommended.
Most Likely Causes
- Failed Front Air/Fuel (O2) Sensor 🔴 High Probability The internal heater element is a common failure point that burns out over time from constant heat cycles, much like a lightbulb filament. This is the most frequent cause for P0031 on these vehicles.
How to confirm: Disconnect the sensor and measure the resistance between the two heater circuit wires (typically the two wires of the same color, often black). A reading of open-loop (OL) or infinite resistance indicates a broken heater element. A good sensor will have a low resistance, typically between 2 and 10 ohms; some sources specify a range of 2.7-6.9 Ohms for this platform.
Typical fix: Replace the front Air/Fuel ratio sensor (Bank 1, Sensor 1). Apply anti-seize compound to the threads of the new sensor before installation.
Est. part cost: $100-$250 - Blown A/F Sensor Fuse ⚪ Low Probability
How to confirm: Locate the fuse panel inside the cabin, to the left of the steering wheel. Check the fuse labeled for the O2 or A/F sensor (often a 15A fuse). A visual inspection or a continuity test with a multimeter will confirm if it's blown.
Typical fix: Replace the blown fuse. If it blows again immediately, this indicates a short circuit in the wiring that needs to be traced.
Est. part cost: $1-$5 - Damaged Wiring or Connector ⚪ Low Probability The wiring harness can be susceptible to damage from heat from the nearby exhaust components or from road debris.
How to confirm: Visually inspect the wiring harness leading from the front A/F sensor up to its connector on the passenger-side strut tower. Look for any signs of melting, chafing, brittleness, or corrosion. Check that the connector is securely plugged in and the pins are clean.
Typical fix: Repair the damaged section of wire or clean/replace the connector.
Est. part cost: $10-$50
Rare But Worth Checking
- Faulty Engine Control Module (ECM): This is extremely rare and should only be considered after all other possibilities (sensor, fuse, wiring) have been definitively ruled out.
Diagnosis Steps
- Read the code with an OBD-II scanner to confirm P0031 is the primary code present.
- Check the A/F or O2 sensor fuse in the interior fuse panel located to the left of the steering column. This is a quick check that can save significant time and money.
- If the fuse is good, visually inspect the wiring and connector for the front A/F sensor. The sensor is in the passenger-side exhaust manifold, and its connector is typically located on the passenger side of the engine bay, near the strut tower.
- If the wiring appears intact, test the heater circuit of the sensor itself. Disconnect the sensor and use a multimeter set to Ohms (Ω) to measure the resistance between the two heater pins (usually the two black wires on the sensor's connector).
- A reading of 'OL' or infinite resistance means the heater is burned out and the sensor must be replaced. A good sensor should read a low resistance, typically within the 2-10 ohm range.
- If the sensor's resistance is within spec, the problem may lie in the wiring harness or the ECM. At this point, you would need to check for 12V power and ground at the harness-side of the connector with the key on, engine off.
- The most common outcome of this diagnosis is a failed sensor heater (Step 5), requiring sensor replacement. After replacement, clear the code with a scanner. The Check Engine Light may take a short drive cycle to turn off on its own.
Parts You'll Likely Need
- Front Air/Fuel Ratio Sensor (Bank 1, Sensor 1)
(OEM #Varies by year: 22641AA54A (2010-2012 EJ253), 22641AA640 (2013-2014 FB25B). Always verify for your specific VIN.)— This part contains the heater element that commonly fails, triggering the P0031 code.
Trusted brands: Denso (OEM Supplier), NGK/NTK
OEM price range: $160-$250
Aftermarket price range: $100-$180
Related Codes That Often Appear With This One
- P0032 — This is the opposite code, 'Heater Control Circuit High'. Seeing both or alternating between them could point to an intermittent short in the wiring rather than a simple failed heater. A blown fuse can also sometimes trigger both codes.
- P0030 — This is a more general code for 'HO2S Heater Control Circuit (Bank 1 Sensor 1)'. P0031 is a more specific version indicating a 'low' circuit condition, but both point to the same component and circuit and are often fixed by replacing the same sensor.
Platform-Specific Known Issues
- The front A/F sensor can become seized in the exhaust manifold due to rust and heat cycles, making removal difficult. Using a generous amount of penetrating oil (like PB Blaster) and a dedicated 22mm O2 sensor socket is highly recommended. Some owners let the oil soak overnight for best results.
- Access to the sensor requires removing a plastic splash shield under the passenger side of the vehicle.
Mechanic-Grade Diagnostic Values
- Front A/F Sensor Heater Element Resistance — expected: 2.7 - 3.5 Ohms at room temperature for a good Denso sensor.. Failure: Open Line (O.L.) or infinite resistance on a multimeter. The ECM may set P0031 if the current draw is less than 0.8 Amps.
- A/F Sensor Heater Circuit Voltage (at harness connector) — expected: ~12V (Battery Voltage) with key on, engine off.. Failure: Voltage significantly below 12V, or 0V, indicates a problem with the fuse or power supply wire.
- A/F Sensor Heater Circuit Ground (at ECM) — expected: The ECM provides a pulse-width modulated ground. On some WRX models, pins D4 and D5 at the ECM are the heater return and should be <1V with the heater active.. Failure: Reading battery voltage on the ground control pin when it should be grounded indicates a lack of control from the ECM or a break in the ground wire.
Scan Tool Commands That Help
- Subaru Select Monitor: Current Data Display > A/F Sensor #1 Resistance — To view the resistance of the A/F sensor heater circuit as seen by the ECM, which can help confirm the multimeter reading.
- Subaru Select Monitor: Current Data Display > O2 Heater Diagnosis — To check the status of the self-test for the oxygen sensor heater circuit. The display will show 'Complete' or 'Incomplete'.
Real Owner Repair Stories
- The Factory Five Forum user 'carnutdave' (Subaru-powered Factory Five 818 (using donor harness, likely WRX)) — Persistent P0031 code after startup.
❌ Tried (didn't work) Replacing the front A/F sensor with a new Denso part., Replacing the front A/F sensor again with a genuine Subaru OEM part., Swapping the ECU with a used unit., Confirming 12V+ power to the heater circuit., Confirming the sensor heater resistance was good (1.5 ohms)., Simulating a heater with a 3-ohm test light, which lit up briefly as expected.
✅ What actually fixed it A bad ground connection. The user traced the ECU control system grounds (connector B134, pins 7 and 15) and found a high resistance of 5 ohms. Cleaning the E3 engine connector, which was part of this shared ground circuit, dropped the resistance to 0.2 ohms and resolved the P0031 code. This also fixed an incorrect voltage reading on their Cobb Accessport.
Model Year Variations Within This Range
- 2013-2014: For the 2013 model year, Subaru replaced the 2.5L SOHC EJ253 engine with the new 2.5L DOHC FB25B engine. This engine change requires a different front A/F sensor. The 2010-2012 models use OEM part 22641AA54A (Denso 234-9123), while the 2013-2014 models use OEM part 22641AA640 (Denso 234-9136). The parts are not interchangeable.
Diagnostic Flowchart
Other Known Issues on This Vehicle
Issues unrelated to this code that are worth knowing about as an owner of this generation:
- Excessive Oil Consumption 🔴 High — Common on 2.5L EJ25 engines from 2011-2014 and the newer FB25 engine. Consumption can be as high as 1 quart per 1,200 miles. (Ref: Subaru issued TSB 02-157-14R (and related bulletins) and extended the powertrain warranty to 8 years/100,000 miles for affected vehicles, sometimes resulting in a short block replacement.)
- CVT Torque Converter Lock-Up Failure 🟠 Medium — Affects models with the TR580 CVT (2010-2014). Can cause shuddering, stalling when coming to a stop, or codes like P2763/P2764. Often occurs at higher mileage (100k+). (Ref: TSB 16-90-13R addresses this by replacing the torque converter with an updated part. Another fix involves replacing the lock-up solenoid in the valve body.)
- Head Gasket Failure 🟠 Medium — While significantly improved from pre-2005 models, the EJ25 engine in this generation can still experience external oil or coolant leaks from the head gaskets, particularly the 2009 model.
- Headlight Bulbs Burn Out Prematurely 🟡 Low — A widely reported annoyance on 2010-2012 models. The bulbs fail frequently and can be difficult to access for replacement (often through the wheel well).
- Rear Wheel Well Rust 🟠 Medium — Common in regions that use road salt. Rust often starts in the rear wheel arches and can spread to the subframe and strut mounts if not addressed.
Used vs. New Parts: Buying Guide for This Vehicle
When a used part is the smart pick: Never. The Air/Fuel (O2) sensor is a wear-and-tear component. The internal heater element that fails and causes P0031 does so due to age and heat cycles. A used sensor from a junkyard has an unknown and limited remaining lifespan and is considered a very poor value, even if it temporarily resolves the code.
What to inspect on the donor part:
- Not applicable, as purchasing a used sensor is strongly discouraged.
OEM-only on this vehicle (don't cheap out):
- Front Air/Fuel Ratio Sensor
Aftermarket brands forum-validated for this vehicle:
- Denso (the OEM supplier for Subaru)
- NTK / NGK
Brands owners have reported issues with on this vehicle:
- Bosch: While a reputable brand for European vehicles, numerous Subaru forum members report compatibility issues, incorrect readings, and premature failures when using Bosch sensors on this platform.
- Generic/No-Name/eBay brands: These are frequently reported to be incompatible, fail immediately, or have a very short service life, causing the P0031 code to return quickly.
Real Owner Stories
Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.
2009 Subaru Liberty (Legacy) BR9
Symptoms: Check Engine Light (CEL) illuminated, OBD2 scanner showed DTC P0031: Bank 1, sensor 1, heater circuit voltage low.
What fixed it: Replaced the failed Bank 1 Sensor 1 oxygen sensor with a new OEM Denso part.
Source hint: owner_reports: Paul in Perth
2005 Subaru Legacy (Relevant to 2009 model)
Symptoms: CEL P0031 present; owner provided a walkthrough for replacing the upstream oxygen sensor.
What fixed it: Replacement of the upstream (front) oxygen sensor located in the passenger-side exhaust manifold.
Source hint: LegacyGT.com: Thread 'How to Replace Upstream Oxygen Sensor (CEL P0031) - Walkthroughs'
2013 Subaru Forester 2.5L
Symptoms: Intermittent CEL code P0031; owner questioned if it was tied to fuel level.
What fixed it: Replacing the sensor resolved the issue, confirming it was a failing O2 sensor heater.
Source hint: Reddit r/subaru: Thread 'Intermittent CEL code p0031 tied to fuel level?'
Related OBD-II Codes
Frequently Asked Questions
Why is my cruise control light flashing and the system disabled on my 2010 Legacy?
Where is the A/F sensor fuse located on the 2009-2014 Legacy?
What specific resistance should I look for when testing the front A/F sensor on this platform?
Is there a specific brand of sensor recommended for the EJ25 engine to fix P0031?
I'm having trouble removing the sensor from the exhaust manifold; any tips for this vehicle?
Could my P0031 code be related to the excessive oil consumption TSB for the 2011-2014 models?
Helpful Videos
We Have This Part in Stock
The information in this article is provided for general reference and educational purposes only. Vehicle specifications, procedures, and part compatibility can vary by production date, trim level, and region. Always consult your vehicle's factory service manual and verify part numbers before purchasing or performing repairs. Safety-critical components such as airbags, seat belts, and braking systems should be installed by a qualified professional.
- Subaru Legacy:
- 🧭 Diagnostic Flowchart
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2009-2014 Subaru Legacy
- Symptoms You May Notice
- Most Likely Causes
- Rare But Worth Checking
- Diagnosis Steps
- Parts You'll Likely Need
- Related Codes That Often Appear With This One
- Platform-Specific Known Issues
- Mechanic-Grade Diagnostic Values
- Scan Tool Commands That Help
- Real Owner Repair Stories
- Model Year Variations Within This Range
- Other Known Issues on This Vehicle
- Used vs. New Parts: Buying Guide for This Vehicle
- Real Owner Stories
- 2009 Subaru Liberty (Legacy) BR9
- 2005 Subaru Legacy (Relevant to 2009 model)
- 2013 Subaru Forester 2.5L
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off