Please need help. car is stalling while driving and while at stop lights and turns. 98 maxima

my car has been stalling out while at stop lights and while driving as well as spuddering and hesitating . i brought it in to the shop twice and both times they said it ran fine . they ran the code and gave me a new oxygen sensor and it still stalled. i brought it to autozone today and they ran the code and camshaft position sensor came up. so i put a new one in and it still is stalling and hesitating to drive. also smells really bad when it kick in. do u have any idea what could be wrong . short circuit or wiring trouble maybe? i have no idea and nobody can give me a straight answer. fuel pump ? crankshaft? electrical problem? spark plugs? cant get a straight answer.

What was/were the exact codes pulled by the shop you brought it to? (format: “P0123”)

What was/were the exact codes pulled when you went to Autozone? There isn’t a code that can tell you that you need a new cam sensor.

How many miles are on it? How old are the plugs and wires? Filters? What else can you say about normal maintenance stuff - other than just oil changes? Did your shop happen to check the fuel pressure?

the paper reads : OEM Number to cross: P0340

Definition
aa camshaft position sensor (cmp) circuit-bank 1
Probable cause
aa.- open or short circuit condition
aa2. - poor electrical connection
aa3- weak battery condition
aa4-faulty cmp

about 160,000 miles on it. not sure how old the plugs and wires are . i replaced camshaft sensor and o2 sensor and still stalling. shop said it ran fine. but if you drive the thing for 10 min itll kick in. i normally wouldnt care about car stuff but this is dangerous .

Un plug the MAF and drive it.

Note that your Probable cause list puts faulty sensor last. The code itself refers to the sensor’s circuit. Since you did replace the sensor and the problem persists, that’s pretty good “diagnostic” evidence that the problem wasn’t in the sensor. So yes, the next thing you have to do is check its wiring. Always start with a visual inspection. Then you may have to break out a multimeter and check power, ground, and continuity on the wires.

brought it back to a new shop … hopefully someone can figure whats wrong with it

I am not a mechanic, so this is a shot in the dark. You said it “smells bad…” Rotten egg smell bad? If it has a catalytic converter, see if it is plugged. The wife’s mini-van had stalling issues, some days it would start and other days would not…But the exhaust stunk. She had a cannon ball in the catalytic converter that would shift and sometime let it run and sometimes not.

Personally, I like to look at the spark plugs first. If you can reach just one fairly easily, its condition can tell you a lot about how long they’ve been in there. You’d be surprised how much of a difference a fresh set of plugs can make.

+1 to BustedKnuckles’ comment.

My first thought–aside from a probable MAF problem–was that this was likely to be a car that had not been properly maintained. Then, after reading “not sure how old the plugs and wires are” regarding this 160k car, I am even more sure than before that lax maintenance is at least part of the problem.