The EGR sensor will cause the check engine light to illuminate, frequently. The EGR is a mechanical or electrical sensor located on the engine designed to monitor and reduce exhaust emissions. A loose gas cap can sometimes cause the computer to think there is a small emission control leak and illuminate the check engine light. On some cars, the code the computer sets because of a loose gas cap may indicate an EGR fault. Other sensors likely to illuminate the check engine light are the O2 sensor, the EVAP sensor, and the MAF or MAP sensors. Many auto parts stores will retrieve the computer codes free of charge.
For more info, see Possible Engine Warning Light Causes