P0340 VW: Diagnose the G40 Sensor Circuit Fault
12 min read · by Nicole Bennett · Last updated: November 25, 2026
The p0340 vw code means the engine computer has detected a problem with the camshaft position sensor circuit, commonly identified in Volkswagen diagnostic references as sensor G40. It does not prove that the sensor itself has failed. A damaged connector, wiring fault, missing signal, or camshaft timing problem can produce the same fault.
On a Volkswagen, the right repair depends on the model year, engine, and other stored codes. Start with a complete scan, preserve the freeze-frame data, and check the G40 circuit before buying parts. A generic OBD2 reader can confirm P0340, but a VW-capable scan tool may show additional camshaft status and synchronization data.
This guide explains the standard code definition, VW-related causes, symptoms, scanner checks, repair choices, and driving risk. Because Volkswagen has used different engines and sensor layouts, use the wiring diagram and test limits for the exact vehicle rather than assuming every VW has the same sensor location or circuit values.
What P0340 Means on a Volkswagen
P0340 is the generic SAE code for Camshaft Position Sensor “A” Circuit, Bank 1 or Single Sensor. On Volkswagen diagnostic references, the related camshaft position sensor is commonly called G40; the code points to a circuit or signal problem, not automatically to a defective sensor.

The camshaft position sensor reports camshaft position and helps the engine control module (ECM) identify the engine cycle and coordinate fuel injection and ignition timing. The crankshaft turns twice for each camshaft revolution in a four-stroke engine. The ECM compares the two position signals so it can determine which cylinder is approaching the correct point in its cycle. If the expected camshaft signal is missing, implausible, or interrupted, the controller may set P0340 and turn on the malfunction indicator lamp.
The P prefix identifies a powertrain code, and the 0 in the second position means this is a generic SAE definition, not a VW-only code. The wiring, sensor design, and test limits still vary by engine, so never transfer a pinout or voltage specification from another Volkswagen.
Ross-Tech identifies P0340 as a G40 camshaft position sensor malfunction. Its possible causes include faulty wiring to or from G40, a failed sensor, and misaligned timing. That list is a useful diagnostic order, not proof that one item is responsible on every vehicle. Read the full entry at Ross-Tech’s P0340/G40 reference.
Volkswagen’s 2014 Beetle quick-reference chart also calls P0340 “Camshaft Position Sensor Circuit.” For that specific Beetle reference, the listed criteria include cam adaptation beyond 20 crankshaft degrees in either direction or a difference greater than 9 crankshaft degrees between adapted and actual values. Those are not universal VW limits. They illustrate why the correct model- and engine-specific service information matters. The same code can behave differently on other vehicles, so it helps to compare it with P0340 Chrysler Code.
Symptoms That Can Accompany a G40 Fault
A P0340 fault may cause only a steady check engine light, or it may affect starting and engine operation. The symptom pattern depends on how often the signal drops out and how the specific VW engine manages the loss of camshaft information.

Common signs include a longer-than-normal crank before the engine starts, intermittent starting, stalling soon after startup, hesitation while accelerating, rough running, misfires, and a noticeable loss of power. DENSO also lists inconsistent acceleration, occasional stalling, misfires, and no-start conditions among symptoms associated with camshaft or crankshaft sensor faults. A warning light may appear with none of these driveability symptoms, especially when the issue is intermittent.
Heat can expose a weak sensor or damaged conductor: the VW may start cold, then crank longer or stall when warm. Vibration can also move a loose connector, making the fault intermittent. A short symptom-free test drive does not rule it out.
Watch for related codes. A crankshaft-position code, such as a P0335-family fault, can point toward a separate crankshaft signal problem or a shared synchronization issue. Misfire codes such as P0300 or P0301 may appear if engine operation becomes unstable. Record all codes before clearing anything. The combination and order in which codes return can be more useful than P0340 by itself.
A flashing check engine light indicates an active misfire that can damage the catalytic converter. Reduce engine load and arrange prompt diagnosis; do not keep accelerating hard or towing. For the same trouble code on a different platform, read P0340 Hyundai Code.
Common Causes on VW Engines
The most useful starting points are the G40 sensor, its connector and wiring, and the mechanical relationship between the camshaft and crankshaft. These three areas match the main checks listed in Volkswagen-focused diagnostic information, but the order and exact tests should follow the service procedure for the engine code.
A failed or contaminated camshaft sensor
The sensor can fail from age, heat, vibration, or physical damage. DENSO also identifies scratches, foreign material on the sensing surface, and wiring wear as common problems. A missing output during cranking is stronger evidence than the code alone.
Connector or harness damage
A loose plug, broken lock, backed-out terminal, corrosion, oil intrusion, or rubbed wire can interrupt the signal. Check for crushed or heat-damaged sections and prior repairs. A clean-looking pin can still have poor contact tension, so inspection alone is not a complete circuit test.
A supply or ground fault can mimic a bad sensor. Sensor designs differ, so voltage, pin assignment, and waveform tests must come from the VW wiring diagram. Never guess at a pin or apply battery voltage to a signal terminal.
Camshaft timing or a damaged signal target
Misaligned camshaft timing or a damaged reluctor or trigger wheel can disturb the signal. Consider this cause when P0340 follows belt, chain, cylinder-head, or camshaft work; review that repair before condemning the sensor.
With variable valve timing, commanded and actual camshaft positions must agree within the engine’s allowed range. Components and limits vary by model year and engine. Do not blame an adjuster or oil-control valve without supporting data and the correct test procedure.
Consider an ECM fault only after the sensor, wiring, supply, ground, and timing pass their tests. Verify the signal at the sensor and, where specified, at the control-module connector before condemning the computer.
How to Diagnose P0340 With an OBD2 Scanner
A good diagnosis uses the scanner to preserve the conditions that set the code, then follows up with a visual and electrical inspection. A basic reader can retrieve the generic P0340 code, while a VW-capable scan tool may provide more detailed camshaft status, synchronization, or measured-value information.
- Connect to the 16-pin OBD2 port, usually beneath the driver-side dashboard, and run a full scan if the tool supports other modules.
- Record stored, pending, and permanent codes, including related crankshaft, misfire, voltage, or timing faults. A pending code has been detected but is not yet confirmed.
- Save Mode 02 freeze-frame data before clearing codes. Note engine speed, load, coolant temperature, and vehicle speed to see whether the fault occurred cold, warm, at idle, or under load.
- Use Mode 01 and VW-specific measuring values, where available, to compare camshaft position, adjustment, engine speed, and synchronization. Use limits for the exact engine; generic readers may not show every value.
- Check battery voltage: about 12.6 volts at rest and 13.5 to 14.7 volts with the engine running are typical healthy readings. These are battery checks, not G40 signal specifications.
- With ignition off, inspect G40’s connector and harness for loose fit, corrosion, pushed-back pins, oil, moisture, chafing, or poor splices. Identify supply, ground, and signal pins from the wiring diagram.
- If needed, test the circuit with a multimeter or oscilloscope. Check the waveform while cranking: no output points toward the sensor, supply, or target; a normal waveform shifts attention toward wiring or the control unit. Limits depend on sensor type.
- If the circuit passes, verify mechanical timing and the target wheel. A good sensor can still report an incorrect relationship if timing is off; starting and idling do not prove timing is correct.
| Scanner or test result | What it can indicate | Next diagnostic check |
|---|---|---|
| P0340 stored, no other codes | A G40 circuit or signal fault is recorded; the failed component is not identified. | Save freeze frame, inspect connector and wiring, then test the signal. |
| P0340 with crankshaft or synchronization codes | A shared signal, timing, or correlation problem may be present. | Compare cam and crank data and verify mechanical timing. |
| No camshaft waveform while cranking | The sensor, its power or ground, wiring, or target may not be producing a usable signal. | Check the sensor circuit and target using the engine-specific test plan. |
| Normal waveform at the sensor, fault remains | The signal may be lost between the sensor and ECM, or timing/data interpretation may be wrong. | Check harness continuity and signal at the control-module end; confirm timing. |
| Cam adaptation outside the model-specific limit | The camshaft may not be at the expected mechanical or commanded position. | Use the service data for the exact VW engine before adjusting or replacing parts. |
Mode 06 is not the first-line test for P0340. Use it only if the scanner identifies a supported VW monitor result; an undecoded test ID is not proof of a failed part. Fuel trims are not a primary test for this camshaft circuit code.
For more on sensor operation and signal checks, review DENSO’s camshaft and crankshaft sensor fault-finding information. Its waveform guidance is useful background, but Volkswagen wiring diagrams and engine-specific values remain the authority for the vehicle being repaired.
Tip: Do not erase P0340 before saving the code status and freeze-frame record. Clearing it can remove useful evidence, and a permanent OBD code will not disappear just because a scanner sends an erase command. After the fault is repaired, the vehicle must complete the relevant monitor before a permanent code clears on its own. If the light returns with a different code, P0300 VW is a good next read.
Repair Options and Cost Factors
The repair must restore a clean camshaft signal and confirm plausible timing data. Sensor access and labor vary by VW engine, so diagnose the cause before ordering parts.
If G40 fails its output test and the wiring, supply, ground, and target are sound, fit the correct sensor. Follow the specified seal, fastener torque, and clearance. The sensor tip must not contact the timing rotor.
For a harness fault, repair the damaged wire and restore terminal fit. Replace badly corroded or spread terminals, then secure the harness away from moving and hot parts. A temporary wire repositioning can let an intermittent fault return.
A timing fault may require checking marks, belt or chain alignment, tensioners, or the camshaft target. This work can require locking tools and engine-specific steps. Do not adjust timing based on a generic code description.
Cost depends on parts, diagnostic time, labor hours, and access. A connector repair may take less labor than a hard-to-reach sensor; timing-belt or chain work usually involves more labor. Shop rates, engine design, and related repairs also affect the bill, so there is no single estimate for every VW.
DIY repair makes sense only with the correct diagram, test equipment, and engine experience. If timing components need work or specifications are unavailable, professional diagnosis can prevent a costly repeat repair.
After the repair, clear ordinary stored codes only after recording them, then start the engine and check for a returning fault. Review live camshaft data, confirm normal starting and operation, and complete the appropriate drive cycle so the monitor can run. A permanent code clears only after the fault is fixed and the relevant monitor passes; it may remain visible for a period even when the underlying repair is complete. Codes often appear in groups on this vehicle, so P0352 VW may also apply.
Is It Safe to Drive With P0340?
Diagnose P0340 promptly because the engine may stall, lose power, or fail to start. Driving risk depends on symptoms, warning-light behavior, and possible mechanical timing trouble.
With a steady light, normal starting, smooth idle, and normal power, a short gentle trip to a repair facility may be possible. Avoid hard acceleration, high load, highway trips, and towing; an intermittent fault can worsen.
Do not drive on if the engine stalls, misfires heavily, loses power, or makes unusual noise. A flashing check engine light means an active misfire can damage the catalytic converter. Reduce load and arrange prompt inspection or a tow.
If P0340 follows timing-belt or chain service, or a new rattling noise appears, stop and have mechanical timing checked before driving further.
Avoid repeated long cranking if the engine will not start; it drains the battery and strains the starter. Save the scan data and arrange diagnosis even if the only symptom is a steady lamp. A basic code reader will show the code, but Best Selling Professional Scan Tools covers tools that read live data too.
Frequently Asked Questions
These answers cover a few details that can help interpret a VW scan result and avoid common assumptions during diagnosis.
Why does a Volkswagen scanner show 16724 with P0340?
Some VW/Audi diagnostic references show VAG fault number 16724 alongside generic code P0340. It is the companion identifier for the same G40 malfunction, not a second failed component.
What do P0342 and P0343 identify?
The 2014 Beetle chart labels P0342 as a camshaft position sensor circuit-low fault and P0343 as a circuit-high fault. They are distinct from the broader circuit malfunction recorded as P0340.
Are all VW camshaft sensors the same electrical type?
No. DENSO describes MPU inductive sensors and MRE semiconductor sensors. Their signal behavior differs, so use the VW procedure for the installed sensor rather than assuming one universal resistance or voltage test.
Is P0340 the same as P0341?
No. The 2014 Beetle reference chart describes P0341 as an incorrect signal pattern and lists a defect counter of 12. P0340 is listed separately as the camshaft position sensor circuit code.
Why does the engine code matter on a 2014 Beetle?
The 2014 Beetle reference book separates its procedures by engine codes, including CJAA 2.0L TDI, CPKA/CPRA 1.8L, CPLA/CPPA 2.0L, and CBTA/CBUA 2.5L. Use the section for the installed engine.
P0340 on a Volkswagen points to the G40 camshaft position sensor circuit, but the sensor is only one possible cause. Save the scan data, test the wiring and signal, and verify mechanical timing before replacing parts; the correct fix depends on the exact VW engine.
-
Nicole Bennett, Technical Content Editor at BestOBD2Picks Nicole turns OBD-II standards, service bulletins, and repair data into step-by-step diagnostic guides anyone can follow. Technical Content Editor
Related guides
Learnp0303 VW Code: Cylinder 3 Misfire Causes and Fixes
LearnP0336 VW: Diagnose Crankshaft Sensor and G28 Problems
LearnP0325 VW: Find the Knock Sensor Fault and Restore Engine Performance
LearnP0306 VW: Diagnose Cylinder 6 Misfires and Avoid Unnecessary Repairs
LearnP0305 VW: Diagnose a Cylinder 5 Misfire and Find the Cause
LearnDelphi Ignition Coil Review: Is It Worth Buying?