P0340 Code: Camshaft Position Sensor Circuit Malfunction
A P0340 code means the PCM is not receiving a valid signal from the camshaft position (CMP) sensor — or the signal it is getting does not make sense. This sensor tells the PCM where the camshaft is in its rotation, which is critical for fuel injection timing (sequential injection) and ignition timing on many applications. Without it, the engine may not start, or it may run rough and default to a batch-fire injection strategy.
This code says circuit malfunction, which means the problem could be the sensor itself, the wiring between the sensor and the PCM, or even a mechanical issue with the component the sensor reads (the reluctor ring or tone wheel on the cam).
How the CMP Sensor Works
There are two main types of camshaft position sensors:
Hall Effect Sensors
These are the most common type on modern vehicles. They produce a clean digital square wave signal — a crisp on/off pattern. They need three wires: power (typically 5V or 12V from the PCM), ground, and signal. The signal wire sends a square wave pattern to the PCM as the reluctor ring on the camshaft passes by the sensor tip.
Magnetic (Variable Reluctance) Sensors
These are self-generating — they produce their own AC voltage signal as the reluctor passes by. They have two wires: signal and ground (sometimes signal and signal return). The faster the cam spins, the higher the voltage output. At cranking speed, the signal may only be 0.3-0.5V AC. At idle, it might be 1-2V AC.
Knowing which type you have determines how you test it. Check the service manual or count the wires — three wires is almost always Hall effect.
Common Causes of P0340
Sensor Failure
The sensor itself has failed — internal circuit breakdown, cracked housing letting moisture in, or the magnetic element has weakened. This is the most common cause on high-mileage vehicles.
Wiring Issues
Corroded connectors, chafed wires, or broken wires in the harness between the sensor and the PCM. CMP sensor wiring often runs near the top of the engine where it is exposed to heat, oil leaks, and vibration. Pay attention to where the harness passes near hot exhaust components or rubs against brackets.
Damaged Reluctor Ring
The reluctor ring (tone wheel) on the camshaft can lose teeth, crack, or shift position. This is less common but happens — especially on engines where the reluctor is a press-fit onto the cam gear. If it has slipped, the signal pattern is wrong even though the sensor is fine.
Timing Chain Issues
A severely stretched timing chain changes the relationship between the crankshaft and camshaft positions. The PCM sees the CMP signal arriving at unexpected times relative to the CKP (crankshaft position) signal and flags it as a CMP malfunction. You will usually see companion codes related to timing correlation if this is the cause.
PCM Ground or Power Issues
If the 5V reference circuit that powers the sensor has a fault (shorted to ground by another sensor on the same reference circuit, or the reference is missing entirely), the CMP cannot produce a signal. Check whether other sensors on the same 5V reference are also setting codes.
Step-by-Step Diagnosis
Step 1: Check for Companion Codes
Look for these alongside P0340:
- P0335 (CKP sensor): If both cam and crank sensors are setting codes, suspect a shared wiring issue, a 5V reference problem, or a timing chain/mechanical issue.
- P0341-P0349: These are more specific CMP codes (range/performance, intermittent, etc.) that can give you more direction.
- P0016-P0019 (cam/crank correlation): Points to a timing chain issue rather than a sensor issue.
Step 2: Visual Inspection
Inspect the CMP sensor connector for corrosion, oil contamination, or damage. Check the wiring harness from the sensor back toward the PCM — look for chafing, melting, or pinched wires. Check the sensor mounting — is it loose? Has it backed out of the bore?
Step 3: Check Voltage at the Connector
Unplug the sensor. With the key on and engine off, check for voltage at the connector (PCM side):
- Hall effect sensor: You should have 5V (or 12V on some applications) on the reference wire, and a good ground on the ground wire. Use a multimeter — reference to ground should read within 0.5V of spec.
- Variable reluctance sensor: No external voltage is needed — the sensor generates its own. But check the resistance across the two sensor pins: most VR sensors read between 200-2,000 ohms. Compare to spec. Infinite resistance (open) or near-zero (shorted) means a bad sensor.
Step 4: Check the Signal
The best way to test the CMP signal is with an oscilloscope. Back-probe the signal wire and crank or start the engine:
- Hall effect: You should see a clean square wave. Look for dropouts, noise, or irregular patterns. The amplitude should be consistent — typically 0V to 5V transitions.
- VR sensor: You should see a smooth sine wave that increases in amplitude and frequency with RPM. Look for irregular peaks, missing pulses, or low amplitude.
If you do not have a scope, a quick check with a multimeter set to AC voltage can at least tell you if the sensor is producing a signal during cranking (VR type) or you can use a noid light or LED test light on the signal wire of a Hall effect sensor to see if it is toggling.
Step 5: Check the Reluctor
If the sensor and wiring check out, inspect the reluctor ring. On some engines, you can see it by removing the sensor and looking into the bore with a borescope or flashlight. Look for cracked, chipped, or missing teeth. If the reluctor is on the cam gear inside the timing cover, you may need to remove the cover for a visual.
Common Mistakes
- Replacing the sensor without checking wiring. If a corroded connector killed the old sensor signal, it will kill the new one too.
- Not checking the 5V reference circuit. If another sensor on the same reference is shorted, it pulls down the voltage for all sensors on that circuit. You will chase your tail replacing the CMP sensor when the problem is a shorted MAP or TPS on the same reference.
- Ignoring oil contamination. A cam sensor sitting in a pool of oil from a valve cover gasket leak can short internally or corrode the connector. Fix the oil leak before replacing the sensor, or the new one will fail too.
- Replacing the sensor without checking timing chain condition. If the chain is stretched 10 or more degrees, a new sensor is not going to fix the real problem.
Confirming the Fix
After replacing the sensor or repairing the wiring, clear the code and start the engine. Check for a clean CMP signal on your scan tool or scope. Drive the vehicle through a complete drive cycle and verify the code does not return. If the vehicle previously had a no-start condition, it should fire right up with a good CMP signal restored.
For more on sensor diagnostics and scope testing, check out the APEX Tech Nation Academy electrical and engine performance courses.
Related Articles
P0335 Code: Crankshaft Position Sensor Circuit Malfunction
P0335 crankshaft position sensor circuit malfunction. Complete diagnostic guide with scope testing, wiring checks, and common causes for technicians.
DiagnosticsP0300 Code: Random/Multiple Cylinder Misfire Detected
P0300 random/multiple cylinder misfire detected. Complete diagnostic guide covering causes, symptoms, and step-by-step repair procedures.
DiagnosticsP0171 Code: System Too Lean (Bank 1) — Diagnostic Guide
P0171 system too lean Bank 1. Complete diagnostic guide: causes, fuel trim analysis, vacuum leak testing, and repair steps.