Key takeaways
- P0340 is a camshaft position sensor circuit code, and the code alone doesn't say the sensor is bad.
- Causes differ by car: oil moisture, a corroded connector, a chafed harness, a weak battery or software.
- If the code came back after a new sensor, ask which part of the circuit the shop tested.
- A scan with P0340 may show other cam codes too.
P0340 is a camshaft position sensor circuit code, so what fixes it depends on the car. A shop reads every stored code before it tests a part.
What does the P0340 code mean?
P0340 is an OBD-II code, the engine computer's code for a fault in the camshaft position sensor circuit. Its printed name on Stellantis cars is "Cam Position Sensor Circuit - Bank 1 Intake," and on GM cars it sits with P0341.
The engine computer sets it when it sees a fault in the sensor's circuit. A shop decides what to test from all the stored check engine light codes.
Camshaft position sensor circuit
Cam Position Sensor Circuit - Bank 1 Intake
What the computer saw
A fault in the camshaft position sensor circuit.
- Code
- P0340
- System
- Powertrain
- Area
- Camshaft position sensor
- Checks
- The camshaft position sensor circuit
What it doesn't prove
It doesn't name the part. It says the circuit has a fault, not why.
Can you drive with a P0340 code?
It depends on the symptoms. If the check engine light stays on but doesn't flash, have the car checked as soon as you can.
If any of these shows up:
- Stop: The check engine light flashes. Ease off the throttle and pull over where it's safe.
- Stop: The car loses drive or stalls while moving. Steer to a safe spot, stop and call for help.
- Caution: The light flashes again after the engine has rested. Drive slowly and gently to the nearest shop.
A chafed engine harness can cause a no start, no crank, rough running, reduced engine power, an erratic speedometer and blown fuses, with many codes that include P0340, as on some GM 2.7L turbo trucks. The harness causes both the symptoms and the codes.
The engine can also stall with this code on some cars. If the car loses drive or stalls while moving, steer to a safe spot, stop and call for help.
What are the symptoms of P0340?
The check engine light comes on, and what else you notice depends on the car:
- Check engine light. It comes on with the code on every car, from vans to trucks.
- A rough-running engine with a blown fuse. A harness short at the steering shaft can cause it, on the 2020–2021 Ford Escape.
- No start, no crank, reduced power or an erratic speedometer. A chafed engine harness can cause them, with blown fuses, on the 2.7L turbo in the Silverado 1500.
- A stall or an engine that won't start. Both can come with the code, as on the 2005 Saab 9-2X with the 2.5L.
A sensor circuit code can also set with none of these, so a shop reads the stored codes with a scan tool. If the engine stalls or won't start, tell the shop when it happened and whether the light was on first.
What causes P0340?
The code names a circuit, so more than the sensor can set it: the harness, the connectors, the sensor itself and a weak battery. Others belong to one car each. A shop finds which cause it is by testing the circuit in order, not by replacing the sensor first.
The service information for your exact engine shows where each connector and harness runs. For the timing codes, see P0011 Code and P0016 Code.
1. A harness or connector fault
The circuit runs from the sensor to the engine computer, so an open circuit in the harness between them can set P0340. On some engines that harness is shielded, and a short to ground is repaired together with its shield.
Poor contact in the engine computer connector or in a coupling connector on the way does the same. A shop checks the connectors before it replaces the sensor.
2. A sensor that is loose or out of range
The sensor is the last part in the circuit. A shop checks that its mounting bolt is tight, then tests the sensor itself, which on the 2.5L Saab 9-2X means measuring its resistance.
A sensor that tests outside its range gets replaced. These sensors fail from excessive heat, oil leaks or contamination, dirt, wiring problems, physical damage and normal wear. A break in the toothed wheel the sensor reads can set the code too.
Moisture in the engine oil can also set it. It builds up when the car is driven short distances or under 6,000 miles a year, and the shop replaces the camshaft position sensor and changes the oil, as on the Ford C-Max.
The shop also checks the wiring for a break or a short to ground, the sensor's supply voltage and its signal on a scope, against the carmaker's specifications. When the sensor fails, the engine computer can switch to an emergency program.
3. A weak battery or low voltage
A weak battery can set the code on any car. The shop tests the battery before it replaces a sensor, as on the 2017–2018 Chevrolet Trax.
Low battery voltage can make the engine's speed read inconsistently and turn the check engine light on with P0340 or the crankshaft sensor code P0335. That's why the battery comes before the sensor.
4. A corroded connector or a harness that rubs
On some engines a connector on the front of the engine, next to the vacuum pump, can corrode. The shop checks it when the standard tests find nothing, as on the Chevrolet Tahoe.
A chafed engine harness is another cause on some engines. A shop checks the harness where it crosses the camshaft carrier cover and at other points the maker lists, as on the 2.7L turbo in the Silverado 1500.
On one car the harness rubs the steering shaft. The shop repairs the harness, moves it away from the joint in the steering shaft and secures it, as on the Ford Escape.
5. Engine computer software
On some engines the cause is the software, not a part. The repair is a reprogram, as on the Ram ProMaster with the 3.6L V6.
The service information for your exact engine shows which causes apply to it, and the code alone doesn't say which one it is. Ask whether a bulletin was checked for your car before any part is ordered.
What to say to the shop
When you have a P0340 quote or a repair order, ask:
- Which part of the circuit was tested, the sensor, the connector or the wiring?
- Was a bulletin checked for my car?
- Does the quote name what failed?
“My car set P0340. Can you tell me which part of the circuit you tested, whether a bulletin covers my car and what failed?”
A good answer: the test that was run, the part it points to and a bulletin check for your car, before any part is ordered.
How does a shop diagnose P0340?
A shop checks the circuit in this order, and the sensor comes last:
- Measure the harness. The shop measures the resistance of the harness between the sensor and the engine computer to engine ground, to find an open circuit or a short.
- Check the connectors. The shop checks the connectors for poor contact.
- Check the mounting bolt. The shop checks that the sensor's mounting bolt is tight.
- Measure the sensor. The shop measures the sensor itself, and a sensor that tests out of range gets replaced.
- Check the repair. After the repair the shop clears the computer's memory and runs the check again to see that the code stays away.
Diagnosing and replacing a cam or crank sensor is a job for a professional technician. One quick test is to read the engine speed on a scan tool while the engine cranks, and if the engine runs, a scope is the best tool to find the fault.
| Check | Reading | Car |
|---|---|---|
| Sensor resistance | 1 to 4 kΩ | 2005 Saab 9-2X, 2.5L |
| Wiring, end to end | About 0 ohms | General value, the carmaker's specification decides |
| Short to ground | Above 30 megohms | General value, the carmaker's specification decides |
| Supply voltage | About 5 volts | A Hall sensor, the carmaker's specification decides |
| Signal | A square wave on a scope | A Hall sensor, the carmaker's specification decides |
Where is the P0340 camshaft sensor?
Camshaft position sensors are typically in the cylinder head, but where one sits depends on the engine, so there's no one place to look. On the 2006 Saab 9-3 with the 1.8L engine, for example, the sensor sits in the cylinder head, and the shop takes off the engine cover and the top of the toothed belt cover before it can reach it.
The connector and the harness run elsewhere, and the service information for your exact engine shows where. A test of the circuit can include whether the sensor's installation bolt is tight.
Use this image
Free to republish under CC BY 4.0: credit Oil & Miles and link to this page. The snippet does both.
<a href="https://oilandmiles.com/articles/p0340-code"><img src="https://oilandmiles.com/assets/img/diagrams/p0340-code-bench-flow-1200.svg" alt="A four-cylinder engine drawn see-through in pale gray, with a camshaft sensor and its connector in blue on the cylinder head, magnified in a circle beside the engine." width="1200" height="674"></a> <p>Diagram: <a href="https://oilandmiles.com/articles/p0340-code">Oil & Miles</a>, CC BY 4.0</p>Why is P0340 back after you replaced the sensor?
A sensor isn't the only part in the circuit. The cause can be a connector, a harness, software or oil moisture, and on the hybrids with oil moisture the shop replaces the sensor and changes the oil together.
If the code came back after a new sensor, ask which part of the circuit the shop tested. For cam and crank signals that disagree, see P0016 Code.
How much does it cost to fix P0340?
The cost depends on the car and on which part the repair needs. Diagnosis isn't priced here, and labor isn't priced because no carmaker labor time is available for it. The repair priced here is a new camshaft position sensor with an oil change, as on the Ford C-Max hybrid.
Priced on the 3 cars below, not every model and year. Yours may cost more or less.
P0340 parts cost
$21–$128 Part only
P0340 parts cost Part only $21–$128
Estimated price of the camshaft position sensor on the three Ford and Lincoln hybrids where it is the repair for P0340. Yours may cost more or less.
| Car | Independent shop |
|---|---|
| 2015 Ford C-Max Hybrid 2.0L | $21–$128 |
| Camshaft position sensor | |
| 2015 Ford Fusion Hybrid 2.0L | $21–$128 |
| Camshaft position sensor | |
| 2015 Lincoln MKZ Hybrid 2.0L | $21–$128 |
| Camshaft position sensor | |
Buying the part yourself, known brands from one large online catalog: $13–$51, part only.
Not priced Labor only No figure
Labor isn't priced, because no carmaker labor time is available for the sensor or the oil change. The harness and connector repairs on other cars aren't priced either, for the same reason. Ask for the hours and the rate, and whether the quote includes the oil change. Not included: labor, tax, shop fees and diagnosis.
Set by each shop, may be waived if you approve the repair or it's covered. Ask for it in writing first.
Notes
Prices read November 17, 2026. Not included: tax, shop fees and diagnosis.
What other codes show up with P0340?
P0340 can set with other camshaft and sensor codes, such as P0341, P0344, P0345, P0365 and P0390. A scan that shows P0340 may show them too.
A shop reads every stored code together before it tests a part. For cam timing codes, see P0014 Code and P0016 Code.
From the carmakers
What do the carmakers' documents say about P0340?
Carmakers have published 64 bulletins that name P0340, from 16 makes. NHTSA lists 36 complaints that name it, and owners type P0365 (6) next to it most, then P0344 (5), P0299 (4) and P0014 (4). Five of the bulletins are below.
Service bulletin Ford SSM 48598
"…may exhibit a MIL with Diagnostic Trouble Code (DTC) P0340 and/or P0344. This may occur due to excessive moisture build up in the engine oil."
Service bulletin GM PIP5335D
"…If normal SI Diagnostics does not isolate the concern, inspect for corrosion in connector X154 or X159 (2015 only) located on the front cover next to the vacuum pump."
Service bulletin GM 21-NA-149
"…These concerns may be caused by engine harness contact with under hood components."
Service bulletin Ford SSM 50245
"…loss of voltage reference (VREF) from the 14290 harness above the steering shaft u-joint."
Service bulletin Stellantis 18-073-26
"CAUSE: PCM software."
Conclusion
What to do next about a P0340 code
If the car stalls, stop where it's safe and call for help. If the code came back after a new sensor, ask which part of the circuit the shop tested, and if your car is one of the models named on this page, ask the dealer whether a bulletin applies to it.
Oil & Miles checks each step here against carmakers' bulletins and service manuals, and parts makers' technical pages.
Common questions
Asked most often
Is P0340 always the camshaft sensor?
No. The code points to the sensor circuit, and the cause can also be oil moisture, a connector, a harness, a weak battery or software.
Is P0340 the timing chain?
The code doesn't point there by itself. P0340 is a circuit code, and its causes are a connector, a harness, the sensor, a weak battery, software and oil moisture, and for cam and crank signals that disagree, see P0016 Code.
Can short trips cause P0340?
On some Ford hybrids, moisture can build up in the oil when the car is driven short distances or under 6,000 miles a year, and that can set P0340.
Sources
- Ford service bulletins SSM 48598 and SSM 50245, for the oil moisture and the harness at the steering shaft. Ford, read November 16, 2026
- GM service bulletins PIP5335D (November 2019) and 21-NA-149 (March 2023), for the connector and the engine harness. GM, read November 16, 2026
- Stellantis service bulletin 18-073-26, July 22, 2026, for the engine computer reprogram. Stellantis, read November 16, 2026
- Saab Workshop Information System, "DTC P0340 Camshaft Position Sensor A Circuit (Bank 1 or Single Sensor)," 9-2X (9346) 2005, 2.5i, and the camshaft position sensor removal text for the 9-3 (9440) 2006, 1.8 XE gasoline, for how a shop diagnoses the code and where the sensor sits. Saab, read November 17, 2026
- Standard Motor Products (BWD), "Camshaft and Crankshaft Sensors" training page, for where the sensor sits and the scan-tool test. Standard Motor Products, read November 17, 2026
- HELLA, "Camshaft position sensor" technical page, for the encoder wheel and the supply check. HELLA, read November 17, 2026
- Lexus L-TT-0007-10 (April 29, 2014), Toyota T-TT-0010-10 (May 1, 2014) and GM PIP5482A (September 13, 2017), for low battery voltage. Lexus, Toyota and GM, read November 17, 2026
- Standard Motor Products, "What Are Camshaft and Crankshaft Position Sensors" training page, for the causes and the technician advice. Standard Motor Products, read November 17, 2026
The repair steps and the causes come from the carmakers' own bulletins and service text, and the complaint counts come from NHTSA's public files.
Illustration by Oil & Miles
This article is general information, not advice about your specific vehicle. See the disclaimer.
