What a camshaft position sensor does and why it fails

A camshaft position sensor tells your engine's computer where the camshaft is in its rotation cycle. The camshaft controls when your intake and exhaust valves open and close—the timing that makes combustion happen. Without accurate position data, the computer cannot fire the spark plugs at the right moment, cannot inject fuel correctly, and cannot control emission systems. The engine will run rough, hesitate, or not start at all.

These sensors fail because they sit in hot engine oil and vibrate constantly. The wiring corrodes, the sensor tip gets coated with sludge, or the magnet inside wears out. When one fails, you get a check engine light—usually code P0340, P0345, or P0010 depending on which sensor and which bank of cylinders. Replacing it is straightforward on most cars and costs far less than ignoring it and damaging your catalytic converter or fuel injectors.

Key Takeaways

  • Camshaft position sensors sit on or in the cylinder head, usually near the top of the engine, and take 30 minutes to 2 hours to replace depending on engine layout.
  • You need a socket set, a wrench, a screwdriver, and sometimes a special sensor socket—check your vehicle's service manual to see which tools your specific engine requires.
  • Disconnect the negative battery terminal before you start work to prevent electrical shorts and accidental airbag deployment.
  • The sensor connector unplugs easily, but the mounting bolt can seize; explore penetrating oil and let it soak if it will not turn.
  • After installation, clear the check engine code with a scanner or by disconnecting the battery for 15 minutes, then test-drive to confirm the light does not return.

Locate the sensor and gather your tools

Open your hood and look at the top of the engine. Most camshaft position sensors bolt to the cylinder head near the valve cover, either on the intake or exhaust side. Some sit inside the valve cover itself. Your vehicle's service manual or a repair database like AllData or Haynes will show you the exact location for your make, model, and year. Take a photo of the sensor and its wiring before you touch anything—it helps you remember how the connector sits.

Gather a socket set, an adjustable wrench, a flathead and Phillips screwdriver, and penetrating oil like PB Blaster or Liquid Wrench. Many sensors need a special deep socket to reach the mounting bolt without hitting the connector. Check your manual or call a parts store with your vehicle's year, make, and model—they can tell you whether you need that socket before you buy it. Have a clean rag and a small container ready to hold the bolt and connector clip so you do not lose them.

Disconnect the battery and unplug the sensor

Turn off the engine and let it cool for at least 15 minutes. Open the driver's door and locate the negative battery terminal—it is marked with a minus sign and usually has a black cable. Use a wrench to loosen the nut on the terminal and slide the cable off. This step prevents electrical damage and stops the engine computer from logging fault codes while you work.

Walk back to the sensor. Look at the wiring connector—it usually has a small tab or clip on the side. Press or pull that tab and the connector will slide out. Some connectors are tight; wiggle gently while you pull. Do not yank the wires themselves. If the connector is stuck, spray a little penetrating oil around the base and wait five minutes before trying again.

Remove the mounting bolt and sensor body

The sensor bolts to the cylinder head with one or two bolts, usually M6 or M8 size. Spray penetrating oil around the bolt head and let it soak for five minutes—old bolts can seize and snap if you force them. Use your socket and ratchet to turn the bolt counterclockwise. If it resists, stop, spray more oil, wait another five minutes, and try again. Patience here saves you from a broken bolt that requires drilling out.

Once the bolt is loose, unscrew it by hand and set it aside. Gently pull the sensor straight out of its hole. Some sensors have an O-ring seal; if it sticks to the hole, use a plastic pry tool or old credit card to ease it out. Do not use a metal screwdriver—you can scratch the bore and cause an oil leak. Wipe the hole clean with a dry rag.

Install the new sensor and reconnect everything

Check that the new sensor matches the old one—same part number, same connector style, same length. Slide the new sensor into the hole straight and level. If your sensor has an O-ring, make sure it is seated in the groove and has not twisted. Thread the mounting bolt by hand first to avoid cross-threading, then tighten it with your socket. Most camshaft sensors torque to 80 to 106 inch-pounds—check your manual for the exact value. That is snug but not cranked down hard; over-tightening can crack the sensor body.

Plug the connector back in until you hear or feel a click. Reconnect the negative battery terminal and tighten the nut. Turn the ignition key to the "On" position without starting the engine and listen for the fuel pump to run for a few seconds—that means the computer is awake. Start the engine. If it starts and runs smoothly, you are done. If the check engine light stays on, the code may not clear when ready; drive for 50 to 100 miles and check again.

Clear the check engine code and test the repair

If the check engine light remains after a few days of driving, use an OBD2 scanner to read the code. Many auto parts stores will scan for free. If the code is still P0340, P0345, or P0010, the new sensor may be defective, the wiring may be damaged, or the connector may not be fully seated. Unplug the connector, look inside for bent pins or corrosion, and reseat it firmly. If the connector looks clean and the light still does not go out, the sensor may need to be replaced again under warranty.

If the code clears and the light goes out, the job is complete. The engine should idle smoothly, start without hesitation, and show no rough running or hesitation under acceleration. If you notice any of those symptoms returning within a few weeks, the wiring harness may be damaged or a second sensor on the other bank may be failing. Have the code read again to confirm which sensor is the problem.

Frequently Asked Questions

Can I drive with a bad camshaft position sensor?

You can drive short distances, but the engine will run rough, use more fuel, and may not start reliably. Continuing to drive stresses the catalytic converter and fuel injectors. Replace it as soon as you can to avoid a much larger repair bill.

What if the mounting bolt breaks while I am removing it?

Stop when ready and do not force it further. Spray penetrating oil and wait 24 hours. If it still will not budge, you will need to drill it out carefully with a bit slightly smaller than the bolt diameter, then use a screw extractor tool to remove the broken piece. This is a job for a shop if you have not done it before.

Do I need to replace the O-ring seal?

Most new sensors come with a fresh O-ring already installed. If your old sensor's ring is still on the cylinder head, remove it and discard it. Do not reuse old seals—they harden and leak. If the new sensor does not have a ring and the old one is missing, buy a replacement O-ring from the parts store.

How do I know which sensor to buy if my car has two?

Check your check engine code. P0340 or P0345 usually means the intake camshaft sensor. P0010 or P0015 usually means the exhaust camshaft sensor. Your service manual will confirm which one your code points to. Buy only the one that is failing unless the code says both are bad.

Will the sensor work right away or does it need to relearn?

The sensor works when ready once you plug it in and reconnect the battery. The engine computer does not need a relearn cycle for a camshaft sensor the way it does for some other parts. The light may take a few driving cycles to clear, but the sensor is functional from the moment you start the engine.