P0345 on 2003-2008 Mazda 6 3.0L V6: Camshaft Sensor (Bank 2) Causes and Fixes
On a 2003-2008 Mazda 6 with the 3.0L V6, code P0345 almost always means the Bank 2 (front) camshaft position sensor has failed. This is a relatively easy and affordable DIY replacement, with the part costing between $25 and $80. Bank 2 is the cylinder bank closer to the radiator.
- P0345 points to the camshaft position sensor on the front cylinder bank (Bank 2) of the Mazda 6 3.0L V6.
- The most common fix is replacing the sensor itself, which is an affordable and accessible DIY job.
- Before replacing the sensor, inspect the wiring and connector for damage, and consider swapping the front and rear sensors to confirm the failure.
- If P0340 appears at the same time, the problem is more likely related to wiring, electrical noise, or mechanical timing.
What's Unique About the 2003-2008 Mazda 6
For the V6 engine in the first-generation Mazda 6, this code is straightforward. The most critical piece of information is that 'Bank 2' is the cylinder bank at the front of the engine bay, near the radiator, making the sensor relatively easy to access. Bank 1 is the bank near the firewall. While the code points to a circuit issue, the sensor itself is the most frequent point of failure. Owners often report this code appearing after a period of rough idling, difficulty starting, or even stalling. In some cases, the tachometer will not work on startup until the engine is revved past a certain RPM when this code is present.
Symptoms You May Notice
- Check Engine Light is on
- Difficulty starting the engine, or long crank times
- Rough idle or stalling, especially as the engine warms up
- Reduced engine performance and acceleration
- Increased fuel consumption
- Engine misfires
- Tachometer stays at zero until the engine is revved
- Traction control light may illuminate intermittently
- Replacing the wrong camshaft sensor. P0345 is for Bank 2, the front bank near the radiator. 🎬 Watch this guide on fixing the P0345 Bank 2 circuit code. P0340 is for Bank 1, the rear bank near the firewall.
- Replacing the sensor without checking the wiring. A simple wiring fault can mimic a failed sensor, leading to wasted money on parts.
- Replacing the spark plugs or ignition coils. While a misfire can be a symptom, it's a result of the bad sensor data, not the cause of the P0345 code.
- Replacing the PCM. This is very rarely the cause and should only be considered after all other possibilities (sensor, wiring, timing) have been exhaustively ruled out.
Most Likely Causes
- Failed Bank 2 Camshaft Position Sensor 🔴 High Probability → Shop Engine Camshaft Position Sensor The sensor operates in a high-heat environment and its internal electronics can degrade over time, leading to failure. It is the most common culprit for this code. The sensor is a Hall effect type, and its components can become less sensitive over time.
How to confirm: Visually inspect the sensor for damage or oil contamination. The most definitive DIY test is to swap the Bank 1 (rear) and Bank 2 (front) sensors. If the code changes to P0340 (Bank 1), the sensor is bad. 🎬 See how to properly swap and replace a camshaft sensor. If the P0345 code returns, the problem is in the wiring or elsewhere. You can also test the sensor with a multimeter; check your vehicle's service manual for the specific resistance range.
Typical fix: Replace the Bank 2 (front) camshaft position sensor. Ensure the o-ring from the old sensor is removed with it.
Est. part cost: $25-$80 - Wiring Harness or Connector Issue 🟡 Medium Probability Wires can become brittle, chafed, or corroded over time due to engine heat and vibration. A poor connection at the sensor's electrical plug can also interrupt the signal. Some owners report issues after engine work if the harness was not handled carefully.
How to confirm: Visually inspect the wiring harness leading to the front camshaft sensor for any signs of damage, melting, or corrosion. Check that the connector is clean and securely plugged in. Use a multimeter to check for continuity, power, and ground at the connector. One owner on a forum noted a specific wiring harness bracket bolt that, when removed, provided enough slack to properly access and diagnose the sensor and connector.
Typical fix: Repair the damaged section of wire or replace the connector pigtail.
Est. part cost: $10-$30 - Engine Oil Contamination ⚪ Low Probability A leaking valve cover gasket can allow oil to seep into the sensor's housing or its electrical connector, interfering with the signal. One owner reported this code after an engine failure sprayed oil over the harness, which was then reused.
How to confirm: When you remove the sensor, check for significant amounts of engine oil on the sensor tip or inside its electrical connector.
Typical fix: Replace the faulty sensor and the leaking valve cover gasket to prevent recurrence. Clean the oil out of the connector with electrical contact cleaner.
Est. part cost: $50-$120
Rare But Worth Checking
- Stretched or Slipped Timing Chain: → Shop Engine Timing Chain While less common than a sensor failure, a timing chain issue is a serious mechanical problem. If the chain has stretched or a tensioner has failed, the cam/crank correlation will be off, triggering the code. This usually happens at higher mileage and may be accompanied by rattling noises. A user on mazda6club.com with both P0340 and P0345 ultimately performed a full timing job to resolve the issue.
- Faulty Crankshaft Position Sensor (CKP): The PCM compares signals from the camshaft and crankshaft sensors. A failing CKP can sometimes cause a correlation fault that the PCM misinterprets as a camshaft sensor issue. This usually sets other codes as well, like P0335.
- Damaged Reluctor Wheel: The sensor reads teeth on a reluctor wheel (or tone ring) mounted to the camshaft. If this wheel is damaged, cracked, or has separated from the cam phaser, the sensor cannot get a correct reading. This is a rare but possible mechanical failure.
Diagnosis Steps
- Scan for additional codes. If other codes like P0340 or P0335 are present, it may indicate a larger problem affecting multiple sensors or the timing system.
- Locate the Bank 2 camshaft position sensor. It is on the front valve cover, on the side of the engine closer to the radiator.
- Visually inspect the sensor's connector and wiring harness. Look for loose connections, corrosion, oil contamination, or any signs of damage like chafing or melting.
- If the wiring looks good, swap the Bank 2 (front) sensor with the Bank 1 (rear) sensor. They are the same part number. Clear the codes and drive the vehicle.
- Re-scan the codes. If the code has changed to P0340 (Bank 1), the sensor you moved is faulty and needs replacement. If P0345 returns, the problem lies in the wiring, PCM, or mechanical timing.
- If the sensor is not the cause, use a multimeter to test the circuit. Check for the correct voltage reference, ground, and signal wire integrity at the sensor connector. Refer to a vehicle-specific wiring diagram for pinouts.
- If all electronics check out, the issue may be mechanical. At this point, professional diagnosis of the timing chain, tensioners, and reluctor wheel is recommended.
Parts You'll Likely Need
- Camshaft Position Sensor (Bank 2 / Front)
(OEM #AJ58-18-230A (replaces AJ5818230) or Ford equivalent 1F1Z6B288AA)— This sensor is the most common point of failure for the P0345 code on this vehicle. The Bank 1 and Bank 2 sensors are identical and interchangeable for testing.
Trusted brands: Genuine Mazda/Motorcraft, Hitachi, Denso, Bosch, NGK/NTK, Standard Motor Products (SMP)
OEM price range: $60-$100
Aftermarket price range: $25-$80
Related Codes That Often Appear With This One
- P0340 — If P0340 (Bank 1) appears with P0345, it strongly suggests a problem common to both sensors, such as a major wiring harness fault, electrical noise from a failing alternator, or a significant timing chain issue.
- P0300 — A random misfire code (P0300) or cylinder-specific misfire codes (P0301-P0306) can occur because the PCM cannot properly time ignition events without a reliable cam signal.
- P0335 — This code for the Crankshaft Position Sensor can appear if the PCM is having trouble correlating the (faulty) cam signal with the crank signal.
Platform-Specific Known Issues
- A user on YouTube demonstrated that on the rear bank (Bank 1), a wiring harness bracket held by a 12mm bolt can get in the way of removing the sensor, and removing this bracket first makes the job much easier. 🎬 Watch this walkthrough of the Mazda 6 sensor replacement process. While this is for Bank 1, a similar obstruction may exist for Bank 2.
- Forum discussions suggest that issues are more likely to appear in damp or humid weather when the root cause is a wiring or connector problem.
Mechanic-Grade Diagnostic Values
- Alternator AC Voltage Ripple — expected: Less than 0.5 Volts AC. Failure: A reading greater than 0.5V AC at the battery terminals with the engine running indicates the alternator is producing excessive electrical noise, which can interfere with the camshaft position sensor signal.
- CMP Sensor Connector Pins (KOEO) — expected: The 3-wire sensor should have one pin with reference voltage (typically 5V), one pin with a good ground (near 0V), and a signal wire.. Failure: Absence of reference voltage or ground points to a wiring or PCM issue. An inconsistent or missing signal voltage when cranking points to a bad sensor.
Scan Tool Commands That Help
- High-End OBD2 Scanner: Cam Sensor Relearn / Crankshaft Position Variation Relearn — On some vehicles, after replacing a cam or crank sensor, the PCM needs to relearn the new sensor's signal pattern. If the car runs poorly or won't start after sensor replacement, check if a relearn procedure is required. This is not consistently reported as necessary for this specific Mazda, but it is a possibility.
Wiring & Ground Locations
- Bank 2 CMP Sensor — On the front valve cover, which is the cylinder bank closer to the radiator and front of the vehicle.. This is the specific sensor monitored by the P0345 code. Correctly identifying it prevents replacing the wrong sensor (Bank 1 is near the firewall).
- G15 (Ground Point) — On the left rear of the engine for the 3.0L model.. A poor engine ground can cause floating voltages and erratic sensor readings. This is a key ground point for multiple engine sensors, and ensuring it is clean and tight is a critical diagnostic step.
- CMP Sensor Wires — In the connector pigtail for the Bank 2 sensor.. The sensor is a 3-wire Hall effect type. The wires are typically: 1) Reference Voltage (e.g., 5V from PCM), 2) Ground (provided by PCM), and 3) Signal (sends square wave back to PCM). A break or short in any of these three wires will cause a circuit malfunction code.
- PCM (Powertrain Control Module) — Located behind the left side of the dashboard.. All sensor wiring terminates here. While rarely the cause, a PCM failure is the last step in diagnosis after wiring and sensors have been ruled out.
Real Owner Repair Stories
- mazda6club.com forum user 'Chanzm' (2004 Mazda 6 3.0L) — Tachometer went crazy, car died and had to be limped home. Codes P0340 and P0345 present. After restart, tach is at zero until revved.
❌ Tried (didn't work) Replaced both camshaft position sensors (car started, idled for a minute, then died with same codes)., Replaced the crankshaft position sensor.
✅ What actually fixed it The user performed a full timing job, replacing chains, guides, and tensioners. Although the user was still questioning a potential wiring issue post-repair, the implication is the root cause was a mechanical timing problem that replacing sensors alone could not fix. - 2CarPros.com forum user (2004 Mazda 6 3.0L) — Intermittent jumping/bucking, Check Engine and Traction Control lights on. Codes P0340 and P0345. Symptoms started after a spark plug change and were worse in damp weather.
❌ Tried (didn't work) Replaced both camshaft position sensors., Replaced one ignition coil.
✅ What actually fixed it The responding expert diagnosed this as a likely wiring or connector issue, not a sensor failure. The problem starting after other engine work (spark plugs) and being sensitive to humidity strongly pointed to a damaged harness or a corroded, loose connector that was disturbed during the prior repair. - 2CarPros.com forum user 'JOSIHAS' (2004 Mazda 6 3.0L V6, 140,000 miles) — Codes P0340 and P0345. Tachometer stays at 0 RPM on startup until the engine is revved past 2300 RPM. Traction control light also on.
❌ Tried (didn't work) Replaced both camshaft position sensors., Replaced the PCM.
✅ What actually fixed it The user had not found the fix, but the responding mechanic advised that the problem was almost certainly not the PCM, but rather an open/short in the wiring, a poor connection due to corrosion, or a weak battery. This story is a classic example of misdiagnosis by replacing expensive components before thoroughly checking the circuit.
"I Checked Everything" — The Actual Cause
- While not a smoke test issue, a common pattern is replacing the P0345 sensor with no resolution. A frequently missed cause in this scenario is a failing alternator. The alternator can pass a standard charging test but still produce excessive AC voltage 'ripple' or electrical noise that interferes with the sensitive Hall effect camshaft sensor, causing the PCM to see a corrupt signal and set a circuit fault code. This can be diagnosed with a multimeter set to AC volts across the battery terminals while the engine is running.
When the Usual Fixes Don't Work
- In several documented cases, owners replaced the Bank 2 camshaft sensor (and often the Bank 1 sensor as well) to fix P0345, only for the code to return immediately or intermittently. One owner on mazda6club.com went through replacing both cam sensors and the crank sensor before the problem was ultimately resolved with a full timing chain service, indicating the initial sensor code was a symptom of mechanical timing being out of sync. Another case, where codes appeared after a spark plug change, was traced to a wiring harness issue that was likely created during the previous repair, highlighting that the sensor itself was not the root cause.
OEM Part Supersession History
AJ5818230→AJ58-18-230A— Standard part revision by the manufacturer.
Heads up: The new part number is a direct replacement for the old one. The Ford equivalent part number is 1F1Z6B288AA. The sensors for Bank 1 and Bank 2 are identical and 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:
- Pre-Catalytic Converter Failure 🔴 High — Common at higher mileage (over 100k miles). The ceramic honeycomb material can break apart and be ingested back into the engine, causing catastrophic engine failure.
- Automatic Transmission (Jatco JF506E) Shift Problems 🟠 Medium — Fairly common, especially on earlier models. Can manifest as harsh shifts, slipping, or failure to shift. Sometimes related to shift solenoids or the TCM. (Ref: Mazda issued TCM software updates which sometimes helped with minor issues.)
- Engine Overheating due to Cooling Fan Module Failure 🟠 Medium — A widely reported issue where the cooling fan control module fails, causing the fans to stop working and the engine to overheat, especially in traffic.
- Ticking Noise from Valve Lash Adjusters 🟡 Low — Commonly reported, often attributed to infrequent oil changes or using incorrect oil viscosity. Can be an annoyance but doesn't typically lead to major failure if oil service is corrected.
- Oil Pan and Valve Cover Gasket Leaks 🟡 Low → Shop Engine Valve Cover — Common oil leaks for this engine as it ages. The valve cover gasket leak is particularly relevant as it can contaminate the camshaft position sensor.
Used vs. New Parts: Buying Guide for This Vehicle
When a used part is the smart pick: For this specific repair, buying a used camshaft position sensor from a junkyard is not recommended. The part is an electronic sensor that degrades with heat and age, and its remaining lifespan is unknown. Given the relatively low cost of a new aftermarket part, a new sensor is a much smarter investment.
Donor-vehicle mileage cap: roughly under 150000 miles for the part to have meaningful remaining life.
What to inspect on the donor part:
- If buying used is unavoidable, look for a donor vehicle with the lowest possible mileage.
- Inspect the sensor's plastic housing for any cracks, melting, or physical damage.
- Check the electrical connector pins for any signs of corrosion or oil contamination.
OEM-only on this vehicle (don't cheap out):
- While not strictly 'OEM-only', engine sensors are a component where paying for a quality part prevents future headaches. Cheap, unbranded sensors have a high failure rate.
Aftermarket brands forum-validated for this vehicle:
- Motorcraft (Ford OEM equivalent)
- Hitachi
- Denso
- NGK/NTK
- Bosch
- Standard Motor Products (SMP)
Brands owners have reported issues with on this vehicle:
- Unbranded, no-name sensors from online marketplaces should be avoided, as their quality control is often poor and can lead to the code returning quickly.
Real Owner Stories
Aggregated from forums and TSBs cited above. Mileages and costs reflect what owners reported in those sources.
2004 Mazda 6 3.0L V6
Symptoms: The vehicle experienced a 'crazy' tachometer and stalling issues.
What fixed it: After replacing sensors did not resolve the issue, a full timing job was required.
Source hint: mazda6club.com: Thread '04 Mazda 6 3.0 po340/p0345'
2003 Mazda 6 3.0L V6
Symptoms: Intermittent stalling and the P0345 code returned even after the sensor was replaced.
What fixed it: The issue was suspected to be an oil-soaked wiring harness that had been reused after a previous engine failure.
Source hint: CarKiller.com: 'Intermittent Stalling P0345'
2004 Mazda 6 3.0L V6
Symptoms: Codes P0340 and P0345 appearing together, with symptoms worsening in damp weather.
What fixed it: Diagnosis suggested a wiring or connector issue rather than just a sensor failure.
Source hint: 2CarPros.com: '2004 Mazda 6 Codes P0340 and P0345'
Related OBD-II Codes
Frequently Asked Questions
Where is the Bank 2 camshaft position sensor located on my Mazda 6 3.0L V6?
My tachometer stays at zero until I rev the engine; is this related to P0345?
Can I test if the sensor is bad without buying a new one immediately?
Is there a trick to getting the sensor out if the wiring harness is in the way?
Why does my P0345 code seem to get worse when it is raining or humid?
Could an oil leak be causing my P0345 code?
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.
- Mazda 6:
- 🧭 Diagnostic Flowchart
- 🎬 Helpful Videos
- 🛍️ Shop This Part
- What's Unique About the 2003-2008 Mazda 6
- 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
- Wiring & Ground Locations
- Real Owner Repair Stories
- "I Checked Everything" — The Actual Cause
- When the Usual Fixes Don't Work
- OEM Part Supersession History
- Other Known Issues on This Vehicle
- Used vs. New Parts: Buying Guide for This Vehicle
- Real Owner Stories
- 2004 Mazda 6 3.0L V6
- 2003 Mazda 6 3.0L V6
- 2004 Mazda 6 3.0L V6
- Related OBD-II Codes
- Frequently Asked Questions
- 🎟️ Get 5% Off