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 🛍️ Shop This Part

P0345 on 2005-2015 Nissan Xterra 4.0L: Camshaft Sensor (Bank 2) Causes and Fixes

This code almost always means the driver's side (Bank 2) camshaft position sensor has failed. For a lasting repair, use only a genuine Nissan or Hitachi-branded sensor, preferably the updated version with a metal tip. Consider replacing both the driver's and passenger's side sensors at the same time, and potentially the crankshaft sensor as well. Expect to pay $50-$120 for a quality OEM or Hitachi sensor.

19 minutes to read 2005-2015 Nissan Xterra
Most Likely Cause
Failed Bank 2 (Driver's Side) Camshaft Position Sensor
Difficulty
3/5
Est. Time
1 hrs
DIY Doable?
✅ Yes
Shop Labor
$125 – $400
Parts Price
$50 – $240
⚠️ Drivable, but... — You can drive, but it's not recommended. The engine may stall unexpectedly at any time, including when coming to a stop or at high speeds, which is a significant safety risk. Continued driving can also lead to a no-start condition, especially after the engine is hot and has been shut off, potentially leaving you stranded.
Key Takeaways
  • P0345 on a 4.0L Xterra points directly to a failed camshaft position sensor on the driver's side.
  • Do not use cheap, unbranded sensors. Purchase a genuine Nissan or Hitachi part to avoid having the problem return.
  • It is best practice to replace both the driver's side (angled) and passenger's side (straight) sensors at the same time.
  • The primary symptom is the engine stalling or being difficult to start, especially when warm.
  • The repair is mechanically simple (one bolt per sensor) but difficult due to the tight access against the firewall.
The trouble code P0345 stands for 'Camshaft Position Sensor 'A' Circuit Malfunction (Bank 2)'. The camshaft position sensor tells the engine control module (ECM) the exact rotational position of the camshaft, which is critical for timing the fuel injectors and ignition spark. On the Nissan Xterra's VQ40DE V6 engine, Bank 2 is the driver's side. This code means the ECM has detected an incorrect, intermittent, or missing signal from that specific sensor.

What's Unique About the 2005-2015 Nissan Xterra

Failure of the camshaft position sensors is an extremely common and well-documented issue on the VQ40DE engine used in the 2005-2015 Xterra, Frontier, and Pathfinder. The sensors are located at the back of the engine against the firewall, where high heat contributes to their premature electronic failure. Owner and mechanic experiences overwhelmingly show that using cheap, unbranded aftermarket sensors often leads to a repeat failure in a short time, sometimes within days. For this specific vehicle, using a genuine Nissan or OEM-supplier (Hitachi) part is critical for a successful repair. Some owners report that Nissan updated the original plastic-tipped sensors to a more durable metal-tipped version, which should be used if available.

Symptoms You May Notice

  • Engine stalling, often when hot or slowing to a stop.
  • Hard starting (long crank time) or complete failure to start, particularly after a hot soak.
  • Check Engine Light is on.
  • VDC and/or SLIP warning lights may illuminate.
  • Noticeable loss of engine power and poor acceleration.
  • Rough or uneven idle and engine misfires.
  • Increased fuel consumption.
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the crankshaft position sensor instead of the camshaft sensor.
  • Replacing only one camshaft sensor when both are aged and likely to fail soon.
  • Assuming a timing chain issue when only a single cam sensor code is present.
  • Mistaking Bank 2 (driver's side) for Bank 1 (passenger's side).

Most Likely Causes

  1. Failed Bank 2 (Driver's Side) Camshaft Position Sensor 🔴 High Probability → Shop Engine Camshaft Position Sensor The sensors are located in a high-heat area at the rear of the engine, which causes the internal electronics to fail over time. This is a widely recognized weak point on this engine, with the original parts being particularly susceptible.
    How to confirm: Confirm the code is P0345. Due to the extremely high failure rate of this part and its relatively low cost, the most common diagnostic step is to replace the sensor with a known-good part. An auto parts store employee may misidentify Bank 2 as the passenger side; P0345 is definitively the driver's side.
    Typical fix: Replace the Bank 2 (driver's side) camshaft position sensor. It is highly recommended to also replace the Bank 1 (passenger's side) sensor at the same time, as it has been subjected to the same conditions and is likely to fail soon. Many owners also proactively replace the crankshaft position sensor at the same time.
    Est. part cost: $50-$120
  2. Use of Low-Quality Aftermarket Sensor 🟡 Medium Probability The engine's computer is sensitive to the signal quality from these sensors. Many non-OEM/non-Hitachi sensors provide a signal that is out of spec, causing the code to return shortly after replacement. Some owners have had issues even with reputable aftermarket brands and found success only with genuine Nissan parts.
    How to confirm: Check the brand of the currently installed sensor. If it is not a Nissan or Hitachi part and the P0345 code is present, the sensor itself is the likely culprit. The problem can manifest immediately or within a few weeks or months.
    Typical fix: Replace the aftermarket sensor with a genuine Nissan or Hitachi-branded part. The light may clear on its own after about 100 miles of driving or can be cleared with a scanner.
    Est. part cost: $50-$120
  3. Damaged Wiring or Loose Connector ⚪ Low Probability The wiring harness is in a tight, hot space. Over time, the plastic connector can become brittle and fail to lock securely, or wires can be damaged during other repairs. The locking tab on the connector is a common failure point.
    How to confirm: Visually inspect the sensor's electrical connector for cracks, corrosion, or a loose fit. Wiggle the connector with the engine running to see if it causes a stall or stumble. Check the wiring harness for any signs of chafing or heat damage, especially where it is bracketed near the sensor.
    Typical fix: Repair the damaged section of wire or replace the pigtail connector if the lock is broken. A zip tie can be used as a temporary measure to hold a broken connector in place.
    Est. part cost: $15-$40

Rare But Worth Checking

  • Stretched Primary Timing Chain or Failed Chain Guides: → Shop Engine Timing Chain This is a known but much larger issue on higher-mileage VQ40DE engines. It would almost certainly be accompanied by other codes (like P0340, P0011, P0021) and a distinct whining noise from the front of the engine. If you only have P0345, this is very unlikely to be the cause.
  • Improperly Seated Sensor: A Reddit user shared an experience where a P0345 code persisted after replacing both sensors with OEM parts. The cause was found to be the Bank 1 sensor not being seated and rotated correctly. The sensors are sensitive and must be perfectly aligned and fully seated for proper operation.
  • Low Battery Voltage or Failing Alternator: → Shop Alternator While a weak electrical system can cause various sensor codes, it's not a primary cause for an isolated P0345. If you also have slow cranking and other electrical issues, test the battery and alternator before replacing sensors.

Diagnosis Steps

  1. Confirm the presence of the P0345 code using an OBD-II scanner.
  2. Note any other codes present. If P0340 is also present, plan to replace both sensors.
  3. 🎬 Watch: A complete walkthrough for replacing both camshaft sensors.
  4. Visually inspect the Bank 2 (driver's side) camshaft position sensor, located at the back of the cylinder head against the firewall. It is held in by a single 10mm bolt. Check that the connector is securely plugged in and not cracked.
  5. Inspect the wiring leading to the sensor for any visible damage, melting, or chafing. On the passenger side, a wiring harness bracket held by a 12mm bolt may need to be loosened to provide enough clearance to remove the sensor.
  6. Given the high failure rate, the most practical next step is to replace the sensor with a new, high-quality part (Hitachi or Nissan). The Bank 2 sensor has an angled connector.
  7. Before installing the new sensor, apply a light coat of clean engine oil or O-ring grease to the O-ring to aid installation and ensure a good seal.
  8. Ensure the new sensor is fully seated and clicks into place. An improperly seated sensor can cause the code to persist. A small inspection mirror can be helpful to align the bolt hole.
  9. After replacement, clear the codes with the scanner and perform a test drive to ensure the code does not return. Some sources suggest the code may clear on its own after a certain number of drive cycles or miles.

Parts You'll Likely Need

  • Camshaft Position Sensor (Bank 2, Driver's Side, Angled) (OEM #23731-AL61A) — This is the component that fails most frequently, triggering the P0345 code. The Bank 2 sensor is identifiable by its angled connector body. This part number is superseded by 23731-AL61D. Other cross-referenced part numbers include 23731-7Y000, 23731-AL610, 23731-AL615, 23731-AL616, SU6480, and PC461.
    Trusted brands: Nissan (OEM), Hitachi (OEM supplier, Part #CPS0005)
    OEM price range: $90-$120
    Aftermarket price range: $40-$80
  • Camshaft Position Sensor (Bank 1, Passenger's Side, Straight) (OEM #23731-6J90B) — It is highly recommended to replace both sensors at once, as the other is likely near the end of its service life. The Bank 1 sensor has a straight connector body. 🎬 Watch this guide to fix the Bank 1 P0340 code.
    Trusted brands: Nissan (OEM), Hitachi (OEM supplier, Part #CPS0008)
    OEM price range: $90-$120
    Aftermarket price range: $40-$80

Related Codes That Often Appear With This One

  • P0340 — P0340 is the equivalent code for the Bank 1 (passenger side) camshaft sensor. Since both sensors live in the same harsh environment and have the same lifespan, it's very common for them to fail around the same time, triggering both codes.
  • P0300 — A P0300 (Random/Multiple Cylinder Misfire) can be triggered because the faulty camshaft sensor signal causes incorrect ignition and fuel timing, leading to misfires across multiple cylinders.

Platform-Specific Known Issues

  • The sensors are notoriously difficult to access, especially the Bank 1 (passenger's side) sensor, as they are located on the back of the cylinder heads against the firewall. Many owners find it necessary to climb on top of the engine for better access.
  • It is strongly advised by experienced owners and mechanics to only use genuine Nissan or Hitachi brand sensors. Cheaper aftermarket parts are known to fail quickly or be dead-on-arrival.
  • To gain clearance for the passenger side (Bank 1) sensor, it may be necessary to unbolt a 12mm wiring harness bracket to move the harness out of the way.
  • A small 10mm wrench is often the best tool for the sensor bolt due to the tight clearance.

Mechanic-Grade Diagnostic Values

  • Camshaft Position Sensor Power Supply Voltage — expected: Approximately 5V DC with key on, engine off.. Failure: Voltage below 5V or no voltage indicates a wiring or ECM power supply issue, not necessarily a bad sensor.
  • Camshaft Position Sensor Signal Wire Voltage (Static) — expected: Approximately 4V to 5V DC with key on, engine off, sensor connected.. Failure: No voltage or significantly lower voltage can indicate a short in the wiring or a failed sensor.
  • Camshaft Position Sensor Signal Wire Voltage (Dynamic) — expected: Using a multimeter, voltage should drop to near 0V momentarily when a piece of metal is passed in front of the sensor tip. With an oscilloscope, a clean, repeating digital square wave pattern fluctuating between ~0.5V and ~4.5V should be observed while the engine is running.. Failure: A flat line, a distorted wave, or missing pulses on an oscilloscope indicates a failed sensor or a problem with the reluctor wheel.
  • Camshaft Position Sensor Ground Wire — expected: With the multimeter set to Volts DC, probing the ground pin on the connector and the positive battery terminal should show battery voltage (approx. 12V).. Failure: No or low voltage indicates a bad ground connection for the sensor circuit.

Scan Tool Commands That Help

  • Nissan CONSULT-II / CONSULT-III or equivalent professional scanner: Data Monitor for Engine — Use this to observe the live data stream from the camshaft position sensors (both Bank 1 and Bank 2) and the crankshaft position sensor. A healthy sensor will show a consistent RPM reading that changes with engine speed. A faulty sensor may show 0 RPM, an erratic reading, or a reading that doesn't match the other sensors.
  • cvtz50 App + OBD2 Adapter: Idle/Timing Adjust — While not a direct diagnostic for P0345, some users have used this application to adjust base timing. If timing has been altered, it could potentially cause issues, though it's more likely to be a mechanical timing issue (stretched chain) rather than an electronic one that needs this tool. This is more relevant for idle speed issues after a throttle body service.

Wiring & Ground Locations

  • Bank 2 Camshaft Sensor Connector — Located on the rear of the driver's side cylinder head, against the firewall. The connector is angled.. This is the primary connection point for the sensor. The connector itself can become brittle from heat, and the locking tab can break, leading to a poor connection that mimics a sensor failure.
  • Main Engine Grounds — A main engine ground often runs from the intake manifold to the battery negative terminal, and another from the exhaust side of the cylinder head to the firewall.. While not a direct cause, a poor main engine ground can introduce electrical noise and voltage issues across all sensors, potentially leading to erroneous sensor codes like P0345.

Real Owner Repair Stories

  • Reddit user in r/Xterra (2005 Nissan Xterra) — Engine stalled, OBD scanner showed P0345 for the driver's side camshaft sensor.
    ❌ Tried (didn't work) Replaced both camshaft sensors with parts from Autozone. The P0345 code returned two weeks later.
    ✅ What actually fixed it The user had to replace the aftermarket sensor again, this time with a genuine OEM part from a Nissan dealer. They noted the check engine light went away on its own after about 100 miles of driving.
  • NHTSA ODI #11420324 — An owner reported replacing camshaft position sensors five times using both Auto Zone and Hitachi parts, yet the engine continued to cut out while turning with codes P0340 and P0345 appearing randomly.

OEM Part Supersession History

  • 23731-AL61A23731-AL61D — Standard part revision and update by the manufacturer.
    Heads up: The new part number is a direct replacement. Some owners and vendors note that Nissan uses two functionally identical versions of this sensor: one with a plastic tip and an updated one with a metal tip. Either may be received when ordering the OEM part.

Model Year Variations Within This Range

  • 2009-2015: The Xterra received a facelift for the 2009 model year which included a revised front end, new bumper, and interior updates like new HVAC controls. However, the VQ40DE engine and the associated camshaft position sensors remained the same, so the causes and fixes for P0345 are identical across the entire 2005-2015 generation.

Diagnostic Flowchart

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: For this specific repair, using a used camshaft position sensor from a junkyard is NOT recommended. The part is a known high-failure item due to heat degradation, and a used part has an unknown history and is likely to fail soon, if it works at all. The labor to access the sensor is significant enough that you do not want to repeat the job.

What to inspect on the donor part:

  • Not applicable as used part is not recommended.

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

  • Camshaft Position Sensor

Aftermarket brands forum-validated for this vehicle:

  • Hitachi (OEM supplier)

Brands owners have reported issues with on this vehicle:

  • Unbranded or store-brand (e.g., Duralast from Autozone) sensors are frequently reported by owners to be dead-on-arrival or fail within a very short period, causing the code to return.

Real Owner Stories

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

2012 Nissan Xterra

Symptoms: Vehicle wouldn't start, OBD-II scanner showed code P0345.

What fixed it: After replacing both camshaft sensors and the crankshaft sensor with OEM parts, the issue persisted. The final fix was discovering the Bank 1 sensor was not seated properly; it needed to be rotated slightly to seat correctly, which resolved the no-start condition.

Cost: $1100

Source hint: Reddit r/XTerra - Cautionary tale: xterra wouldn't start, code PO345 camshaft sensor

Nissan Xterra VQ40DE

Symptoms: The vehicle stalled and the P0345 code returned for the driver's side sensor, just two months after replacing it with an aftermarket part.

What fixed it: The problem was resolved by replacing the aftermarket sensor from Autozone with a genuine OEM part from a Nissan dealer.

Source hint: Reddit r/Nissan

Documented NHTSA Reports

NHTSA ODI #10329358

Symptoms: An owner reported that the check engine light came on and the vehicle immediately had trouble with delayed starting.

Findings: The diagnostic code was P0345 Camshaft Position Sensor A Bank 2 Circuit Malfunction.

NHTSA ODI #10510255

Symptoms: A report describes a vehicle where acceleration was very hesitant. Diagnostic codes included P0345 for camshaft position sensor malfunction along with P0430 and a cylinder 3 misfire.

NHTSA ODI #10588192

Symptoms: An owner reported a vehicle accident and subsequently had to replace two camshaft sensors associated with codes P0340 and P0345.

NHTSA ODI #11278728

Symptoms: A report notes a vehicle in motion experienced multiple circuit issues, including P0345 Camshaft Position Sensor A Circuit and P0744 Torque Converter Clutch Solenoid Circuit Intermittent.

Frequently Asked Questions

Which side is Bank 2 on my 2005-2015 Xterra for code P0345? The parts store said it was the passenger side.
P0345 is definitively for the Bank 2 sensor, which is on the driver's side of the engine, located at the back of the cylinder head against the firewall. Auto parts store employees sometimes misidentify this.
I replaced the camshaft sensor on my Xterra, but the P0345 code came back. What did I do wrong?
This is commonly caused by using a low-quality aftermarket sensor. The engine's computer is sensitive to signal quality, and it is strongly recommended to only use genuine Nissan or Hitachi brand sensors to ensure the code does not return.
Since I'm replacing the Bank 2 sensor for P0345, should I replace any other sensors at the same time?
Yes, it is highly recommended to also replace the Bank 1 (passenger's side) sensor, as it has been exposed to the same high-heat conditions and is likely to fail soon. Many owners also proactively replace the crankshaft position sensor as a preventative measure.
My Xterra has a P0345 code and the VDC and SLIP warning lights are also on. Are these issues related?
Yes, it is a common symptom for the VDC and SLIP warning lights to illuminate when a P0345 code is present. The engine fault can cause the vehicle's stability control system to be disabled as a precaution.
What are some tips for accessing the camshaft position sensors on the VQ40DE engine? They seem very hard to reach.
Access is notoriously difficult. Many owners find it necessary to climb on top of the engine. For the passenger side sensor, you may need to unbolt a 12mm wiring harness bracket to get more clearance. A small 10mm wrench is often the best tool for the sensor bolt due to the tight space.
I installed a new OEM sensor, but the code persists. What else could be the problem?
Ensure the sensor is fully seated. One owner reported that even an OEM sensor would not work until it was rotated slightly to seat properly. Also, check that the electrical connector's locking tab isn't broken, causing a loose connection.
After replacing the sensor, do I need a special tool to turn off the Check Engine Light?
You can clear the code immediately with an OBD-II scanner. However, the light may also clear on its own after about 100 miles of driving or a certain number of drive cycles.
How To Replace Cam Position Sensors In A Xterra/Frontier/Pathfinder - For Codes P0340 and P0345
How To Replace Cam Position Sensors In A Xterra/Frontier/Pathfinder - For Codes P0340 and P0345
Camshaft Position Sensor Replacement Nissan 4.0L V6 Xterra, Frontier, Pathfinder
Camshaft Position Sensor Replacement Nissan 4.0L V6 Xterra, Frontier, Pathfinder
How to Replace Drivers Side Camshaft Position Sensor 2005-2021 Nissan Frontier 4.0L V6
How to Replace Drivers Side Camshaft Position Sensor 2005-2021 Nissan Frontier 4.0L V6
How to replace CamShaft Position Sensor on Nissan Xterra 4.0 P0340 FIX
How to replace CamShaft Position Sensor on Nissan Xterra 4.0 P0340 FIX
2005–2015 Nissan Xterra Camshaft Position Sensor Replacement P0340 Fix
2005–2015 Nissan Xterra Camshaft Position Sensor Replacement P0340 Fix
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 P0345 (Deep Dive) for:
  • Nissan Xterra: 20052006200720082009201020112012201320142015
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