The vehicle (2001 Kia Rio) was having rough idling and stumbling, and every time this happened the code was P1166 (non-specific fuel related problem). Rough idling could be due to a sticking idle air control (IAC) valve. The IAC is easy to remove and cheap to replace, but a sticking valve can also be easily repaired. After doing this, my idle problem was solved.
The IAC is an electrically actuated valve mounted to the throttle body, slightly above the throttle butterfly valve. If you look down the throttle body, there are two holes on the side walls. One is for supplying air to the crank case, which returns through the PCV valve and then goes to the intake manifold to consume unburnt fumes from the crankcase. The second slightly larger hole goes to the IAC valve. Air flows through the IAC valve bypassing the main butterfly valve, and returns to the intake plenum slightly under the butterfly valve. The valve contains a small metal plate that slides back and forth to control the size of the opening. The neutral position of the plate seems to be in a slightly open position.
The two mounting screws are in a tight spot and required the use a right angle driver to remove them.
The valve connector has three terminals which are labeled on the body. #3 and #2 opens and closes the valve. If you apply 12V to #2 and ground to #3, it should open the valve fully. Mine was frozen in place even after repeatedly cleaning with Brakeleen and WD-40. I had to force the plate to open with a screwdriver. Once it started to move, more soaking and cleaning freed the plate and it started to move smoothly.
The #1 wire is the feedback from the IAC, like the throttle position sensor.
The old gasket has to be scraped off and a new gasket should be used when reinstalling the IAC valve.