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
- Failed camshaft sensor. The most frequent cause, especially if the fault is intermittent and gets worse when hot.
- Connector that is loose, corroded or has retracted pins.
- Wiring with chafing or cut through, common because it runs near moving and hot parts.
- Camshaft reluctor wheel damaged, dirty or loose.
- Wrong air gap after installing a sensor that is not the specific one.
- Stretched timing chain, which changes the position of the signal.
- Electrical interference from deteriorated spark plug wires close to the sensor.
- Damaged cable shielding or a cable routed next to the high voltage wires, which brings noise into the signal.
- Variable valve timing actuator with play, which shifts the signal position from what is expected.
- Leaking valve cover gasket that bathes the sensor in oil and alters its reading.
How to diagnose the P0340 code step by step
- Inspect the connector and harness of the sensor, looking for corrosion, moisture or chafing.
- Check the sensor supply with the key on: depending on the type, 5 or 12 volts, plus its ground.
- Look at the signal with an oscilloscope while cranking. It should be a clean, regular wave with no dropouts or noise.
- Measure the resistance if the sensor is inductive and compare it with the specification.
- Wiggle the harness with the engine running to reproduce an intermittent fault.
- Check the reluctor wheel. Clean off metal shavings and make sure it has no damaged teeth or play.
- Rule out timing problems by checking whether a correlation code is also stored.
- 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.
- Check for oil in the sensor housing. A valve cover leak coats it and falsifies its reading.
- 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.
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.