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 1995-2010 BMW 5 Series: Camshaft Position Sensor Bank 2 Causes and Fixes

P0345 on a BMW 5 Series indicates a fault with a camshaft position sensor. For inline-6 engines (M54, N52), this is the exhaust cam sensor. For V8 engines (M62, N62), it's the intake cam sensor on the driver's side (Bank 2). The most likely cause is a failed sensor, often due to an oil leak from the valve cover gasket. A replacement sensor costs between $40 and $120.

20 minutes to read 1995-2010 BMW 5 Series
Most Likely Cause
Failed Camshaft Position Sensor
Difficulty
2/5
Est. Time
1 hrs
DIY Doable?
✅ Yes
Shop Labor
$100 – $350
Parts Price
$40 – $150
⚠️ Drivable, but... — You can drive, but expect symptoms like hard starting, rough idling, stalling, and reduced power. The engine may enter a reduced-power 'limp mode' which can be a safety risk in traffic. It's best to get it fixed promptly to avoid being stranded or causing secondary issues.
Key Takeaways
  • First, correctly identify your engine (I6 or V8) to know which sensor 'Bank 2' refers to.
  • The most likely cause is a failed sensor, and the most likely reason for failure is a leaking valve cover gasket.
  • The best way to confirm a bad sensor is to swap it with another one and see if the code follows the part.
  • Always inspect for and repair oil leaks when replacing the sensor to prevent the new part from failing prematurely.
  • Use a quality OEM-supplier part like VDO, Bosch, or Continental for best results.
The trouble code P0345 stands for 'Camshaft Position Sensor 'A' Circuit Malfunction (Bank 2)'. This means the engine control module (DME) has detected an incorrect, intermittent, or missing signal from a specific camshaft position sensor. The sensor's location depends on your engine. On inline-6 engines (M54, N52), 'Bank 2' is BMW's designation for the exhaust camshaft. On V8 engines (M62, N62), 'Bank 2' is the driver's side cylinder bank (cylinders 5-8), and the 'A' sensor is the intake camshaft sensor for that bank. This Hall effect sensor provides a critical square wave voltage signal to the DME, which is essential for controlling sequential fuel injection, ignition timing, and the VANOS variable valve timing system.

What's Unique About the 1995-2010 BMW 5 Series

The key challenge with P0345 on a BMW 5 Series from this era is that 'Bank 2' means two different things. On the popular inline-6 engines (like the M54 and N52), it points to the exhaust camshaft sensor. On V8 engines (M62, N62), it points to the intake sensor on the driver's side bank. Misinterpreting this is the most common diagnostic mistake. Furthermore, these sensors are highly susceptible to failure from oil leaks, a very common issue on E39 and E60 models, where a leaking valve cover gasket drips oil directly onto the sensor and its connector, causing the plastic and wiring to degrade.

Generation note: This range covers the E39 (1995-2003) and E60/E61 (2003-2010) generations. The engine is the primary differentiator. E39 models used M52, M54 (I6), and M62 (V8) engines. E60 models used the M54 initially, then transitioned to the N52 (I6) and N62 (V8) engines. The meaning of P0345 (exhaust vs. intake sensor) and the part's physical location vary significantly between these engine families.

Symptoms You May Notice

  • Check Engine Light is on
  • Engine is difficult to start or has long crank times
  • Engine cranks but does not start
  • Rough idle, sometimes stalling
  • Hesitation and reduced engine power
  • Noticeably worse fuel economy
  • Engine enters 'limp mode' with reduced power
⚠️ Don't Waste Money on the Wrong Fix
  • Replacing the wrong sensor (e.g., replacing the Bank 1 sensor instead of Bank 2, or replacing the intake sensor on an I6 when the code is for the exhaust sensor).
  • Replacing the crankshaft position sensor instead of the camshaft position sensor.
  • Replacing the sensor without fixing the oil leak that caused it to fail, leading to a repeat failure.
  • Assuming the sensor is bad when the actual fault lies with a dirty or failed VANOS solenoid.

Most Likely Causes

  1. Failed Camshaft Position Sensor 🔴 High Probability → Shop Engine Camshaft Position Sensor The sensors on these engines are a common failure item. Failure is frequently accelerated by oil leaking from the valve cover gasket, which contaminates the sensor's plastic housing and electrical connector, causing it to degrade and fail. Aftermarket sensors are also known to have a high failure rate, so using an OEM/OES part from brands like VDO is highly recommended.
    How to confirm: Swap the suspect sensor with an identical one from another position (e.g., swap the Bank 2 intake and exhaust sensors on a V8, or the Bank 1 and Bank 2 sensors on an I6). Clear the codes. If the code changes to follow the sensor (e.g., to P0340 for Bank 1), the sensor is faulty.
    Typical fix: Replace the failed camshaft position sensor and its O-ring. It is critical to fix the oil leak that caused the failure, typically by replacing the valve cover gasket. Use an OEM/OES sensor for best results.
    Est. part cost: $40-$120
  2. Damaged Wiring or Connector 🟡 Medium Probability As with the sensor itself, the wiring harness connector can become brittle and fail due to engine heat and oil contamination from common valve cover gasket leaks. Wires can fray or the plastic connector can crack.
    How to confirm: Visually inspect the sensor's connector for oil saturation, corrosion, or cracked plastic. Wiggle the connector with the engine running to see if it affects idle. Use a multimeter to test for a 5V or 12V reference signal (depending on engine) and continuity to the DME.
    Typical fix: Clean the oil from the connector with electrical contact cleaner. If the connector or wiring is damaged, a new pigtail connector will need to be spliced in.
    Est. part cost: $10-$50 for a new pigtail connector
  3. Dirty or Failing VANOS Solenoid ⚪ Low Probability The VANOS system uses oil pressure to adjust camshaft timing. Sludge from infrequent oil changes can cause the solenoids to become sticky or fail, leading to timing correlation errors that can be misread as a sensor fault.
    How to confirm: This fault often appears with VANOS-specific codes (like BMW code 2A87 for the exhaust VANOS). A diagnostic test is to remove, clean, and swap the Bank 1 and Bank 2 VANOS solenoids. If the fault code moves to the other bank, the solenoid is the issue.
    Typical fix: Remove and clean the VANOS solenoid with brake cleaner or a similar solvent. 🎬 See how to properly clean your N52 VANOS solenoids. If cleaning does not resolve the issue, replace the solenoid. It's often recommended to replace both solenoids at the same time.
    Est. part cost: $100-$200

Rare But Worth Checking

  • Stretched Timing Chain or Failed Guides: → Shop Engine Timing Chain While rare, if the sensor and wiring are confirmed good, a significant deviation in cam/crank correlation could point to a physical timing issue. This is a much more involved and expensive repair, more common on high-mileage V8 (M62) engines with plastic guide degradation.
  • Faulty Engine Control Module (DME): This is extremely rare. The DME should only be considered a potential cause after all other possibilities (sensor, wiring, timing) have been exhaustively ruled out.

Diagnosis Steps

  1. Read the code with a BMW-capable OBD-II scanner and note any other codes present, especially VANOS or timing correlation codes (e.g., 2A87, 2A99).
  2. Identify your engine (Inline-6 or V8) to determine which sensor P0345 refers to (I6=Exhaust, V8=Intake Bank 2).
  3. Locate the correct sensor. Inspect the sensor and its electrical connector for oil contamination, corrosion, or physical damage. A common cause is a leaking valve cover gasket dripping oil onto the sensor.
  4. Diagnostic Swap: If possible, swap the suspect sensor with an identical sensor from another position (e.g., swap intake and exhaust sensors on the same bank). Clear the codes and run the engine. If the code follows the sensor (e.g., changes to P0340), the sensor is bad. This is the most definitive DIY test.
  5. If the code does not move, inspect the wiring harness. Unplug the connector and check for oil inside. Test for the correct reference voltage (usually 5V or 12V) and ground at the connector. Check for continuity on the signal wire back to the DME.
  6. If wiring and sensor are good, investigate related components. If you have VANOS codes like 2A87, remove, clean, and test the VANOS solenoids. Consider swapping them to see if the fault moves.
  7. If all else fails, the issue may be mechanical (timing chain, VANOS gear) or a fault in the DME, which may require professional diagnosis.

Parts You'll Likely Need

  • Camshaft Position Sensor (Bank 2) (OEM #13627525014 (N52 Exhaust), 12147539165 (M54 Exhaust) 🎬 Watch: Step-by-step M54 exhaust camshaft sensor replacement guide., 12147518628 (N62 Intake)) — This is the most common part to fail and directly cause the P0345 code.
    Trusted brands: VDO (OEM), Continental (OEM), Bosch, Delphi
    OEM price range: $80-$150
    Aftermarket price range: $40-$90
  • Valve Cover Gasket Set (OEM #Varies by engine (e.g., 11127581215 for N52)) 🎬 Watch: How to replace the valve cover gasket on N52 engines. — Frequently required to fix the underlying oil leak that causes the sensor to fail. Replacing the sensor without the gasket is a temporary fix.
    Trusted brands: Elring, Victor Reinz, Corteco
    OEM price range: $60-$120
    Aftermarket price range: $30-$70
  • VANOS Solenoid (OEM #11367585425 (Common for N52/N54/N62)) — A potential cause if P0345 is accompanied by VANOS-specific codes like 2A87. Often can be cleaned, but replacement may be necessary.
    Trusted brands: BMW (OEM), Pierburg
    OEM price range: $120-$180
    Aftermarket price range: $50-$100

Related Codes That Often Appear With This One

  • P0340 — Camshaft Position Sensor 'A' Circuit (Bank 1). Seeing this code after swapping sensors during diagnosis confirms the original sensor was faulty. If seen together with P0345 initially, it could point to a systemic issue like low oil pressure or a timing problem.
  • P0015 / 2A87 — 'B' Camshaft Position - Timing Over-Retarded (Bank 1) or BMW-specific 'Exhaust VANOS, mechanism'. These codes strongly suggest the root cause may be a faulty VANOS solenoid on the exhaust side (Bank 2 on I6), not the sensor itself.
  • P0300, P0305, P0306, P0307, P0308 — Random or specific cylinder misfires on Bank 2. Incorrect camshaft timing data can cause the DME to trigger improper ignition or fuel injection, leading to misfires on the affected bank.

Technical Service Bulletins (TSBs) & Recalls

  • While no TSB directly for P0345 was found, BMW SIB 12 13 05 addresses issues with camshaft sensors on N62 engines, advising on correct diagnosis to avoid unnecessarily replacing sensors when the fault may lie elsewhere (like VANOS actuators).

Platform-Specific Known Issues

  • On M54 engines, the exhaust camshaft sensor is located on the front-passenger side of the engine and is relatively easy to access with a 5mm Allen wrench. Be sure to replace the small O-ring on the sensor.
  • On N52 engines, the exhaust sensor is also on the front-passenger side, but the bolt is often an E8 External Torx socket. Access is straightforward after removing the engine cover.
  • On N62 V8 engines, the Bank 2 intake sensor is on the driver's side cylinder head, toward

Mechanic-Grade Diagnostic Values

  • Sensor Signal Voltage (3-wire Hall Effect Sensor) — expected: Should fluctuate between 0V and 5V as the engine is rotated by hand.. Failure: Voltage stays constant at 0V or 5V while the engine is rotated, indicating a faulty sensor.
  • Sensor Reference Voltage (at connector, Key-On Engine-Off) — expected: Approximately 5V or 12V, depending on the specific engine model (Pin 3 on many models).. Failure: No voltage or significantly low voltage suggests a wiring issue or a problem with the DME's power supply.
  • Sensor Resistance (2-wire inductive sensor, less common on these models) — expected: Typically between 200 to 900 Ohms, but can vary.. Failure: A reading outside the specified range for the vehicle model indicates a faulty sensor.

Hidden / Shadow Codes Worth Checking

  • 2A87: Exhaust VANOS, mechanism. This is a BMW-specific code that points to a jamming or mechanical issue with the exhaust VANOS solenoid. Its presence alongside P0345 strongly suggests the root cause is the VANOS system, not the sensor. (see via BMW-specific diagnostic software like ISTA or INPA, or high-end professional scan tools.)
  • 2A99: Crankshaft - Exhaust Camshaft, Correlation. This BMW-specific code indicates the DME has detected a timing mismatch between the crankshaft and the exhaust camshaft. While a bad sensor can cause this, it also points towards a stretched timing chain or VANOS problem. (see via BMW-specific diagnostic software like ISTA or INPA, or high-end professional scan tools.)
  • 2A9B: Exhaust camshaft sensor signal invalid for synchronization. This is another BMW-specific code that directly points to an issue with the signal from the sensor P0345 is reporting, often logged before the generic P-code appears. (see via BMW-specific diagnostic software like ISTA or INPA.)

Scan Tool Commands That Help

  • ISTA (Rheingold): VANOS Test Plan — When P0345 is present with VANOS-related shadow codes like 2A87. The test plan will actuate the solenoids and measure the camshaft's response time, confirming if the solenoid is slow, stuck, or if there is an oil pressure problem.
  • INPA / ISTA: Clear Adaptations (Engine) — After replacing a camshaft sensor or VANOS solenoid. Resetting the engine's learned values for camshaft timing allows the DME to quickly adapt to the new component's performance and can resolve rough running that persists after the repair.

Wiring & Ground Locations

  • Main Engine Ground Strap — On E60 models, typically connects from the passenger side (right side) engine mount area to the chassis. On some 3-series of the same era, it's on the driver's side.. This braided strap is notorious for corroding and breaking. A poor engine ground can cause a host of electrical gremlins, including erratic signals from sensitive sensors like the camshaft position sensor, leading to false codes. If you have a no-crank or slow-crank symptom along with P0345, this is a primary suspect.
  • DME Connector (X6000x) — The DME is located in the electronics box (E-box) in the engine bay, typically on the passenger side under the cabin air filter housing.. This is the termination point for the camshaft sensor wiring. When checking for continuity or shorts in the sensor harness, you will test the pins from the sensor connector back to the corresponding pins on the DME connector.
  • N52 Valve Cover Ground — On N52 engines with the magnesium valve cover, there is a small ground strap (interference suppression band) that connects from the valve cover to a stud on the chassis.. While primarily for radio interference, a missing or disconnected ground near the sensor can potentially introduce electrical noise that may affect sensor readings.

Real Owner Repair Stories

  • 5Post.com forum user (2008 BMW 535xi (E60)) — Engine won't crank, no start.
    ❌ Tried (didn't work) Replacing the battery, Replacing the starter, Checking the IBS (Intelligent Battery Sensor)
    ✅ What actually fixed it The main engine ground strap from the right side engine mount to the body was completely corroded. Temporarily grounding the engine block to the chassis allowed the car to crank, confirming the bad ground. Replacing the braided ground strap was the permanent fix.
  • Bimmerfest forum user (2006 BMW 330i (E90 with N52 engine)) — Multiple VANOS and correlation codes (2A82, 2A98, 2A99) appearing as shadow codes, rough idle.
    ❌ Tried (didn't work) Cleaning the VANOS solenoids.
    ✅ What actually fixed it The user was chasing multiple codes that moved between intake and exhaust when swapping solenoids. The final fix was replacing both VANOS solenoids with new Pierburg units, which resolved all the codes, including the correlation faults that can trigger P0345.

OEM Part Supersession History

  • 1362755851813627525014 — Part consolidation and potential design revision by BMW.
    Heads up: The newer part number 13627525014 is generally backward compatible, replacing the older numbers. However, always use a VIN lookup to confirm the correct part for a specific vehicle.
  • 1362754666013627525014 — Part consolidation and potential design revision by BMW.
    Heads up: Similar to the above, 13627525014 is the current replacement for this older part number.

Model Year Variations Within This Range

  • 1999-2006 (M54 Engine): The M54 engine uses different part numbers for its intake and exhaust camshaft sensors, and they are not interchangeable. The VANOS system is also an earlier, less complex design compared to the N52.
  • 2006-2010 (N52 Engine): The N52 engine uses the same part number for both the intake and exhaust camshaft position sensors, making the diagnostic swap (swapping intake and exhaust sensors) possible and straightforward. The N52 also features a more advanced Valvetronic and VANOS system, making it more sensitive to oil quality and VANOS solenoid health.

Diagnostic Flowchart

Other Known Issues on This Vehicle

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

  • Cooling System Failure (E39/E60) 🔴 High — Very common after 60,000-80,000 miles. Affects plastic components like the expansion tank, radiator necks, thermostat housing, and water pump.
  • VANOS Seal Degradation (M52TU/M54) 🟠 Medium — Extremely common. Original Buna-N seals harden and fail, causing loss of low-RPM torque, rough cold idle, and rattling.
  • N62 V8 Valve Stem Seal Failure 🔴 High — Very common on N62 engines after 70,000 miles, causing significant oil consumption and blue smoke from the exhaust, especially after idling.
  • E60 iDrive CCC Unit Failure 🟠 Medium — Common on pre-LCI (2004-2007) E60 models. Symptoms include the screen freezing, rebooting, or going blank. Can also cause battery drain.
  • Oil Leaks (Valve Cover, Oil Filter Housing, Oil Pan Gaskets) 🟠 Medium — Chronic issue across all engines (M54, N52, N62). Gaskets become hard and brittle, leading to persistent oil leaks.
  • E39 Instrument Cluster Pixel Failure 🟡 Low — Almost guaranteed on high-mileage E39s. The ribbon cable fails, causing pixels on the instrument cluster and radio display to disappear.
  • Suspension Thrust Arm Bushing Wear 🟠 Medium — Common on E39 models around 75,000 miles. Worn bushings cause steering wheel shimmy and vibration under braking.

Used vs. New Parts: Buying Guide for This Vehicle

When a used part is the smart pick: For this repair, buying a used camshaft position sensor or VANOS solenoid is generally not recommended. These are relatively inexpensive electronic components that degrade with heat and time. A used part has an unknown history and may fail quickly. A used valve cover or engine wiring harness from a low-mileage donor could be a cost-effective option if the original is physically damaged.

Donor-vehicle mileage cap: roughly under 60000 miles for the part to have meaningful remaining life.

What to inspect on the donor part:

  • For a wiring harness, check for any signs of brittleness, cracking on connectors, or previous repairs (splices).
  • For a valve cover, ensure there are no visible cracks, especially around the bolt holes and PCV valve area.
  • Verify the donor vehicle was not involved in a front-end collision or engine fire.

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

  • Camshaft Position Sensor
  • Crankshaft Position Sensor

Aftermarket brands forum-validated for this vehicle:

  • VDO (often the original OEM supplier)
  • Continental (also an OEM supplier)
  • Pierburg (for VANOS solenoids)
  • Bosch
  • Elring (for gaskets)
  • Victor Reinz (for gaskets)

Brands owners have reported issues with on this vehicle:

  • Unbranded, 'no-name' sensors from online marketplaces are frequently cited in forums as being dead-on-arrival or failing within a few months.
  • Some forum users have reported issues with brands like Delphi for this specific sensor application on BMWs.

Real Owner Stories

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

2006-2010 BMW E60 530i N52

Symptoms: The vehicle experienced a rough idle along with the Check Engine Light and code P0345.

What fixed it: Replacing the exhaust camshaft position sensor (part #13627525014) resolved the issue.

Source hint: 5series.net thread title: 'Camshaft sensor error P0345'

1999-2006 BMW 5 Series M54 — ~100000 miles

Symptoms: The owner noted the sensor failed due to oil contamination from a leaking valve cover gasket.

What fixed it: Replacing the failed camshaft position sensor and its O-ring, and replacing the valve cover gasket to stop the oil leak.

Source hint: Bimmerforums / Bimmerfest forum citations

Frequently Asked Questions

Does BMW SIB 12 13 05 apply to my N62 V8 engine when diagnosing P0345?
Yes. SIB 12 13 05 specifically addresses camshaft sensor issues on N62 engines. It advises technicians to perform a correct diagnosis to ensure the fault isn't actually caused by VANOS actuators before unnecessarily replacing the sensors.
Which sensor should I replace on my 5 Series if I have a P0345 code?
It depends on your engine. On Inline-6 engines (M54, N52), P0345 refers to the exhaust camshaft position sensor. On N62 V8 engines, it refers to the Bank 2 (driver's side) intake camshaft sensor.
Can a leaking valve cover gasket cause the P0345 code on my E60?
Yes. Oil leaking from the valve cover gasket frequently contaminates the sensor's plastic housing and electrical connector, causing the sensor to degrade and fail. It is critical to fix the leak when replacing the sensor.
Should I use an aftermarket sensor to fix the P0345 fault?
It is highly recommended to use an OEM/OES part from brands like VDO. Aftermarket sensors for these engines are known to have a high failure rate.
Is there a way to test if the sensor is actually bad before I buy a new one?
Yes, you can perform a diagnostic swap. Move the suspect sensor to a different position (e.g., swap Bank 1 and Bank 2 sensors). If the code changes (e.g., to P0340), the sensor is faulty.
Can dirty oil cause a P0345 code on a BMW 5 Series?
Yes. Sludge from infrequent oil changes can cause VANOS solenoids to become sticky, leading to timing correlation errors that the computer may misread as a camshaft sensor fault.
EXHAUST CAMSHAFT POSITION SENSOR REPLACEMENT LOCATION BMW E60 E61
EXHAUST CAMSHAFT POSITION SENSOR REPLACEMENT LOCATION BMW E60 E61
BMW EXHAUST CAMSHAFT POSITION SENSOR REPLACEMENT LOCATION N51 N52 N53 N54 N55 E90 E60 X3 X5 E83 E70
BMW EXHAUST CAMSHAFT POSITION SENSOR REPLACEMENT LOCATION N51 N52 N53 N54 N55 E90 E60 X3 X5 E83 E70
⚙️ [BMW E46/E39 M54] Camshaft Position Sensor Replacement
⚙️ [BMW E46/E39 M54] Camshaft Position Sensor Replacement
How to replace the Camshaft Position Sensor on a 2001 BMW E39 525i/530i
How to replace the Camshaft Position Sensor on a 2001 BMW E39 525i/530i
BMW Exhaust Camshaft Position Sensor DIY M54
BMW Exhaust Camshaft Position Sensor DIY M54
How to clean Fix VANOS Solenoids BMW N52/N54 Rough idling ISTA Reset
How to clean Fix VANOS Solenoids BMW N52/N54 Rough idling ISTA Reset
How to Clean Your Vanos Solenoids N52 motor
How to Clean Your Vanos Solenoids N52 motor
BMW N52/N54 Vanos Solenoid DIY
BMW N52/N54 Vanos Solenoid DIY
BMW E60 Valve Cover Gasket Replacement 2008-2010 N52 Engine Part1
BMW E60 Valve Cover Gasket Replacement 2008-2010 N52 Engine Part1
BMW Valve Cover Oil Leak Drama And Fix E36 E46 E90 E39 E60 E53
BMW Valve Cover Oil Leak Drama And Fix E36 E46 E90 E39 E60 E53
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 for:
  • BMW 5 Series: 1995199619971998199920002001200220032004200520062007200820092010
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