Erratic idle speed is usually caused by a vacuum leak, but typically doesn't run okay at times. Unstable readings from temperature sensors can cause that too. The sensors themselves cause very little trouble because there's just one component inside them. The readings bounce around more often due to corroded terminals in the connectors, or other wiring problems.
With intermittent problems like this, the best place to start is by connecting a scanner so you can view live data and see what the Engine Computer is responding to. For example, when the engine is still cold, you know the coolant temperature sensor had better be reading the same as the intake air temperature sensor. Also, you can watch what the computer is requesting for idle speed. If you see it request a lower speed when actual speed goes up, the computer is trying to lower it, but without success. That would point to a vacuum leak. If you see the request is for an increase in idle speed, when the actual speed does go up, look at the sensor readings to see which one seems to not correlate with the actual conditions. For example, if it's fifty degrees, the engine is warmed up, and suddenly the coolant temperature sensor reports minus 20 degrees, that is an acceptable value to the computer, so it won't set a diagnostic fault code, but it is an incorrect reading for the current conditions. That would tell you to look at the coolant temperature sensor circuit.
Also read and record any diagnostic fault codes. Fault codes typically do not set just from a sensor reading being off a little. There has to be something to force the reading to go all the way to an extreme to trigger a fault code. Be aware too that only those codes related to things that could adversely affect emissions turn on the Check Engine light. There are fault codes that don't turn the Check Engine light on, but they can be just as useful in diagnosing this type of problem.
Monday, May 1st, 2017 AT 4:16 PM