As stated earlier, issues with some of the sensors listed at the beginning of this article can cause an idle issue. So if you have a check engine light on for any one of those systems or sensors and you have an idle problem, fix what's causing the check engine light to come on and recheck for the idle problem. Lots of people go for the TPS (throttle position sensor) if they have an idle problem. I say if you don't have a code for it, look elsewhere first.
Before you replace a TPS, first check to make sure it's functioning properly. There is a mechanical issue that can cause the TPS to not read correctly: an improperly adjusted throttle linkage. Though this will cause the TPS to not read correctly, the sensor itself is good. Normally, you would not adjust a throttle cable, but say you just removed the intake manifold and had to remove the throttle cable to perform that repair. If it's not reinstalled correctly, it can cause the TPS readings to be off, and as a result cause an idle problem. The computer needs to see that the throttle is closed before it sets the engine idle. If it doesn't see a closed throttle, it will never go into idle mode. Here's a video on throttle cable adjustment that you might find helpful if you run into this problem.
Another common sensor issue that can cause idle problems is the coolant temperature sensor. There are a few acronyms for this, such as the CTS (coolant temperature sensor) or TW (temperature water) sensor. Different manufacturers call it different things, but its function is the same. Coolant temperature sensors monitor coolant temperature and send the readings to the computer. It's probably one of the most important inputs to the PCM.
The coolant temp sensor is kind of like the choke on an older carbureted engine. As the engine warms up, different things begin to happen or need to happen. Engine temperature is the cue for many of the events in a fuel injection strategy. With fuel injected applications, engine temperature is critical to many engine functions. If you have an idle problem and a CEL (check engine light) code for the coolant temperature sensor, address the coolant temperature sensor and then recheck for the idle problem.
In addition to coolant temperature sensor issues, O2 sensors can also be the cause of an idle issue. When the engine goes into closed loop, the computer uses the O2 sensor as its main input for calculating a fuel mixture. If the O2 sensor is having an issue, it can cause an idle problem. So once again, if you have an O2 sensor code and an idle problem, solve the O2 sensor problem and recheck for the idle issue. Here's a video on how O2 sensors work that you might find interesting.
Another sensor I'll mention is the MAF sensor, or mass air flow sensor. This sensor actually measurers the amount of air going into the engine. This measurement is used to calculate the fuel mixture. If you know how much air is coming in, you can calculate a fuel mixture to go with it. If this sensor has an issue, it can cause idle problems.
In addition to problems with the sensor itself, you also need to look for air leaks after the sensor and before the throttle plate. Any leaks here will offset the measurement the sensor made of the incoming air. The term for this unaccounted-for air is “pirate air.” This extra air can offset the air fuel mixture and cause an idle problem.
If you don't find any leaks and you suspect an MAF sensor problem, you can clean this sensor instead of replacing it. Depending on the sensor’s malfunction, this can sometimes work and actually make your engine run better. The MAF sensor uses sensitive electronics in the incoming air stream to take its measurements. If these components become dirty, the sensor cannot read efficiently. Cleaning the sensor can sometimes correct this problem. So if you suspect a MAF sensor problem or you have a check engine light with an MAF sensor code, address that first, then recheck for your idle problem.
I could go on sensor by sensor, but I think you get the point. If you have a check engine light on and an idle problem, solve the check engine light first and then recheck to see if you still have an idle issue.