P0340

  • Powertrain
  • Generic (SAE)
  • Emissions
SeveritySeverity level 3 of 5: Diagnose soon.

Diagnose soon

Most vehicles will still run with a lost cam signal, using a fallback that costs some power and fuel economy — that keeps it out of the high band. But two things push it above low. Stalling is a realistic outcome, and an engine that stalls at speed takes most of the brake booster's vacuum reserve with it — gone after a pump or two of the pedal — and, on a vehicle with hydraulic power steering, the steering assist as well (electric systems usually keep some assist, but not reliably). And a cam signal that is present but out of correlation can mean a stretched or jumped timing chain, which if left alone can progress to valve-to-piston contact on an interference engine — an engine-destroying failure.

Safe to drive
Short trips to a shop are usually possible, but stalling is a real risk. Do not drive if it stalls unpredictably.
Standard definition

Camshaft Position Sensor "A" Circuit (Bank 1 or Single Sensor)

In plain English

The computer isn't getting a believable signal from the camshaft position sensor. That sensor tells the engine which cylinder is on which stroke. The signal could be missing because the sensor failed, because its wiring is damaged, or because the camshaft is no longer where the computer expects it to be.

The camshaft position sensor reads a trigger wheel on the cam and produces a pulse pattern the ECU references against the crankshaft position signal to establish cylinder phase. That phase reference is what enables sequential fuel injection, coil-on-plug spark timing, and variable valve timing control. P0340 is the generic circuit and plausibility fault for the 'A' sensor — bank 1 or the only sensor on a single-cam engine. It covers a signal that is absent, electrically out of range, or arriving in a pattern the module cannot interpret. Related codes distinguish range and correlation faults, but manufacturers vary in how strictly they separate them.

How the car detected it

During cranking and running, the module expects a specific number of camshaft pulses per crankshaft revolution, arriving in a defined relationship to the crank signal. It sets the fault when no pulses arrive, when signal voltage falls outside the valid high and low thresholds, or when the pulse pattern does not correlate with the crank reference within the allowed window. Some modules can resynchronise from the crank signal alone and keep the engine running in a fallback strategy; others require the cam signal to start at all.

A trouble code records what a control module measured. It does not identify which part failed. Test before replacing anything.

Can I keep driving?
Safe to drive
Short trips to a shop are usually possible, but stalling is a real risk. Do not drive if it stalls unpredictably.
Urgency
Diagnose soon
Will it pass emissions
No
If ignored
In the mild case you keep driving on a fallback injection strategy: longer cranking, slightly rough running, worse fuel economy, and a permanent check engine light that will fail an emissions test. In the serious case — where the cam signal is out of correlation because the timing chain has stretched or the tensioner is failing — continued driving lets the chain wear further. On an interference engine, a chain that jumps enough teeth or breaks lets valves meet pistons, which typically means a rebuilt or replacement engine. That is why the cam-to-crank correlation check is not optional.
Check engine light
Solid
Clearing the light
A completed drive cycle is normally required before the monitor re-runs and the light can clear.
Symptoms you may notice
  • Power loss especially in mid-rpm range
  • Possible rough idle or stalling
  • Increased fuel consumption

Many vehicles show no symptom at all beyond the warning light. The absence of a symptom does not mean the fault is not real.

Likely causes

These are the causes this code can have. For the order to work through them in, see what to check first.

#CauseHow oftenComponent
1Sensor failedVery common
2Timing chain stretched, throwing off sensor timingCommon
3Wiring faultOccasional

Ordering reflects how often each cause is responsible in general, not a probability for your vehicle. Confirm by testing.

What to check first

In order. Each of these is cheaper or faster than what follows it, and each one can make the rest unnecessary.

  1. The sensor connector for engine oil

    Cam sensors sit in oily locations and a failed sensor O-ring lets oil migrate into the connector and wick up the harness. Oil-contaminated terminals are one of the most common causes and are frequently missed because the connector looks fine from the outside.

  2. Whether the engine has any timing-related history or noise

    A rattle on cold start, a recent timing belt or chain job, or high mileage on a chain-driven engine all raise the probability that this is a mechanical timing fault rather than a sensor fault. That distinction determines whether you're spending $200 or $2,000.

  3. Any co-set crankshaft position, VVT, or misfire codes

    P0340 alongside a VVT or crank sensor code changes the picture completely. A cam phaser fault or a shared reference or ground problem can produce a cam signal fault as a symptom rather than a cause.

  4. Whether the fault is constant or only appears when the engine is hot

    A sensor that works cold and drops out after heat soak is the classic signature of a failing Hall-effect element. That pattern is close to diagnostic on its own and is easy to reproduce deliberately.

  5. Battery condition and charging voltage

    Low or unstable system voltage during cranking produces weak, mistimed sensor signals and sets plausibility codes on perfectly good sensors. It is cheap to rule out and regularly the actual answer.

How a shop diagnoses this
  1. Capture freeze frame and characterise the fault

    Tools Scan tool with freeze frame

    Record engine speed, coolant temperature, and run time at the moment of the fault, and note whether the code is current or history. Determine whether the symptom is a no-start, a stall, or just a light with no driveability complaint. Each points in a different direction.

    Expected

    A repeatable temperature or RPM condition under which the fault occurs

  2. Inspect the sensor, its seal, connector, and harness

    Tools Basic hand tools, inspection light, contact cleaner

    Remove and examine the sensor. Check the tip for damage and metal debris, the O-ring for hardening or splitting, and the connector cavity for oil, corrosion, and spread or backed-out terminals. Follow the harness for chafe against brackets, the cylinder head, or exhaust heat.

    Expected

    Clean dry connector, intact seal, undamaged sensor tip

  3. Verify power, ground, and reference at the connector

    Tools Multimeter, back-probe leads, factory wiring diagram

    With the key on, confirm the supply voltage and ground at the sensor connector, and check the signal line's pull-up voltage. Whether the sensor uses a 5-volt reference or battery feed, and which pin does what, is vehicle-specific — use the factory wiring diagram rather than assuming.

    Expected

    Correct supply voltage present and ground resistance near zero

  4. Scope the signal while cranking and running

    Tools Two-channel oscilloscope

    Capture the sensor waveform. A Hall-effect sensor should produce a clean square wave with consistent amplitude and sharp edges; a magnetic sensor produces an AC waveform that grows with speed. Look for missing pulses, rounded edges, or amplitude that collapses as the engine heats. Pulse count and pattern are specific to the engine.

    Expected

    Clean, consistent pulses with no dropouts across the full temperature range

  5. Overlay the cam signal against the crank signal

    Tools Two-channel oscilloscope, factory known-good waveform reference

    This is the step that decides the repair. Capture both sensors on a two-channel scope and compare the phase relationship against the manufacturer's reference pattern. A clean cam signal that sits in the wrong position relative to the crank means the mechanical timing has moved — chain stretch, a jumped belt tooth, a slipped sprocket, or a stuck cam phaser — not a bad sensor.

    Expected

    Cam and crank signals in the manufacturer's specified phase relationship

  6. Apply heat and vibration to reproduce an intermittent fault

    Tools Heat gun, freeze spray, oscilloscope or scan tool

    If the code is intermittent, run the engine with the scope or scan tool connected and apply gentle heat from a heat gun to the sensor, then freeze spray, while watching for signal dropout. Perform a wiggle test on the connector and harness at the same time. This separates a heat-failing sensor from a wiring fault.

    Expected

    Signal remains stable under both heat and harness movement

  7. Check variable valve timing operation if fitted

    Tools Bidirectional scan tool, oil pressure gauge

    If the engine has cam phasers, log commanded versus actual cam position and command the VVT solenoid with bidirectional control. A phaser that is stuck, or a solenoid screen clogged with sludge, shifts the cam signal out of its expected window and can set a cam position fault. Check oil level and condition at the same time — VVT systems are oil-pressure driven.

    Expected

    Actual cam position follows commanded position promptly and smoothly

  8. Verify mechanical timing directly if correlation is out

    Tools Factory service manual, timing tools, borescope

    If the scope shows a phase error, inspect the timing chain or belt: check chain stretch and tensioner extension against specification, look for guide wear and debris in the oil pan, or confirm belt alignment marks. Timing marks, chain wear limits, and inspection procedures are entirely engine-specific — use the factory manual.

    Expected

    Timing marks aligned and chain or belt wear within the published limit

Possible repairs and what they cost
RepairOnly after you confirmTypical costWho
Clean the connector, replace the sensor O-ring, and repair oil-contaminated terminalsOil found inside the connector or wicked into the harness, with a stable signal restored after cleaning and resealing$100–$380DIY
Repair chafed, heat-damaged, or corroded sensor harnessContinuity or short located on the signal, supply, or ground circuit, or a wiggle test reproducing the dropout$130–$450DIY
Replace the camshaft position sensorWiring, supply, and ground verified good, and the sensor produces a degraded or absent waveform on the scope — particularly when heat-soaked$130–$600DIY
Replace or clean the VVT solenoid and screenActual cam position fails to follow the commanded position and the solenoid is stuck or its screen is blocked with sludge$220–$800DIY
Replace a failed cam phaserPhaser fails to hold or move to commanded position with oil pressure and solenoid operation verified good$500–$1,800Shop
Replace a damaged cam trigger wheel or a loose or slipped camshaft sprocketScope shows missing or extra pulses, or inspection finds a damaged or loose trigger wheel$400–$1,600Shop
Timing chain, guide, and tensioner replacementCam-to-crank phase error on the scope, chain stretch beyond the published limit, or guide debris in the oil pan$900–$3,200Shop
Timing belt replacement with tensioner and idlersBelt found jumped, worn, or misaligned at the timing marks, with correlation restored after correct installation$550–$1,600Shop

If it is the sensor, this is one of the cheaper codes to fix — often under $300 on an engine where the sensor is reachable. The reason the range extends into the thousands is that the same code appears when the timing chain has stretched, and that job means removing the front of the engine. Ask for the cam-crank correlation to be verified on a scope before agreeing to either repair; it is the test that tells you which side of that gap you are on. Ranges are US independent shop, parts plus labour, and vary widely with engine access.

Common mistakes with this code
  • Replacing the sensor when the cam-to-crank correlation is out. The new sensor reports the same wrong phase, the code returns, and the actual problem — a stretched chain — keeps getting worse.
  • Not looking inside the connector. Oil wicking in from a failed sensor O-ring is extremely common and the terminals often look clean until you actually pull them apart.
  • Installing a cheap aftermarket sensor. These frequently work cold and fail once heat-soaked, producing an intermittent fault that looks like an entirely different problem.
  • Skipping the relearn. Many vehicles require a cam-crank correlation relearn after sensor or timing work, and without it the engine can run poorly or set the code again with everything mechanically correct.
  • Ignoring low battery voltage or a weak starter. Slow, unstable cranking produces sensor signals the module cannot interpret and sets plausibility faults on good hardware.
  • Assuming a no-start with P0340 rules out fuel or spark problems. It is a strong clue, not a conclusion — verify the signal before condemning anything.
  • Overlooking VVT phaser or solenoid problems on engines that have them, and replacing the cam sensor when the camshaft genuinely is not where the ECU expects it.
Components involved
Sources
Definition
Generic code set (SAE J2012 / ISO 15031-6) via the OBDexopen database, dedicated to the public domain under CC0-1.0.
Diagnostic guidance
Written and reviewed in-house. See our editorial policy.
Review status
Reviewed

Found something wrong? Tell us — we publish corrections.