P0340: camshaft position sensor circuit

P0340 means the engine computer is not getting a usable signal from the camshaft position sensor. Either the signal is missing altogether or it is arriving erratically. The symptoms people notice are long cranking before it fires, or a stall that clears as soon as you restart. Diagnose soon and drive gently. Indicative UK repair cost is £60 to £350.

The camshaft sensor is how the engine knows which stroke each cylinder is on, and therefore when to fire a coil and when to open an injector. Lose the signal completely and most modern engines will still run, because they can work it out from the crankshaft sensor instead, but they start badly and run with less precision. Lose it intermittently and you get the fault every owner hates: a car that cuts out once a fortnight and behaves impeccably the day it goes to a garage.

Can I drive with P0340?

Diagnose soon, drive gently. The risk with this one is not damage, it is being stranded. A sensor that is dropping out occasionally is on its way to dropping out permanently, and while many engines will limp along without it, a fair number will not start at all. If the car has already stalled on you in traffic, treat it as more pressing than the severity rating suggests, because an engine that cuts out at a junction is a safety problem rather than a mechanical one.

What P0340 means for your MOT

There is no sensor-specific item in the MOT, so there are two routes to a failure and the second depends entirely on how badly your car is behaving.

  • The lamp. A lamp indicating a malfunction is a major defect: section 8.2.1.2 of the DVSA MOT inspection manual for petrol cars first used on or after 1 July 2003, section 8.2.2.2 for diesels first used on or after 1 July 2008.
  • The test not being completable. The emissions check needs the engine running, held at a raised speed, for long enough to take a reading. A car that stalls partway through, or will not start on the day, gives the tester no reading to record, and "emissions test unable to be completed" is listed as a major defect in its own right.

That second point is worth planning around. If the fault is intermittent, booking the MOT and hoping is a poor strategy, because the version of this fault that fails you is the version where nothing can be measured at all.

What usually causes it

  1. A faulty camshaft position sensor. The most likely answer, and the failure pattern is usually thermal: the sensor works perfectly from cold and drops out once the engine bay is up to temperature. That is why the fault so often appears at the end of a journey rather than the start.
  2. A wiring or connector fault. The sensor sits somewhere hot that vibrates constantly. Chafed looms, green corrosion inside the plug and a cracked connector body are all common, and all cheaper to fix than the sensor is to replace.
  3. A timing problem. If the camshaft is not actually where the computer believes it should be, the signal turns up at the wrong moment rather than not at all. That is the overlap with the crank and cam correlation codes, and it is the reason the timing deserves a thought before a sensor is condemned.

What it costs to fix in the UK

£60 to £350. The sensor itself is usually an inexpensive part and on most engines it sits somewhere reachable, which is why the bottom of that range is realistic rather than optimistic. The top is for engines that bury the sensor under an inlet manifold or behind a timing cover, and for the cases where the fault turns out to be in the loom and someone has to trace it properly.

An intermittent electrical fault is the one kind of job where paying for diagnosis genuinely saves money, because the alternative is buying parts in sequence. What a car diagnostic costs in the UK sets out the going rate.

These are indicative UK ranges for guidance only. Actual causes and prices vary by vehicle, and a stored code points to a system, not always the exact part.

What to check first

  1. Write down when it happens. Hot or cold, wet or dry, idling or moving, and how long into the journey. For an intermittent fault that information is worth more than any single measurement, and it costs nothing to collect.
  2. Unplug the connector and look inside it. Green or white deposits on the pins, a pin that has backed out, or a connector that is wet. This is a two-minute check and it finds the fault often enough to be worth doing before anything else.
  3. Watch the live signal while the fault is happening. Cranking and running, with the engine up to temperature, wiggling the loom near the sensor and near any point where it passes a bracket. A signal that cuts out when you move the harness is a wiring fault, not a sensor fault.
  4. Rule out the timing before you fit a second sensor. If a new sensor has already been fitted and the code came straight back, stop buying sensors and look at whether the camshaft is actually where it should be.

Related codes

P0341 covers the same sensor reporting a signal that is out of range rather than absent, and P0011 covers variable valve timing that has gone over-advanced.

Get it narrowed down before you spend

A stored code tells you which system is unhappy, not which part has failed. If you want it narrowed down before you spend anything, send the code and your symptoms and a mechanic will read them personally. Quick Diagnosis is £20, and if we can't help, you don't pay.

Written by the First Diagnostic mechanic. Over a decade in the trade: a VW-only workshop running diagnostics and electrical repair, then BMW-only through to full engine rebuilds. Now an independent all-makes workshop, plus building and wiring drift cars for competition, including trackside work as head mechanic. More about who reads your codes.