P0340Generic code

P0340 Code: Camshaft Position Sensor A Circuit Malfunction (Bank 1 or Single Sensor)

The P0340 code means the computer is not receiving the camshaft position sensor signal, or is receiving it erratically. Without that data it cannot determine engine phase, which causes long cranking, sudden stalls and, on some vehicles, an engine that will not start.

Severity
High
Can I keep driving?
Yes, but with caution
Estimated cost
$60 to $400
Difficulty
Medium
System
Ignition and Misfires
Applies to
All OBD2 vehicles

Common in: Chevrolet, Dodge, Fiat, Hyundai, Kia, Nissan, Peugeot, Renault, Toyota

On this page

What the P0340 code means

The camshaft position sensor tells the computer the phase of the engine, which means which stroke each cylinder is on. With that information it decides the exact moment of sequential fuel injection and of the spark.

The P0340 code is stored when that signal does not arrive, arrives with interruptions or does not have the expected shape. Unlike P0016, which compares two valid signals and finds an offset, here the problem is in the signal itself.

Many engines can start without this signal by using a backup strategy based only on the crankshaft sensor, which explains why the cranking is longer than normal but the vehicle still runs. Others simply will not start.

There is one quirk of this sensor that explains a lot of intermittent faults: on most modern engines it does more than report phase, it also serves as feedback for the variable valve timing system. When the computer commands the camshaft to advance or retard, it checks the result by reading this very sensor. If its signal arrives noisy, the system can store the code even though the sensor is not bad: what is failing is the cleanliness of the signal.

That is why you should check the cable shielding and how far it runs from the high voltage wires before you write the sensor off as dead. A deteriorated spark plug wire that passes nearby can induce enough interference to set this code at random.

P0340 code symptoms

  • Check engine light on.
  • Long cranking, several seconds before the engine catches.
  • Sudden stall while running, with a normal restart afterward.
  • Loss of power and hesitation when you accelerate.
  • Higher fuel consumption.
  • On some vehicles, the engine will not start at all.
  • A code that only appears when accelerating with a hot engine, when the variable valve timing system is working.
  • Audible chain noise alongside the code on high-mileage engines.

Likely causes of the P0340 code

  1. Failed camshaft sensor. The most frequent cause, especially if the fault is intermittent and gets worse when hot.
  2. Connector that is loose, corroded or has retracted pins.
  3. Wiring with chafing or cut through, common because it runs near moving and hot parts.
  4. Camshaft reluctor wheel damaged, dirty or loose.
  5. Wrong air gap after installing a sensor that is not the specific one.
  6. Stretched timing chain, which changes the position of the signal.
  7. Electrical interference from deteriorated spark plug wires close to the sensor.
  8. Damaged cable shielding or a cable routed next to the high voltage wires, which brings noise into the signal.
  9. Variable valve timing actuator with play, which shifts the signal position from what is expected.
  10. Leaking valve cover gasket that bathes the sensor in oil and alters its reading.

How to diagnose the P0340 code step by step

  1. Inspect the connector and harness of the sensor, looking for corrosion, moisture or chafing.
  2. Check the sensor supply with the key on: depending on the type, 5 or 12 volts, plus its ground.
  3. Look at the signal with an oscilloscope while cranking. It should be a clean, regular wave with no dropouts or noise.
  4. Measure the resistance if the sensor is inductive and compare it with the specification.
  5. Wiggle the harness with the engine running to reproduce an intermittent fault.
  6. Check the reluctor wheel. Clean off metal shavings and make sure it has no damaged teeth or play.
  7. Rule out timing problems by checking whether a correlation code is also stored.
  8. Check the distance between the sensor cable and the spark plug wires. A deteriorated high voltage wire a few inches away induces enough noise to set the code.
  9. Check for oil in the sensor housing. A valve cover leak coats it and falsifies its reading.
  10. Repeat the test with the engine hot and accelerating, which is when the variable valve timing system works and the code usually shows up.

How to fix the P0340 code

  • Replace the camshaft sensor with an original or a recognized brand. Generic ones with a different air gap set the code again.
  • Repair or replace the damaged wiring with solder and heat protection, and keep it away from hot areas.
  • Clean the connector and apply dielectric grease.
  • Clean the metal shavings stuck to the tip of the sensor and to the reluctor wheel.
  • Correct the timing if the chain is stretched or mistimed.
  • Replace deteriorated spark plug wires that cause interference.
  • Separate and shield the sensor cable from the high voltage wires, and replace any deteriorated spark plug wire.
  • Repair the valve cover leak and clean the housing before you install the sensor.
  • Check the play in the variable valve timing actuator if the code persists with a good sensor and wiring.

Technical reference data

  • Hall effect sensors: 5 or 12 volt supply and a square wave signal that switches between high and low values.
  • Inductive sensors: alternating signal with no external supply, typical resistance between 200 and 1,500 ohms.
  • Usual air gap between the sensor and the reluctor wheel: 0.5 to 1.5 millimeters (0.020 to 0.059 inch).
  • Expected relationship: one camshaft revolution for every two crankshaft revolutions.
  • Expected signal ratio: one camshaft reference pulse for every two full crankshaft revolutions.
  • Allowable noise in the signal: the waveform must be clean, with no stray spikes between the edges.
  • Recommended distance between the sensor wiring and the high voltage wires: at least 5 centimeters (about 2 inches).

Brand-specific notes

Metal shavings stuck to the sensor magnet are a classic cause and easy to miss. Before you replace it, remove the sensor and clean its tip.

Before you order the sensor, pull the existing one and look at its tip. Stuck metal shavings or a film of oil explain a good share of these codes, and they are fixed with a rag and five minutes.

Frequently asked questions about P0340

Can the engine start with a P0340 code?
On many vehicles yes, using a backup strategy based on the crankshaft sensor, although the cranking will be longer. On other models the engine will not start until the signal is repaired.
What is the difference between P0340 and P0016?
The P0340 code means the camshaft sensor signal is poor or missing. The P0016 code means the crankshaft and camshaft signals both arrive fine but do not agree with each other, which points to the timing.
Can the camshaft sensor be cleaned?
Yes, it is worth trying: remove the metal shavings stuck to the tip and clean the connector. In quite a few cases the code goes away without replacing the part.
How much does it cost to fix P0340?
The sensor usually costs $25 to $120, and with labor the total typically lands between $90 and $400 depending on how easy it is to reach.
The code only shows up when I accelerate. Does that make sense?
Yes. The variable valve timing system acts under load and uses this sensor as feedback. If the signal arrives noisy, the fault shows up right at that moment.
Can a bad spark plug wire cause it?
Yes. A deteriorated high voltage wire routed nearby induces disturbances in the sensor signal and sets the code even though the sensor is not bad.

Questions about the P0340 code

There are no questions about this code yet. Tell us about your case: vehicle, symptoms and what you have already checked.