While there are many reasons for a car to idle roughly, one of the most common is a vacuum leak. Even small leaks can cause the rough idle and illuminate the check engine light. Unfortunately the problem is often difficult to find, but once it's located, it's easy to fix. Popular Mechanics recommends starting with a copy of the vehicle's vacuum diagram and highlighting each connection when checked.
The government requires automobiles have an EGR valve that increases efficiency and a more complete burn of fuel. It recirculates a portion of the vehicle's exhaust through the combustion chamber to cool the temperature at which the fuel burns and decreases noxious emissions. The EGR system decreases the vehicle's contribution to the build-up of greenhouse gases. When this valve goes bad, it affects the engine idle. In addition to its effect on the engine performance, a bad EGR valve has the potential to stop the engine from running altogether. About.com recommends owners try to clean an EGR valve with carburetor cleaner before replacing it. It suggests cleaning valves without an electrical connection by soaking in cleaner overnight if possible. If the valve has a connection, it requires the use of a spray cleaner and brushes after removal from the vehicle.