← Back to list

2002 Hyundai Sonata P0340 Fault: Diagnosis and Common Fixes After Timing Belt Replacement

Model: 2002 Hyundai Sonata Fault Code: P0340 Posted: 2007-07-27 09:09

My 2002 Hyundai Sonata (2.4L MFI DOHC engine) has developed a P0340 fault at around 105,000 miles. The car runs smoothly when cold but begins to misfire and lose power after warming up—typically within 10 miles of driving. The check engine light comes on intermittently and turns off when the throttle is released. If I shut it off, it may restart briefly but runs very roughly, almost as if flooding. I have already replaced: timing belt, spark plugs and wires, both ignition coils, and the camshaft position sensor (twice). Despite these repairs, the issue persists. The only remaining component I haven't ruled out is the Powertrain Control Module (PCM). The P0340 code indicates a malfunction in the Camshaft Position Sensor (CMP) circuit—specifically an erratic or absent signal from the sensor to the PCM. This could stem from wiring issues, mechanical misalignment, or faulty components. Key diagnostic steps I recommend: - Visually inspect all three wires of the CMP sensor: power (steady reference voltage), ground, and signal wire (should show a square wave). - Use an oscilloscope for accurate signal analysis; if not available, a high-quality voltmeter can provide basic confirmation. - Verify that the engine is properly timed—especially during installation. A single tooth misalignment can cause severe idle issues or misfires. - Check compression on all cylinders to rule out head valve-to-piston contact (a known issue in this model when timing is off). I suspect a wiring fault, especially if the sensor appears physically intact but fails intermittently. Given that multiple users have reported similar symptoms after replacing parts without proper diagnosis, I believe a thorough circuit check is essential before considering PCM replacement—especially since it's expensive and not always the root cause.

Related fault codes
P0340
Comments (14)
Anonymous 2007-07-27 09:40

Do not replace the PCM as the first step. You've already replaced most common components—timing belt, coils, plugs, wires, and sensor twice. Now focus on diagnosing the actual issue. Visually inspect the camshaft position sensor wiring for breaks or corrosion. There are three wires: power (constant reference voltage), ground, and signal (should show a clean square wave). Use an oscilloscope for accurate diagnosis; if unavailable, a digital voltmeter can still give basic insight. The P0340 code appears when the PCM detects erratic or missing signals from the cam sensor—this points to possible open or short circuits in any of these wires. Check all connections thoroughly and post your findings.

Anonymous 2007-07-27 12:33

Is the engine timing correctly aligned? A single tooth misalignment can cause severe running issues, especially after a timing belt replacement.

Anonymous 2007-07-29 08:39

I experienced a similar issue on my 2001 Sonata. Initially, I thought it was a faulty PCM—after replacing the cam sensor and timing belt, the problem persisted. Upon inspecting the wiring, we found that the original cam sensor was defective from day one. We replaced the computer (cost ~$500), but it didn’t fix the issue. The real culprit was the bad cam sensor installation. Always follow the vehicle manual precisely during assembly—especially when aligning the cams and balance shaft. Using a special tool to hold the cams in place while installing the timing belt is critical. Also, ensure proper alignment of the balance shaft. Before spending more money on parts or repairs, verify that all cylinders have good compression. These engines are prone to valve-to-piston contact if timing is off.

Anonymous 2007-07-30 10:51

It seems like no one is actively engaging with this thread—please respond to the diagnostic steps outlined above rather than just sharing opinions.

Anonymous 2007-07-30 11:27

The camshaft timing is correct. I’ve verified it using a timing light and manual alignment tools.

Anonymous 2007-07-30 11:58

Have you checked the wiring harness for the cam sensor? Did you visually inspect the connections or test continuity on all three wires (power, ground, signal)?

Anonymous 2007-07-30 12:03

I'm currently examining the wiring and connections to the camshaft position sensor. Will update with results shortly.

Anonymous 2007-12-04 19:00

I have the exact same problem on my 2000 Sonata—after replacing the crankshaft position sensor, the car dies after about 10 miles and shows P0340 along with cylinder misfires. No other work was done. Any suggestions? I'm at 75k miles. Tom

Anonymous 2007-12-04 22:49

Please go back through earlier posts and complete the diagnostic steps—especially visual inspection of wiring, signal testing, and compression checks—before posting new updates or suggesting part replacements.

Anonymous 2007-12-09 02:42

The issue was a faulty ignition coil on cylinders 2 and 3. After replacing both coils, the problem resolved completely.

Anonymous 2008-11-17 09:59

I had an older 2002 Sonata with no check engine codes but experienced stumbling after 15 minutes of traffic driving. I found a bad coil on cylinders 1 and 4—replaced both. Another owner now has the same P0340 code and intermittent cut-out while driving, which resolves after restarting. This suggests ignition coil failure could be a contributing factor in some cases.

Anonymous 2008-11-29 00:31

I have the same issue on my 2000 Sonata. The check engine light shows 'crankshaft sensor fault,' and the car shuts down after 15 miles, then starts briefly. I replaced the crankshaft sensor and re-timed it to T-mark. Now only cylinders 1 and 3 fire—when I manually cross-test coils on cylinders 2 and 4, they spark. The timing was confirmed by Pep Boys, but they couldn’t identify the root cause. Interestingly, when I remove the cam sensor, no fault light appears. This raises a possibility of a short in the control module or wiring harness causing false signals. Could a shorted control box be responsible for misfires and P0340? Worth investigating.

Anonymous 2008-11-29 20:00

After having Pep Boys perform a full diagnostic test, I discovered that during my own assembly (or possibly by a technician), one of the coil pack wires was incorrectly connected—this caused the engine to behave as if timing or cam sensor were faulty. The issue wasn’t with the PCM or sensor but with wiring errors introduced during reassembly. A $89 diagnostic at Pep Boys revealed this, though I wouldn’t trust their findings. This highlights how improper installation can mimic serious electronic faults.

Anonymous 2011-12-04 17:40

I recently had a similar case in the shop. The car would not start—another technician replaced the cam sensor without diagnosis and found no improvement. After deeper inspection, we discovered that the timing belt was stripped. We replaced the timing belt, balance shaft belt, water pump, and fixed a broken connector on the cam sensor. Initially, it ran fine until warmed up, then began stumbling progressively until stalling—after which it would not restart. The idle crankshaft frequency was around 30 Hz, while cam signal was only ~15 Hz. All data from Alldata pointed to a failing PCM. After replacing the cam sensor with a new one (but keeping the original crank sensor), the problem persisted. Then we removed the timing belt and replaced the original crank sensor—after which the car ran perfectly until warm-up, then began misfiring again. The real fix came when we replaced the crank sensor with a new one and reassembled everything correctly. I now recommend that every 2002 Hyundai Sonata with a timing belt replacement includes a new crankshaft position sensor to prevent future issues. This is especially true for Mitsu-style engines where pickup wheel wear or cracks can go unnoticed.