P0031 on 2002-2008 Subaru Forester: Front O2 Sensor Heater Circuit Causes and Fixes
On a 2002-2008 Subaru Forester, code P0031 almost always means the internal heater in the front oxygen sensor (Bank 1, Sensor 1) has failed. Replacing the sensor is the most common fix. Expect to pay between $120-$180 for a quality aftermarket part (like Denso) and around $220-$280 for an OEM part. This is a common DIY repair with a difficulty of 2/5.
- P0031 on a 2002-2008 Forester points directly to the front passenger-side Air/Fuel Ratio sensor's heater circuit.
- The most probable cause is a failed sensor. Don't be alarmed by the flashing cruise control light, as this is standard Subaru procedure for a CEL.
- Before buying a new sensor, perform a quick 2-minute check of the 'A/F Heater' fuse in the engine bay and/or interior fuse box.
- Confirm the sensor has failed by testing the resistance between the two same-colored heater wires; a good sensor reads 2-4 ohms, while a bad one will read open (OL).
- When replacing the sensor, inspect for any contact between the wiring/sensor and the exhaust heat shields, as this can cause a short.
What's Unique About the 2002-2008 Subaru Forester

On this generation of Subaru Forester, the P0031 code is a very common and straightforward issue. The front Air/Fuel ratio sensors, often supplied by Denso from the factory, are a frequent failure point after many years and heat cycles. When the Check Engine Light appears for this code, it is often accompanied by a flashing cruise control light and a disabled vehicle dynamics control (VDC) or traction control light. This is normal Subaru behavior designed to get the driver's attention and is not a separate issue; cruise control is intentionally disabled by the ECM as a safety precaution whenever a check engine light is active.
🎬 Watch: Why your cruise control light is flashingGeneration note: The 2002-2008 model years all fall within the second generation (SG) of the Subaru Forester. However, there was a facelift in 2006 and different part numbers are used for the front A/F sensor depending on the model year and whether the engine is turbocharged (XT) or naturally aspirated (X/XS). The fundamental cause and repair process for P0031 remain the same across this generation.
Symptoms You May Notice

- Check Engine Light (CEL) illuminated
- Flashing cruise control light
- Disabled traction/stability control (VDC) light
- Reduced fuel economy
- Rough or unstable idle, especially when the engine is cold
- Failure to pass an emissions test
- Engine hesitation or poor performance
- Replacing the rear (downstream) oxygen sensor. The code P0031 specifically refers to Sensor 1, which is the front (upstream) sensor.
- Ignoring a blown fuse. Some owners replace the sensor, but the code returns instantly because the underlying fuse issue was not addressed.
Most Likely Causes

- Failed Front A/F (O2) Sensor Heater Element 🔴 High Probability The internal heater element is a delicate wire that is subjected to thousands of heat cycles and constant vibration, making it the most common point of failure within the sensor. It is considered a wear-and-tear item.
How to confirm: Unplug the sensor and use a multimeter to measure the resistance between the two heater circuit pins (typically the two same-colored wires, often black). A reading of 'OL' (Open Line) or infinite resistance confirms the heater has burned out. A good sensor should have a low resistance, typically between 2.0 and 4.0 ohms 🎬 See how to test sensor resistance with a multimeter when at room temperature, though some new sensors may read up to 5 ohms.
Typical fix: Replace the Bank 1, Sensor 1 Air/Fuel Ratio sensor.
Est. part cost: $120-$280 - Blown A/F Sensor Fuse ⚪ Low Probability A short circuit in the sensor's wiring, often from contact with a hot exhaust component or a frayed harness, can cause the fuse to blow as a protective measure.
How to confirm: Locate the fuse box in the engine compartment and/or the interior fuse panel. Check the fuse labeled 'A/F Heater', 'Engine Sensor', or similar (consult the fuse box diagram or owner's manual). Visually inspect the fuse or use a multimeter to test for continuity. On some non-turbo Foresters, this may be a 20A fuse labeled 'Engine sensor' in the interior fuse box.
Typical fix: Replace the blown fuse. If the new fuse blows immediately, it indicates a persistent short circuit in the wiring or the sensor itself that must be diagnosed and repaired.
Est. part cost: $1-$5 - Damaged Wiring or Connector ⚪ Low Probability The sensor wiring is located near the hot exhaust manifold and can become brittle, melted, or frayed over time. A common failure point on related Subaru models is the exhaust heat shield rubbing against the sensor or its wiring, causing a short. The connector can also become corroded or filled with debris.
How to confirm: Visually inspect the entire wiring harness from the A/F sensor to its connection point in the engine bay. Look for any signs of melting, chafing, or broken wires. Pay close attention to where the harness passes near heat shields or the exhaust manifold. Check that the connector is clean, dry, and securely latched.
Typical fix: Repair the damaged section of wiring or clean/replace the connector. If a heat shield is the cause, bend it away or secure it to create clearance.
Est. part cost: $10-$50
Rare But Worth Checking
- Faulty Engine Control Module (ECM): This is extremely rare. The ECM's internal driver for the heater circuit can fail, but all other potential causes should be exhaustively ruled out before considering ECM replacement.
Diagnosis Steps

- Read the code with an OBD-II scanner to confirm P0031 is the primary code.
- Locate the main fuse box in the engine bay and the secondary box in the cabin. Check the fuse for the 'A/F Heater' or similarly named circuit. Replace if blown. If it blows again, investigate for a short.
- If the fuse is good, locate the front oxygen sensor on the passenger side exhaust manifold. 🎬 Watch this step-by-step upstream sensor replacement guide
- Visually inspect the sensor's wiring harness and connector for any signs of melting, fraying, or contact with heat shields.
- Disconnect the sensor's electrical connector. It is typically located on the passenger side strut tower in the engine bay.
- Identify the two wires for the heater circuit on the sensor side of the connector (they are usually the same color, often black).
- Set a multimeter to measure resistance (Ohms) and place the probes on the two heater pins. A reading of infinite resistance (Open Loop/OL) means the sensor's heater is broken and the sensor must be replaced. A good sensor will read between 2.0 and 4.0 ohms.
- If the sensor resistance is within spec, the problem likely lies in the vehicle's wiring. With the key on and engine off, use the multimeter (set to DC Volts) to check for 12V power at one of the corresponding pins on the vehicle-side of the harness.
- If power and ground are present at the harness connector and the sensor's resistance is good, the issue could be an intermittent connection or, very rarely, the ECM.
Parts You'll Likely Need
- Front Air/Fuel Ratio Sensor (2004-2008 XT - Turbo)
(OEM #22641AA211, 22641AA450)— This is the upstream sensor for Bank 1 on turbo models. Its internal heater element is the most common failure point. The OEM part number 22641AA211 is often superseded by 22641AA450. The Denso 234-9120 is a direct-fit aftermarket equivalent.
Trusted brands: Denso, NGK
OEM price range: $220-$280
Aftermarket price range: $130-$180 - Front Air/Fuel Ratio Sensor (2002-2008 X/XS - Non-Turbo)
(OEM #22641AA140, 22641AA230)— This is the correct upstream sensor for non-turbo models. The heater element is the component that fails. The Denso 234-9123 is a common direct-fit replacement for these applications.
Trusted brands: Denso, NGK
OEM price range: $200-$260
Aftermarket price range: $120-$170
Platform-Specific Known Issues
- Heat Shield Interference: On some Subaru models with the EJ25 engine, a rusted or loose exhaust heat shield can make contact with the body of the front A/F sensor. This can cause a direct short to ground, which will repeatedly blow the A/F heater fuse and trigger the P0031 code even with a new sensor. During replacement, it is critical to inspect the clearance around the sensor and bend or remove the interfering portion of the shield.
- Aftermarket Sensor Compatibility: While Denso is the original equipment manufacturer, some owners have reported persistent P0031 codes when using an off-the-shelf Denso sensor rather than the more expensive, Subaru-branded equivalent. A forum user noted their tuner suggested that Subaru may bin sensors to stricter tolerances. While not definitively proven, if a new aftermarket sensor does not resolve the code and all wiring/fuses are good, trying a genuine Subaru part may be a solution.
Mechanic-Grade Diagnostic Values
- A/F Sensor Heater Circuit Resistance — expected: 2.0 to 4.0 Ohms at room temperature (approx. 68°F / 20°C).. Failure: A reading of infinite resistance (OL) indicates an open circuit (burned out heater). A reading significantly below 2.0 ohms indicates a short.
- A/F Sensor Heater Circuit Current Draw — expected: Approximately 1 to 2 Amps when the heater is active (during cold start).. Failure: Zero amps indicates an open circuit or no power/ground. Significantly higher amperage indicates a short circuit.
- A/F Sensor Heater Power Supply Voltage — expected: Battery voltage (approx. 12V) at the harness connector with Key On, Engine Off.. Failure: Low or no voltage indicates a problem with the fuse, relay, or wiring from the power source.
- Scan Tool Live Data - A/F Sensor #1 Resistance — expected: Should match the multimeter reading (2-4 ohms).. Failure: A reading of 255 ohms on a Subaru scan tool is a common indicator of an open/failed heater circuit.
Scan Tool Commands That Help
- Subaru Select Monitor (or equivalent professional scanner): Current Data Display / Live Data — Use this to monitor the 'A/F Sensor #1 Resistance' and 'A/F Sensor #1 Current' PIDs. This allows for real-time observation of the heater circuit's integrity and performance as commanded by the ECM, confirming if the resistance is out of spec or if current is not being drawn.
Wiring & Ground Locations

- E23 / E24 — The front A/F sensor's main harness connector is located on the passenger-side strut tower in the engine bay.. This is the primary test point for checking voltage, ground, and resistance without having to access the sensor directly. Corrosion or damage here is a common cause of failure.
- Engine Ground Clusters — Key engine ground wires are bundled and bolted to the top of the intake manifold.. A high-resistance connection at these main grounds can cause a voltage drop under the load of the A/F sensor heater, triggering P0031 even if the sensor and its immediate wiring test good with a low-current multimeter.
- Interior Fuse Box — Located on the driver's side, behind a cover near the driver's left knee.. On some models, the fuse for the A/F sensor heater (e.g., a 20A fuse labeled 'Engine sensor' on non-turbos) is located here, not in the engine bay. This is an easily missed check.
Real Owner Repair Stories
- Robinson's Automotive Specialist on YouTube (Jeep Grand Cherokee) (2004 Jeep Grand Cherokee) — Persistent P0031 code.
❌ Tried (didn't work) Replacing the Bank 1, Sensor 1 oxygen sensor.
✅ What actually fixed it The heater control wire was shorted to ground, causing the heater to be powered constantly. The technician located the short in the harness, repaired the wire, and the code was resolved without needing any new parts. - User 'Skip' on Ultimate Subaru Message Board (Various Subaru models) — P0031 code.
❌ Tried (didn't work) Extensive electrical diagnosis on every vehicle.
✅ What actually fixed it After diagnosing the code extensively the first few times, the technician concluded that in his experience with over 100 cars, simply replacing the front A/F sensor has fixed the P0031 code every single time.
OEM Part Supersession History
22641AA211→22641AA450— Standard part revision and update by the manufacturer.
Heads up: Part number 22641AA450 is the correct replacement for 22641AA211 for 2.5L turbo models like the Forester XT. Other associated part numbers for this sensor include 22641AA490 and 22641AA32A.
Model Year Variations Within This Range
- 2006-2008 (Post-facelift): Fuse box diagrams for post-facelift models may have slightly different labels. For example, a 2006 non-turbo model may use a 20A fuse in the interior fuse panel labeled 'Engine sensor' for the A/F heater circuit.
Diagnostic Flowchart
Used vs. New Parts: Buying Guide for This Vehicle
When a used part is the smart pick: A used part is generally NOT recommended for the A/F sensor itself, as it is a critical wear item with a finite lifespan. However, sourcing a used connector pigtail from a salvage yard is an excellent and cost-effective repair if your vehicle's harness-side connector is melted or damaged.
Donor-vehicle mileage cap: roughly under 150000 miles for the part to have meaningful remaining life.
What to inspect on the donor part:
- For a connector: ensure the plastic is not brittle or cracked.
- Check that the locking tab is intact.
- Inspect the pins to ensure they are clean, straight, and free of corrosion.
- Ensure there is at least 6 inches of wiring attached to the pigtail for easier splicing.
Aftermarket brands forum-validated for this vehicle:
- Denso (OEM supplier)
- NTK (NGK)
Brands owners have reported issues with on this vehicle:
- Bosch: Despite being a major sensor manufacturer, many Subaru owners and technicians report persistent codes, incompatibility, and premature failures when using Bosch O2/AF sensors on this platform.
Real Owner Stories
Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.
2005 Subaru Forester XT Premium
Symptoms: The check engine light came on, displaying code P0031 'HO2S Heater Control Circuit Low Bank 1 Sensor 1'.
What fixed it: Replaced the front O2 sensor, which is the pre-catalyst, pre-turbo sensor located on the passenger side.
Source hint: owner_reports: Useful-Info, '2005 Subaru Forester XT Premium Front O2 sensor R and R'
2008 Subaru WRX
Symptoms: Check engine light with codes P0031 and P0037 stored.
What fixed it: The root cause was found to be an exhaust heat shield that was touching the O2 sensor, causing a short circuit and blowing the related fuse. Fixing the clearance and replacing the fuse resolved the codes.
Source hint: forum_citations: YouTube (Nathan Oikarinen) - repair video for a 2008-2014 WRX
Subaru Forester with EJ25 engine
Symptoms: The P0031 code kept returning and the A/F heater fuse would blow repeatedly, even after installing a brand new sensor.
What fixed it: The problem was a rusted and loose exhaust heat shield making physical contact with the body of the A/F sensor. Bending the heat shield away to create clearance stopped the short circuit.
Source hint: vehicle_specific_issues: Heat Shield Interference
Related OBD-II Codes
Frequently Asked Questions
Where is the front A/F (O2) sensor located on my 2002-2008 Forester?
My cruise control light is flashing and the VDC/traction control light is on. Is this related to the P0031 code?
What resistance should a good front A/F sensor have on this Forester?
I replaced the sensor but the P0031 code came back immediately. What should I check next?
What special tool is needed to replace the front oxygen sensor?
I'm seeing a P0031 code even with a new aftermarket Denso sensor. Is this possible?
Helpful Videos
Used OEM Parts in Stock
New Aftermarket Parts Available
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 Forester:
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2002-2008 Subaru Forester
- Symptoms You May Notice
- Most Likely Causes
- Rare But Worth Checking
- Diagnosis Steps
- Parts You'll Likely Need
- Platform-Specific Known Issues
- Mechanic-Grade Diagnostic Values
- Scan Tool Commands That Help
- Wiring & Ground Locations
- Real Owner Repair Stories
- OEM Part Supersession History
- Model Year Variations Within This Range
- Diagnostic Flowchart
- Used vs. New Parts: Buying Guide for This Vehicle
- Real Owner Stories
- 2005 Subaru Forester XT Premium
- 2008 Subaru WRX
- Subaru Forester with EJ25 engine
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off