P0340 – Camshaft position (CMP) sensor A, bank 1 circuit malfunction (BMW)

Avatar photo
By Reinier (Contact Me)
Last Updated 2021-11-02
Automobile Repair Shop Owner
CodeFault LocationProbable Cause
P0340 Camshaft position (CMP) sensor A, bank 1 circuit malfunction
(Buy Part On Amazon)
Wiring, CMP sensor, ECM

Where is the Camshaft position sensor? See our guide to the Camshaft position sensor – what it does, where it sits on the engine and how it fails.

We recommend Torque Pro

Table of Contents

  1. What Does Code P0340 Mean?
  2. Where is the P0340 sensor located?
  3. What are the common causes of code P0340?
  4. What are the symptoms of code P0340?
  5. Get Help with P0340

What Does Code P0340 Mean?

SPECIAL NOTES: Although generic OBD II trouble codes such as P0340 – “Camshaft position (CMP) sensor A, bank 1 – circuit malfunction” can, and do affect all OBD II compliant vehicles, some vehicle makes and models are sometimes more susceptible to some generic trouble codes than most other vehicle makes and models. Under real-world driving and operating conditions, there are several reasons for some generic trouble codes to be more common on some vehicles than on others, so this article will discuss generic trouble code P0340 – “Camshaft position (CMP) sensor A, bank 1 – circuit malfunction” as it applies to the BMW models that are most commonly affected by it. END OF SPECIAL NOTES.

OBD II fault code P0340 is a generic code that is defined as, “Camshaft position (CMP) sensor A, bank 1 – circuit malfunction”, and is set when the PCM (Powertrain Control Module) detects an abnormal voltage or current in one or more of the electrical circuits that are associated with the camshaft position sensor on Bank 1. Note that “Bank 1” refers to the bank of cylinders on V-type engines that contains cylinder #1. However, in cases where the affected BMW engine has an inline cylinder configuration, the “Bank 1” part of the definition does not apply, and it can therefore be safely ignored.

NOTE #1: Note that in the context of how code P0340 applies to BMW applications, “Sensor A” refers to the position sensor on the intake camshaft.

NOTE #2: On BMW applications, the PCM (Powertrain Control Module) is known as the DME (Digital Motor Electronics). Despite the difference in names, the DME on BMW vehicles performs the same functions as the PCM does on other vehicles.

For any modern BMW engine to perform at its peak, the engine and fuel management systems need to exert extremely fine control over several crucially important subsystems. These include, but are not limited to the ignition timing, fuel injection timing, fuel rail pressure, and fuel injector duty cycles, also known as injector pulse widths.

In the context of engine control, the PCM uses input data from the crankshaft position sensor to calculate the position of piston #1, and input data from the intake camshaft position sensor on bank 1 to calculate the precise moment to both inject fuel and deliver an ignition spark to cylinder #1 upon engine start-up. Moreover, the correlation between the positions of piston #1 and the intake camshaft on both cylinder banks* is the single most important parameter the DME uses to control both the fuel delivery and ignition systems. Therefore, the DME monitors this particular correlation continually to ensure the smooth and efficient operation of the engine throughout the engine’s operating range.

* Inline engines only have a single bank of cylinders, but the correlation between crankshaft and camshaft positions remains critically important.

However, on BMW engines that are fitted with VANOS (Variable Valve Timing) systems, the DME also uses input data from the camshaft position sensor to confirm and verify that commanded changes to the valve timing (through rotating the camshaft relative to a fixed reference point) had been executed.

In practice, the rotation of the camshaft to advance or retard the valve timing changes the correlation between the crankshaft and camshaft(s), but in a fully functional engine management system, these changes are recognized and accounted for by the DME. Therefore, the altered camshaft/crankshaft correlation is used by the DME to calculate appropriate ignition timing and fuel delivery strategies to maintain the engine’s performance at peak levels throughout the engine’s operating range.

However, all of the above assumes that the DME is receiving accurate, plausible, and valid input data from the camshaft position sensor on bank 1. Thus, when a fault, defect, or malfunction occurs either in the camshaft position sensor on bank 1, or in the control and/or signal circuits of the camshaft position sensor, the DME might receive implausible, invalid, or inaccurate input data, and depending on the nature of the problem, the DME might receive no input data at all.

When this happens, the DME will recognize that it cannot control the ignition and fuel delivery systems effectively, and it will set code P0340, and illuminate a warning light as a result.

What causes code P0340 to set on BMW applications?

While camshaft position sensors on most BMW applications can and do fail, it should be noted that code P0340 specifically refers to problems, failures, and defects in the sensors’ electrical control and/or signal circuits. Put differently, this means that code P0340 indicates a wiring problem, as opposed to a specific problem with the sensor itself.

Nonetheless, OEM-grade BMW camshaft position sensors are not particularly prone to failures and/or malfunctions. In the vast majority of instances of code P0340 on BMW applications, the problem is almost invariably the result of damage caused to the sensors’ wiring harness and/or electrical connector during routine servicing or the performance of unrelated repairs.

This type of damage usually occurs as the result of wiring chafing or rubbing against engine or body parts because the wiring was not properly routed and/or secured after routine servicing or repairs. Be aware, though, that this type of damage may not always be readily apparent during a casual visual inspection of the wiring harness.

See the section on “Causes” for more details on other possible causes of this code on BMW applications. 

Where is the P0340 sensor located?

Engine bay with arrows marking sensor positions around the intake manifold

This image shows the locations of the camshaft position sensors on an E90 BMW engine. In this example, the green arrow indicates the location of the intake camshaft position sensor, while the yellow arrow indicates the exhaust camshaft position sensor.

Note that on other BMW applications, the intake camshaft sensor may be located on the side of the cylinder head, close to the front end of the camshaft.

What are the common causes of code P0340?

Apart from damaged wiring, some other possible causes of code P0340 on BMW applications could include one or more of the following-

  • Abnormally high or low system voltages
  • An open or short circuit in the camshaft position sensor’s control or signal circuit(s)
  • Loose or damaged terminals/pins in the sensor’s connector that cause intermittent open circuits
  • Improperly engaged/locked connector, which can also create intermittent open circuits
  • The use of substandard aftermarket camshaft position sensors; note that this is a fairly common cause of this code on BMW applications because OEM-grade sensors are significantly more expensive than even the most reliable aftermarket sensors
  • In rare cases, this code can be set on BMW applications as the result of defects and malfunctions in the VANOS system; however, these kinds of faults and defects will almost certainly be indicated by one or more BMW-specific VANOS-related fault codes
  • In rare cases, code P0340 can be caused by worn and/or damaged timing chains and chain guides, but note that in these cases, P0340 will be usually (but not always) be accompanied by one or more dedicated camshaft/crankshaft correlation codes
  • One or more blown fuses and/or fusible links
  • A failed pr defective DME, but note that since this is an exceedingly rare event, the fault must be sought elsewhere before any control module is reprogrammed or replaced

What are the symptoms of code P0340?

The most common symptoms of code P0340 on BMW applications are largely similar across all model ranges, and could include one or more of the following-

  • Stored trouble code and an illuminated warning light
  • In some cases, multiple additional codes may be present along with P0340
  • Varying degrees of power loss may be present at some engine speeds and loads
  • In most cases, the engine will run roughly at some engine speeds, or the engine may exhibit misfires at all, or most engine speeds and loads
  • The idling quality may be poor, the idling speed may fluctuate, or the engine may not idle at all
  • A hard-starting condition may be present
  • In rare cases, a no-start condition may be present
  • Fuel consumption may increase noticeably
  • The engine may hesitate or surge severely upon acceleration
  • The engine may stall unexpectedly or repeatedly at low engine speeds or when the vehicle comes to a stop
  • One or more readiness monitors may not initiate, or may not run to completion if they do initiate
  • Since code P0340 on BMW applications is caused by an issue that can affect exhaust emissions negatively, the affected vehicle may not pass a compulsory emissions test

Help Us Help You

Please comment below describing your issue as well as the specifics of your vehicle (make, model, year, miles, and engine). A mechanic reads these, and other owners often recognise the symptoms straight away.

Reading P0340 on your car

A basic adapter will show you P0340, but not the ABS, airbag or transmission modules, and not the bidirectional tests that confirm which part has actually failed rather than which circuit reported it.

Scanners that read all systems on Amazon