P0340

Camshaft Position Sensor Circuit Malfunction

SEVERE
SystemIgnition / Timing
Difficulty
Cost$30–$400
Read8 min
MR
ASE Master Technician (L1 Advanced Engine Performance) · 18 yrs
·
Technically reviewed by Sara Lopez
·
Last updated

What Does P0340 Mean?

P0340 indicates the Engine Control Module (ECM) has lost or received an invalid signal from the camshaft position (CMP) sensor. The CMP sensor tells the ECM exactly where the camshaft is in its rotation so it can time fuel injection and (on some platforms) ignition spark correctly.

On the 2005–2015 Toyota Tacoma with the 2.7L 2TR-FE or 4.0L 1GR-FE V6, P0340 is most often the sensor itself failing from heat-soak. The sensor sits on top of the cylinder head and bakes for years. Replacement is usually under $80 in parts and 20 minutes of labor.

Symptoms

Hard start or extended cranking
Engine fires after 3–5 seconds of cranking instead of immediately.
Stalls at idle, restarts fine
Sensor drops signal intermittently.
No-start condition
Sensor fully dead — engine cranks but won't fire.
Rough running / misfires
Timing scatter from a flaky signal.
Check engine light, sometimes flashing
Active misfire from bad timing.
Ad · 728x90

Common Causes

  1. 1.Failed camshaft position sensor
    65%

    Heat damage to internal Hall-effect element. Most common.

  2. 2.Damaged sensor wiring / connector
    20%

    Chafed wire or corroded pin at the harness connector.

  3. 3.Reluctor / tone ring damaged
    8%

    Tooth missing or debris on the wheel the sensor reads.

  4. 4.Timing chain stretched / jumped
    5%

    Cam-to-crank correlation off — investigate before driving.

  5. 5.ECM internal fault
    2%

    Rare, but verifiable by swapping in a known-good ECM.

Step-by-Step Diagnosis

1

Scan and freeze-frame

Pull freeze-frame data. Note RPM, coolant temp, and whether the code set at start or while running. A code that sets only at cold start points to wiring; a code that sets after warm-up points to a heat-soaked sensor.

FREEZE FRAME P0340:
  RPM             : 0
  Coolant Temp    : 92°C (warm)
  Engine load     : --
  → Sensor failed after warm-up — classic heat-soak
2

Visually inspect the sensor and connector

Find the CMP sensor (top of cylinder head, near the front on the 2TR-FE). Unplug the connector. Check for green corrosion, bent pins, or oil intrusion from a leaking cam seal.

3

Measure sensor signal with scope or DVOM

Back-probe the signal wire. On a Hall-effect sensor (Toyota), you should see a clean 0V→5V square wave while cranking. A flat line means the sensor is dead.

Pro TipNo scope? A DVOM on AC volts should show 1.5–2.5V AC while cranking on a working sensor.
4

Check the 5V reference and ground

Key on, engine off. Probe the connector: pin 1 should show 5.0V (reference), pin 2 should show <0.1V (ground). If 5V is missing, the wire back to the ECM is broken or shorted.

5

Replace the sensor (most common fix)

Two bolts on the Tacoma — 20 minutes. Use OEM Denso (PN 90919-05060) or Aisin. Cheap eBay sensors fail again within months.

WarningDo NOT pry the sensor out. Twist while pulling. Prying breaks the plastic body and leaves the tip inside the head.

How to Fix It

DifficultyTime 2–3 hrs

Parts needed:

Procedure:

  1. Disconnect negative battery cable.
  2. Locate CMP sensor on cylinder head (rear of engine on 1GR-FE).
  3. Unclip electrical connector; inspect for corrosion.
  4. Remove single 10mm bolt holding sensor.
  5. Twist sensor side-to-side while pulling to extract.
  6. Lubricate new sensor O-ring with engine oil.
  7. Install new sensor, torque bolt to 80 in-lb (9 Nm).
  8. Reconnect connector with a dab of dielectric grease.
  9. Reconnect battery; start engine and clear code.

Will It Pass Emissions?

// DECISION TREE
STARTCheck engine light on?
YES →FAIL
NO →Readiness monitors set?
YES →PASS
NO →RETESTdrive 50–100 miles to set monitors

Repair Cost Breakdown

Part / RegionDIY CostShop LaborTotal Range
Most regions (DIY)$70$55–$80
Most regions (shop)$180$140–$220
High-cost metros (shop)$260$200–$300

Estimates based on aggregated independent shop quotes; dealer labor adds 30–50%. Excludes diagnostic fee ($80–$150).

Ad · 300x600

FAQs

Briefly, but no. Once the sensor drops out fully, the engine will stall — possibly in traffic. Repair within a day or two.
Ad · 728x90

Sources & References

  • §SAE J2012 — Diagnostic Trouble Code Definitions Standardized OBD-II code definitions used by all manufacturers.
  • §EPA OBD Regulations (40 CFR §86.1806-05) Federal on-board diagnostic requirements for light-duty vehicles.

Cost figures are aggregated from real customer invoices at our shop plus quotes from RepairPal and Mitchell1 labor guides. Diagnostic procedures verified against factory service information (ALLDATA / Mitchell1).

// About the author

Mike ReevesIndependent shop owner in Phoenix, AZ. Specializes in driveability diagnostics on domestic and Asian gas engines. Writes our powertrain coverage. More about our team →

Related Codes