What a camshaft position sensor does and why it fails

Your camshaft position sensor tells your engine's computer exactly where the camshaft is at any given moment. The camshaft controls when your intake and exhaust valves open and close. Without accurate position data, your engine can't time the fuel injection and spark plugs correctly, which means it runs rough, loses power, or won't start at all.

These sensors fail because they sit in a hot, dirty engine bay and take constant vibration. The wiring corrodes, the sensor itself gets coated with oil and carbon buildup, or the internal electronics straightforward wear out. Most sensors last between 80,000 and 150,000 miles, though some fail much earlier if the engine runs too hot or oil changes are skipped.

When one fails, your check engine light comes on, and your engine computer stores a diagnostic trouble code — usually P0340, P0341, P0342, or P0343, depending on which sensor and what went wrong. You'll often notice the engine running rough at idle, hesitation during acceleration, or difficulty starting.

Key Takeaways

  • Camshaft position sensor replacement typically costs between $150 and $400 in labor plus $50 to $250 for the sensor itself, depending on your vehicle's make and model.
  • The sensor is usually located on or near the cylinder head, but some vehicles have two sensors (one for intake, one for exhaust), and access varies widely.
  • A mechanic will confirm the sensor is bad by reading the diagnostic code with a scanner and sometimes testing the sensor's electrical output before replacing it.
  • Replacement is straightforward on many vehicles but can require removing other components like the valve cover or intake manifold on others, which adds time and cost.
  • Ignoring a failed sensor risks stalling, poor fuel economy, and potential damage to the catalytic converter if the engine runs too rich for too long.

How much replacement costs and what affects the price

Parts cost between $50 and $250 depending on whether you buy OEM (original equipment manufacturer) or aftermarket, and which vehicle you drive. Labor typically runs $150 to $400, though some shops charge flat rates while others charge hourly. A Honda Civic might take 30 minutes and cost $250 total; a Dodge Ram with a sensor buried under the intake manifold might take two hours and cost $500 or more.

The biggest variable is how hard the sensor is to reach. On some vehicles, the sensor bolts directly to the cylinder head with nothing in the way. On others, the mechanic has to remove the valve cover, timing cover, or intake manifold just to see it. If your vehicle needs that extra work, labor can double.

Independent shops often charge less than dealerships for the same job. A dealership might charge $400 to $600 total; an independent shop might do it for $250 to $350. The trade-off is that dealerships use OEM parts with a warranty, while independents may use aftermarket sensors that cost less but sometimes fail sooner.

Where the sensor sits and why location matters

Most vehicles have at least one camshaft position sensor mounted on the cylinder head, near the camshaft itself. Some engines have two — one for the intake camshaft and one for the exhaust camshaft. A few vehicles mount the sensor inside the distributor or on the crankshaft instead, which changes both the diagnosis and the replacement process.

On a four-cylinder engine with a straightforward layout, the sensor might be a bolt-on part that takes 15 minutes to swap. On a V6 or V8, especially if the sensor is on the back of the cylinder head, the mechanic may have to remove the intake manifold, fuel rail, or other components to reach it. Some luxury vehicles require removing the entire valve cover assembly.

Your mechanic should tell you upfront whether the sensor is straightforward to reach or buried. If it's buried, ask whether removing those other parts is necessary or whether there's an alternative approach. Sometimes there isn't — the design of the engine straightforward requires it.

How a mechanic diagnoses a bad sensor before replacing it

The first step is reading the diagnostic trouble code with a scanner. A code like P0340 means "camshaft position sensor circuit malfunction," but it doesn't always mean the sensor itself is bad — it could be a wiring problem, a connector issue, or a problem with the engine computer. A good mechanic will check the code, then test the sensor's output to confirm it's actually failing.

Testing involves connecting a multimeter or scope to the sensor's wiring and checking whether it's producing the right voltage signal as the engine runs. If the signal is weak, missing, or wrong, the sensor is bad. If the signal looks good but the code is still there, the problem might be in the wiring, the connector, or the computer itself.

Some shops will replace the sensor without testing first, especially if the code is clear. Others charge a small diagnostic fee (usually $50 to $100) to test before replacing. It's worth paying for the test if you want to avoid replacing a good sensor, but if the code is P0340 or P0341 and the engine is running rough, the sensor is usually the culprit.

What happens during replacement and what to expect afterward

The mechanic will disconnect the battery, locate the sensor, unplug its electrical connector, and unbolt it from the engine. If other components are in the way, those come off first. The new sensor goes in, the connector plugs back in, and everything is reassembled in reverse order.

After replacement, the mechanic will clear the diagnostic code and start the engine to make sure it runs smoothly. The check engine light should stay off. Some vehicles require a relearn procedure — the engine computer needs to relearn the sensor's signal pattern — but most modern cars do this automatically after a few drive cycles.

You should notice the engine running smoother, starting more easily, and returning to normal fuel economy. If the check engine light comes back on within a few days, there may be a wiring problem, a bad connector, or a second failed sensor that wasn't caught the first time.

When to replace both sensors if your vehicle has two

If your engine has two camshaft position sensors and one has failed, the question is whether to replace just the bad one or both at once. Most mechanics recommend replacing just the failed sensor unless the other one is also showing signs of age or the vehicle has high mileage.

However, if both sensors are original to the vehicle and the car has 120,000 miles or more, replacing both at the same time can make sense. You'll pay for two sensors and a bit more labor, but you avoid a second breakdown a few months later. Ask your mechanic whether the second sensor looks clean and healthy or if it's already showing corrosion or oil buildup.

If the vehicle is still under warranty, check whether the warranty covers sensor replacement. Some warranties cover the sensor but not the labor, or vice versa. Knowing this before you authorize work can save you money.

Risks of driving with a failed sensor

A failed camshaft position sensor won't leave you stranded when ready, but it will get worse. Early on, you might notice rough idle or hesitation. As the sensor degrades further, the engine may stall at stops, fail to start on the first try, or lose power during acceleration.

Driving with a failed sensor also causes the engine to run too rich — too much fuel, not enough air — which wastes gas and can damage the catalytic converter over time. If you ignore it long enough, you may face a much larger repair bill. Additionally, if the sensor fails completely while you're driving, the engine may shut down without warning.

The check engine light is your signal to have it diagnosed. You don't have to stop driving when ready, but you should get it checked within a week or two. Waiting months increases the risk of secondary damage.

Frequently Asked Questions

Can I replace the camshaft position sensor myself?

If you have basic mechanical skills and the sensor is straightforward to reach on your vehicle, yes. You'll need a socket set, a multimeter to test the old sensor, and the new sensor. The hardest part is usually getting the connector unplugged without breaking it. If the sensor is buried under other components, it's better to let a mechanic handle it.

Will the engine run at all if the camshaft position sensor is completely dead?

Most modern engines won't start if the sensor signal is completely missing, because the computer can't time the fuel injection. Older vehicles with mechanical fuel injection might run briefly, but very poorly. If your engine won't start and the code is P0340, the sensor is the likely cause.

How do I know if it's the camshaft sensor and not something else?

Have the diagnostic code read with a scanner. Codes P0340 through P0343 point to the camshaft position sensor circuit. If the code is something else — like P0300 (random misfire) or P0171 (fuel system too lean) — the problem is elsewhere. A mechanic can test the sensor's output to confirm it's actually failing.

Does the sensor need to be OEM or can I use an aftermarket one?

Aftermarket sensors work on most vehicles and cost less than OEM parts. The trade-off is that some aftermarket sensors fail sooner or produce inconsistent signals. OEM sensors usually last longer and come with a warranty. Ask your mechanic which brand they recommend for your specific vehicle.

What if the check engine light comes back after replacement?

The new sensor might be defective, the wiring might be damaged, or there could be a second failed sensor. Have the code read again and tell your mechanic the light returned. If the same code comes back, the replacement sensor may be bad and should be swapped under warranty. If a different code appears, there's a separate problem.