Go-Parts
Cart 0
Your cart is empty
Add an item to see it appear here.
Wrenchy
Go-Parts Garage
Expert guides for diagnosing, troubleshooting, and replacing auto parts Expert guides for diagnosing and replacing auto parts
Browse All Articles →
🧭 Diagnostic Flowchart 🎬 Helpful Videos

P0031 on 2012-2016 Mazda CX-5 2.0L: Heater Circuit Causes and Fixes

On a 2012-2016 Mazda CX-5 with the 2.0L SKYACTIV-G engine, code P0031 almost always means the upstream oxygen sensor has failed. The most common fix is to replace the sensor, which costs about $150-$250 for an aftermarket part or $350+ for OEM. This is a DIY-friendly repair with the right tool (an offset 22mm or 7/8" O2 sensor socket). Before replacing, it's wise to quickly check the 'ENGINE1 15A' fuse.

15 minutes to read 2012-2016 Mazda CX-5
Most Likely Cause
Failed Upstream Oxygen Sensor (Bank 1, Sensor 1)
Difficulty
2/5
Est. Time
0.8 hrs
DIY Doable?
✅ Yes
Shop Labor
$225 – $550
Parts Price
$150 – $460
⚠️ Drivable, but... — Yes, you can drive the vehicle, but you should get it fixed soon. The engine will run in a default 'open-loop' mode without feedback from the sensor, which will cause poor fuel economy and increased emissions, and you will not pass an emissions test. Long-term driving could potentially harm the catalytic converter due to an incorrect air-fuel mixture.
Key Takeaways
  • P0031 on your CX-5 points directly to a problem with the heater in your front oxygen sensor.
  • The most likely solution is to replace the upstream (Bank 1, Sensor 1) oxygen sensor.
  • Before buying parts, take a moment to check the 'ENGINE1 15A' fuse and inspect the wiring for obvious damage like melting or breaks.
  • Driving with this code won't leave you stranded, but it will hurt your fuel economy and cause you to fail an emissions test.
  • The correct OEM part number is PE01-18-8G1A. The Denso 234-5059 is a trusted aftermarket alternative.
The trouble code P0031 stands for "HO2S Heater Control Circuit Low (Bank 1 Sensor 1)". On your CX-5's inline-four engine, there is only one cylinder bank (Bank 1), and Sensor 1 is the upstream oxygen sensor, also called an Air/Fuel Ratio (A/F) sensor, located on the exhaust manifold before the catalytic converter. This sensor has an internal heater to bring it to operating temperature quickly, which is crucial for fuel efficiency and low emissions, especially on a cold start. The code means the Powertrain Control Module (PCM) has detected that the voltage or current in the sensor's heater circuit is lower than expected, indicating a short to ground or a failed heater element.

What's Unique About the 2012-2016 Mazda CX-5

The SKYACTIV-G engine is a high-compression, direct-injection engine that relies on precise sensor data for its efficiency. The upstream oxygen sensor (A/F sensor) is a critical input for this system. While the P0031 code itself is a standard SAE definition, its occurrence on the CX-5 almost universally points to a straightforward failure of the sensor's internal heater, rather than more complex wiring or computer issues. The repair is consistent and well-documented by owners, with the primary challenge often being the physical accessibility of the sensor's electrical connector. The PCM actively controls the heater with a duty cycle, including a pre-heat phase right after startup to prevent thermal shock to the sensor element from condensation.

Symptoms You May Notice

  • Check Engine Light is on
  • Decreased fuel economy (owners report a noticeable drop)
  • Rough idle, especially on a cold start.
  • Hesitation or stumbling during acceleration, particularly from a stop.
  • Failure to pass an emissions test.
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the downstream (post-catalytic converter) oxygen sensor. P0031 specifically refers to Sensor 1, which is always the upstream sensor.
  • Assuming a wiring fault without first testing the sensor's internal resistance, which is the most common point of failure.

Most Likely Causes

  1. Failed Upstream Oxygen Sensor (Bank 1, Sensor 1) 🔴 High Probability → Shop Oxygen Sensor The internal heater element within the oxygen sensor is a common failure point due to constant, rapid heat cycles and age. This is the most reported cause by owners and mechanics for the P0031 code on this platform.
    How to confirm: Disconnect the sensor and measure the resistance across the two heater circuit pins (usually the two wires of the same color, often black) using a multimeter. A reading of 'OL' (infinite resistance) confirms an open circuit. A good sensor should have a low resistance, typically between 5.0 and 6.8 ohms for similar Mazda models. A Mazda workshop manual states the PCM will trigger a fault if heater resistance is greater than 30 ohms.
    Typical fix: Replace the upstream (pre-catalytic converter) oxygen sensor. Soaking the sensor threads with penetrating oil beforehand is highly recommended.
    Est. part cost: $150-$460
  2. Damaged Wiring or Connector 🟡 Medium Probability The sensor wiring is located in the hot engine bay near the exhaust manifold and can become brittle, melt, or get damaged over time, leading to a short or open circuit. The connector is located down behind the engine and can be tricky to access, potentially leading to damage during other maintenance.
    How to confirm: Visually inspect the wiring harness leading to the oxygen sensor for any signs of melting, chafing, or breaks. Check the connector for corrosion, moisture, or pushed-out pins. Test for 12V power at the harness-side connector (terminal A) with the key on. Check for a short to ground in the wiring harness between the A/F sensor terminal E and PCM terminal 1BY.
    Typical fix: Repair the damaged section of the wiring harness or clean/replace the connector.
    Est. part cost: $5-$50
  3. Blown Fuse ⚪ Low Probability A short circuit in the sensor's heater element can sometimes cause the associated fuse to blow as a protective measure.
    How to confirm: Locate and inspect the fuse for the O2 sensor heater circuit. A Mazda workshop manual specifically indicates this is the 'ENGINE1 15A' fuse in the under-hood fuse box.
    Typical fix: Replace the blown fuse. If the new fuse blows immediately, it confirms a persistent short circuit in the wiring or the sensor itself that must be found and fixed.
    Est. part cost: $1-$5

Rare But Worth Checking

  • Powertrain Control Module (PCM) Fault: This is extremely rare. The PCM is the last item to suspect after all other possibilities (sensor, wiring, fuses) have been exhaustively tested and ruled out. A workshop manual lists PCM malfunction as a possible cause after all wiring and sensor checks have failed.

Diagnosis Steps

  1. Scan for any other DTCs to see if other issues are present.
  2. Perform a visual inspection of the upstream oxygen sensor's wiring harness and connector. Look for any signs of melting, fraying, or corrosion. The harness runs along the back of the engine.
  3. 🎬 Watch: See exactly where the oxygen sensors are located.
  4. Check the 'ENGINE1 15A' fuse in the engine bay fuse box.
  5. If the wiring and fuse are okay, disconnect the sensor's electrical connector. It is located low on the back of the engine and can be difficult to reach.
  6. Test the resistance of the heater circuit within the sensor itself using a multimeter on the sensor-side connector pins (usually the two black wires). A reading of 'OL' (over-limit/open) or a very high resistance indicates the heater has failed. A good sensor should read a low single-digit Ohm value (e.g., 5-7 Ohms). A reading over 30 Ohms is considered a fault by the PCM.
  7. If resistance is within spec, test for 12V power and ground at the vehicle's harness connector with the ignition on. According to the workshop manual, power should be present at Terminal A (from the ENGINE1 15A fuse) and the PCM provides the control signal on Terminal E (to PCM pin 1BY).
  8. If the sensor's heater circuit tests bad, replace the upstream oxygen sensor (Bank 1, Sensor 1). Use a 22mm or 7/8" offset oxygen sensor socket for removal and installation.
  9. 🎬 See this step-by-step upstream sensor replacement walkthrough.

Parts You'll Likely Need

  • Upstream Air/Fuel Ratio Sensor (Oxygen Sensor) (OEM #PE01-18-8G1A) — This is the component identified by the code, and its internal heater element is the most common failure point for P0031.
    Trusted brands: Denso (OEM supplier, P/N 234-5059), NGK/NTK, Bosch
    OEM price range: $360-$460
    Aftermarket price range: $150-$250

Mechanic-Grade Diagnostic Values

  • A/F Sensor Heater Resistance — expected: 5.0 - 6.8 Ohms (based on similar models). Failure: A reading of 'OL' (open circuit) or a resistance greater than 30 Ohms.
  • A/F Sensor Heater Circuit Voltage (at harness connector) — expected: 12V (Battery Voltage) at Terminal A with ignition on.. Failure: Voltage significantly below 11V indicates a power supply issue (fuse, relay, or wiring).
  • A/F Sensor Heater Control Duty Cycle (Live Scan Data) — expected: Approx. 15% during pre-heat phase just after cold start, then 0-100% duty cycle during normal control.. Failure: No duty cycle command from PCM, or a commanded duty cycle with no corresponding change in sensor temperature/activity.
  • Heater Circuit Voltage Drop — expected: Less than 0.5V difference between the PCM output pin and the sensor connector.. Failure: A voltage difference greater than 0.5V indicates excessive resistance in the wiring harness.

Scan Tool Commands That Help

  • Mazda Modular Diagnostic System (M-MDS) or equivalent: A/F Sensor Heater Active Test — This bidirectional command allows a technician to manually activate the A/F sensor heater circuit. It is used to verify if the PCM driver, wiring, and heater element are all functioning. The technician can command the heater ON and monitor the current draw or voltage on the circuit to confirm operation without waiting for a full drive cycle.

Wiring & Ground Locations

  • A/F Sensor Connector — At the upstream oxygen sensor, located on the exhaust manifold at the rear of the engine bay. The harness-side connector is clipped to a bracket low on the back of the engine and can be difficult to access from above.. This is the primary connection point to test the sensor's internal resistance and to check for power/ground from the vehicle harness.
  • A/F Sensor Connector Pin A — On the vehicle-side harness connector for the upstream O2 sensor.. This pin supplies 12V power to the heater circuit from the ENGINE1 15A fuse. Lack of voltage here points to a fuse, relay, or wiring issue upstream.
  • A/F Sensor Connector Pin E — On the vehicle-side harness connector for the upstream O2 sensor.. This pin is the control circuit from the PCM (specifically, pin 1BY). A short to ground on this wire will cause the P0031 code.
  • Engine/Transmission Ground Points — There are several key ground points on or near the transmission housing. One major ground is on top of the transmission, and two others are on the front of the transmission case.. While not directly for the heater circuit (which is controlled by the PCM), a poor engine ground can cause a variety of sensor and ECU issues due to floating ground references. Verifying these grounds are clean and tight is a good practice if chasing elusive electrical faults, though it's a rare cause for P0031.

OEM Part Supersession History

  • PE01-18-8G1PE01-18-8G1A — Standard part revision by the manufacturer.
  • PEDD-18-8G1PE01-18-8G1A — Standard part revision by the manufacturer.

Diagnostic Flowchart

Other Known Issues on This Vehicle

Issues unrelated to this code that are worth knowing about as an owner of this generation:

  • Leaking Drive Belt Tensioner 🟠 Medium — Common issue, can occur at various mileages. The hydraulic tensioner seal fails, causing an oil leak and a rattling/whirring noise. (Ref: TSB 01-019/19 covers this issue for 2013-2019 models, noting the cause is insufficient sealing under high heat and load.)
  • Intake Valve Carbon Buildup 🟠 Medium — A known characteristic of all Gasoline Direct Injection (GDI) engines, including SKYACTIV-G. Can become problematic after 70,000-90,000 miles, especially with frequent short trips.
  • Prematurely Cracked/Chipped Windshields 🟡 Low — Widely reported by owners who feel the windshields are unusually susceptible to cracking from small impacts or even temperature changes.
  • Daytime Running Light (DRL) LED Failure (2016 model) 🟡 Low — The 2016 model year specifically is known for the signature LED DRLs failing. The entire headlight assembly often needs to be replaced. (Ref: There was a warranty extension program for this issue, but it may now be expired.)
  • Thin/Easily Chipped Paint 🟡 Low — A common complaint across many modern Mazda models, including the CX-5. The paint is perceived as being thinner and more prone to chipping from road debris than other brands.

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: A used part is NOT recommended for this repair. Oxygen sensors are wear items with a finite lifespan. The internal heater element that causes P0031 fails due to age and heat cycles, so a used sensor has a high risk of premature failure.

What to inspect on the donor part:

  • Not applicable as used parts are not advised.

OEM-only on this vehicle (don't cheap out):

  • While not strictly 'OEM-only', using a sensor from the original equipment manufacturer (Denso) or another high-quality brand like NGK/NTK is strongly advised. Cheap, unbranded sensors are known to be unreliable and may fail quickly or not meet the PCM's strict performance parameters, causing the code to return.

Aftermarket brands forum-validated for this vehicle:

  • Denso (P/N 234-5059) is the OEM supplier and the most trusted aftermarket choice.
  • NGK/NTK
  • Bosch

Brands owners have reported issues with on this vehicle:

  • Unbranded, low-cost sensors from online marketplaces are frequently reported by mechanics and on forums to have high failure rates.

Real Owner Stories

Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.

2012 Mazda CX-5 SKYACTIV-G

Symptoms: The owner noted the code refers to the sensor before the catalytic converter and triggers when the heater circuit resistance is abnormal.

What fixed it: Replacement of the upstream oxygen sensor.

Source hint: Mazda Forum: A 2012 thread discusses the meaning of the code

2012-2016 Mazda CX-5 SKYACTIV-G 2.0L

Symptoms: The car hesitates for 5-10 seconds before actually accelerating forward from a stop; also noted poor gas mileage.

What fixed it: Replacing the front (upstream) O2 sensor.

Source hint: Mazdas247.com: Multiple threads corroborate that P0031 is typically resolved by replacing the front (upstream) O2 sensor

Frequently Asked Questions

Which specific fuse should I check for a P0031 code on my Mazda CX-5?
You should check the 'ENGINE1 15A' fuse located in the under-hood fuse box. This fuse provides power to the heater circuit of the oxygen sensor.
What is the correct resistance for the upstream A/F sensor on a SKYACTIV-G engine?
According to Mazda workshop manuals and technical data, a good sensor should typically read between 5.0 and 6.8 ohms. The PCM will trigger a fault code if the resistance exceeds 30 ohms.
Is there a specific aftermarket brand recommended for the 2012-2016 CX-5 oxygen sensor?
Yes, Denso (Part Number 234-5059) is the original equipment manufacturer (OEM) supplier and is the most trusted aftermarket choice. NGK/NTK and Bosch are also considered reliable brands.
Where is the Bank 1, Sensor 1 connector located on the CX-5?
The connector is located low on the back of the engine, down behind the engine block near the exhaust. It can be difficult to reach and may require careful access to avoid damaging the wiring.
Can I use a used oxygen sensor from a salvage yard to fix P0031?
A used part is not recommended. Oxygen sensors are wear items with a finite lifespan, and the internal heater element fails due to age and heat cycles. A used sensor has a high risk of premature failure.
Does the 2016 Mazda CX-5 have any specific lighting issues related to this era?
While not related to the P0031 code, the 2016 model year is specifically known for failures of the signature LED Daytime Running Lights (DRLs), which often requires replacement of the entire headlight assembly.
2013-2017 2.5L Mazda CX-5 - Upstream Oxygen (O2) Sensor Replacement
2013-2017 2.5L Mazda CX-5 - Upstream Oxygen (O2) Sensor Replacement
mazda cx5 2014 2017 oxygen sensor locations
mazda cx5 2014 2017 oxygen sensor locations
How To Fix P0031? | HO2S Heater Control Circuit Low (Bank 1, Sensor 1)
How To Fix P0031? | HO2S Heater Control Circuit Low (Bank 1, Sensor 1)
Causes and Fixes P0031 Code: HO2S Heater Control Circuit Low (Bank 1 Sensor 1)
Causes and Fixes P0031 Code: HO2S Heater Control Circuit Low (Bank 1 Sensor 1)
Why You’re Getting P0031 – O2 Sensor Heater Issues!
Why You’re Getting P0031 – O2 Sensor Heater Issues!
How To Fix P0031 Code - Oxygen Sensor Heater Control Circuit Low Bank 1 Sensor 1
How To Fix P0031 Code - Oxygen Sensor Heater Control Circuit Low Bank 1 Sensor 1
Wrenchy
Article researched & written by
Go-Parts' AI research assistant. Every article is backed by live web research, verified OEM data, and real technician knowledge — so you get accurate, up-to-date information you can trust.
Meet Wrenchy → Updated May 30, 2026

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.

Year Coverage
This article covers the OBD-II Code P0031 (Deep Dive) for:
  • Mazda CX-5: 20122013201420152016
In this article
🧭 Diagnostic Flowchart
Jump to ▴

Email This Guide

We'll send you a link to this article so you can read it later or share it.

Added to cart · Part