Engine Idle Speed Problem

I recently had my Throttle Position Sensor replaced because my engine was idling between 1500 and 2000 rps, but instead of idling steady it revs between 1500 and 2000 anytime i’m in neutral or the clutch is in. This also prevents me from driving much slower than 40mph when in 4th gear without the engine shuttering. I had my TPS replaced and two days later the same problem came back so i brought it into the dealership again and they said they had to teach the car how to idle again. This temporarily fixed the problem but it returned again a few hours later. Now they’re telling me i need a new ECM (electronic computer module) because it’s shorting out. This will cost me around $700 and i’m not convinced this is the solution.

I would appreciate any advice or help.

I have never heard of an idle speed problem being caused by an ECM.

I would bet on an air leak somewhere.

You did not mention what kind of car it is.

It’s a 2002 Nissan Sentra.
Well, it’s mostly an idle problem except that the engine revs up and down between 1500 and 2000 constantly it doesn’t just sit at a high idle speed.
Would this still be an air leak?
Thanks for your response!

yes this could be an air leak, look for a loose hose, or a cracked one. Sometimes the intake manifold is warped or loose and air can leak past the gasket. But it could also be a mass airflow sensor. There is a ram chip on the ECM, and that is what they flashed, (teaching the ECM to control the idle) these chips can fail, or if they get inconsistent input from the sensors, that will cause them to self re-program to the wrong settings. I bet it is a bad sensor, either the mas, or the crankshaft position sensor. are there any codes?