P0335 P0340 LS
TL;DR: P0335 is a crankshaft position sensor circuit fault and P0340 is a camshaft position sensor circuit fault. On a stock LS they usually come down to a failed sensor, a damaged connector or wiring, or an oil-soaked or loose sensor. On a swapped or rebuilt LS there is a fourth cause that catches people out: a crank reluctor, crank sensor, cam sensor and engine computer that were not designed to work together. GM used two crank trigger systems across the LS family, 24x and 58x, plus two different cam sensor arrangements. Mixing them sets these codes or stops the engine starting at all. Identify what you have before buying a sensor.
Two codes, two circuits
The crank and cam sensors are separate circuits, and each code is judged on its own.
- P0335 sets when the computer gets no usable crank signal, or the wrong number of pulses for what it expects.
- P0340 sets when the cam signal is missing or does not make sense against the crank signal.
Do not replace the cam sensor because of P0335, or the crank sensor because of P0340. If both set together, look for something they share: a common supply or ground, a harness chafed near both, or a computer that does not match the trigger wheels.
How the engine behaves tells you a lot. Lose the crank signal and many LS engines will not start, or will stall and then restart in a limp mode using the cam signal to estimate speed. Lose the cam signal and the engine usually starts and runs, sometimes after a longer crank, because the computer falls back on less precise fuel timing.
24x versus 58x in plain terms
The crankshaft carries a toothed reluctor wheel. The crank sensor reads the teeth and the gap, and the computer works out speed and position from the pattern.
| 24x system | 58x system | |
|---|---|---|
| Family | Gen III LS (the earlier engines) | Gen IV LS (later engines) |
| Crank reluctor | 24 teeth pattern | 58 teeth with a gap |
| Cam sensor location | Rear of the block, behind the intake | Front timing cover |
| Cam signal | Single pulse per cam turn | Four-pulse pattern |
| Matching computer | Gen III era engine computer | Gen IV era engine computer |
The changeover did not happen in every vehicle line in the same model year, so do not identify the system by year alone. Look at the engine and confirm with part numbers: where the cam sensor sits is a quick visual tell, and the crank sensor and reluctor part numbers settle it.
The rule that matters: the crank reluctor, crank sensor, cam sensor and computer must all belong to the same system. A 58x sensor reading a 24x wheel, or a 24x wheel feeding a 58x computer, produces a signal the computer cannot use.
The swap and rebuild traps
These are the mismatches that set P0335 and P0340 on swapped and rebuilt engines:
- Gen IV crank installed in a Gen III build, or the other way round. The reluctor is pressed onto the crankshaft. A crank from a different generation brings its wheel with it.
- Front cover swapped without thinking about the cam sensor. A Gen IV front cover has the cam sensor provision. A Gen III cover does not. Swap one for the other and you either have no cam sensor or one reading the wrong target.
- Camshaft from the other generation. The cam's reluctor pattern has to match the cam sensor arrangement and computer.
- Computer from a different engine than the block. Fine if the trigger wheels match it. Not fine if they don't.
- Converter boxes. Signal converters exist for running one system's computer on the other system's engine. When they work they are invisible. When they fail or are wired wrong they set these exact codes.
If the engine has been apart, check every one of these before suspecting a new sensor.
Testing a stock LS
Check the obvious first
- Connector. Pins bent or pushed back, green corrosion, a cracked locking tab, oil inside the connector body.
- Harness. The crank sensor sits low on the block near hot exhaust and moving parts on many chassis. Look for melted insulation and rubbed-through wires.
- Sensor mounting. The sensor must be fully seated and its bolt tight. A sensor sitting proud of its bore has too large a gap to the wheel.
- Oil. An oil leak that has soaked the sensor and connector is common on high-mileage engines. Fix the leak or the new sensor will go the same way.
Electrical checks
LS crank and cam sensors are three-wire sensors: supply, ground and signal. With the connector unplugged and the key on, check the supply against the wiring diagram for your engine and confirm a good ground. Then check each wire back to the computer for opens and shorts. A supply or ground fault that is shared between sensors explains both codes at once.
Signal checks
A scan tool showing engine RPM while cranking is a simple first check. No RPM while cranking with P0335 means the computer is not seeing the crank signal at all.
A lab scope on the signal wire is the proper test. A healthy sensor makes a clean square wave whose pattern matches the reluctor. Dropouts, missing teeth or noise on the trace point at the sensor, the gap, or damage to the wheel.
Mechanical checks
On rare occasions the reluctor wheel itself is the problem: damaged during a rebuild, or loose on the crank. That needs the engine apart to confirm, so rule out everything else first.
Fixing it
| Finding | Repair |
|---|---|
| Damaged connector or chafed wires | Repair the harness properly, solder and seal, reroute away from heat |
| No supply or bad ground | Trace and repair the circuit before fitting any sensor |
| Sensor fails signal test, wiring good | Replace the sensor with the correct 24x or 58x part |
| Mismatched parts after a swap | Make every component match one system, or use a correctly wired converter |
| Oil-soaked sensor | Replace the sensor and fix the leak |
When fitting a new sensor, lubricate the O-ring lightly with clean engine oil, push it fully home without forcing it, and torque the bolt to the service manual value. Clear the codes. Some computers need a crankshaft position variation relearn after a crank sensor or reluctor change, so check the service information for your engine and run it with a capable scan tool.
Buying the right sensor
Confirm the system first, then the part. Give the parts supplier the engine, the vehicle the computer came from, and the system you have confirmed. Check the replacement against the manufacturer catalogue rather than going by appearance, because several LS sensors look almost identical but are not interchangeable.
Frequently Asked Questions
What is the difference between P0335 and P0340 on an LS? P0335 is a crank sensor circuit fault and P0340 is a cam sensor circuit fault. They are separate circuits. Each points at its own sensor and wiring unless both set together.
How do I tell if my LS is 24x or 58x? Look at where the cam sensor is. A sensor in the front timing cover usually means a later 58x engine. A sensor at the rear of the block usually means a 24x engine. Confirm with the crank sensor and reluctor part numbers.
Will a 58x crank sensor work on a 24x engine? No. The sensor, reluctor wheel and computer must all belong to the same system. A mismatch gives the computer a signal it cannot use.
Why does my LS swap set P0335 even with a new sensor? Usually a mismatch: a crank, front cover, camshaft or computer from the other generation. Check that every trigger part and the computer belong to the same system.
Can a bad crank sensor cause a no-start on an LS? Yes. With no crank signal the computer often cannot time spark and fuel at all. Check for RPM on a scan tool while cranking to confirm.
Do I need a relearn after replacing an LS crank sensor? Some engines and computers require a crankshaft position variation relearn after a crank sensor or reluctor change. Check the service information for your engine.
Shop the parts
Orders over $70 ship free to the lower 48 states. Not sure whether you need the 24x or 58x part? Email sales@coretransmissionparts.com with the engine and computer details.
Sources
- GM service information excerpts on P0335 crank sensor diagnosis, quoted in the DF Kit Car forum thread on P0335
- GM diagnostic notes on crank signal loss and limp mode on camshaft-sensor speed calculation
- Tahoe Yukon Forum thread on recurring P0335 on GM V8 trucks
- iATN technician summary on P0335 diagnosis