P0340 Code: Camshaft Position Sensor Circuit Malfunction
🟠 Moderate severity · drivable
Drivable if the engine runs, but a failing camshaft sensor can cause stalling or a no-start, so replace it soon.
What P0340 means
The engine computer is getting no signal or an invalid signal from the camshaft position sensor. This sensor tells the computer the camshaft's position so it can time fuel injection and ignition.
How the system works
The camshaft position sensor sits in the cylinder head or timing cover and reads a toothed wheel on the camshaft. Its signal tells the engine computer which stroke each cylinder is on, so the computer can time fuel injection and, on many engines, each ignition coil. P0340 points at the sensor's circuit: the computer sees no signal at all, or one that makes no sense.
Most engines can still run from the crankshaft sensor alone, which is why many cars with P0340 start and drive. They often crank longer than normal, because the computer has to guess which cylinder is on its compression stroke.
Symptoms
- Check engine light is on
- Hard starting or no-start
- Engine stalling
- Rough running or misfiring
Common causes
- most common: Faulty camshaft position sensor
- common: Damaged wiring or loose connector at the sensor
- less common: Timing chain or belt problem
How to diagnose P0340
- Read the freeze frame data. Note the engine speed and temperature when the code set. A code that sets during cranking points at a dead sensor or circuit; one that sets while driving and hot points at a sensor failing with heat or a loose connection.
- Inspect the connector and harness. Unplug the sensor and look for oil inside the connector, green corrosion, or bent pins. Follow the harness for rubbed-through insulation, especially where it passes near the exhaust or a belt.
- Check power and ground. With the key on, a three-wire (Hall-effect) sensor should have a reference voltage (5 V or 12 V depending on the vehicle) on one pin and a good ground on another. No reference voltage means a wiring or computer fault, not a bad sensor.
- Test the sensor signal. A two-wire magnetic sensor can be checked for resistance against the factory specification and should produce a small AC voltage while cranking. A three-wire sensor should switch between low and high voltage as the engine turns.
- Check the oil and the timing. If the sensor and wiring test good, check oil level and condition, then look at timing chain or belt wear. A stretched chain or a jumped tooth moves the cam signal out of step with the crank signal.
- Clear the code and road test. After the repair, clear the code and drive through a full warm-up. If it returns only when hot, suspect the sensor or a heat-affected connection.
How to fix it
| Fix | DIY? | Typical cost |
|---|---|---|
| Inspect and clean the camshaft sensor connector | Yes | $0–10 |
| Replace the camshaft position sensor | Yes | $50–150 |
| Repair damaged sensor wiring | Mechanic | $50–200 |
Common misdiagnoses
- Replacing the sensor without checking for reference voltage. A new sensor will not fix a broken wire or a blown fuse.
- Fitting a cheap aftermarket sensor. Cam and crank sensors are sensitive to signal shape, and low-quality parts are a common reason the code comes back.
- Ignoring oil in the connector. Oil wicking through the sensor body or harness means the leak has to be fixed too, or the new sensor will fail the same way.
P0340 vs similar codes
- P0341: P0341 means the cam signal is present but out of range or badly timed. It leans more toward timing chain stretch or a damaged tone wheel than a dead sensor.
- P0335: P0335 is the same kind of circuit fault on the crankshaft sensor. The engine usually will not start at all with P0335, while it often still runs with P0340.
- P0016: P0016 means both sensors are working but the cam and crank signals do not line up, which points at mechanical timing or a variable valve timing fault.
Frequently asked questions
Related codes
P0340 by vehicle brand
Causes and repair costs for P0340 differ between makes. Pick your brand for the specifics.
Related guide: MAF Sensor Replacement Cost →
Updated 2026-10. This page is informational and not a substitute for professional diagnosis.