What Are Engine Sensors, and What Do They Do?
The engine computer, or Electronic Control Module (ECM) and the input and output sensors control almost every aspect of engine performance. It is these engine sensors that control your engine idle speed, fuel consumption, power and emissions.
In most cases when an engine sensor fails, the check engine light comes on to let you know there is something going on. The engine will then use a preset signal in place of the failed sensor to allow the engine to continue running until it can be fixed.
If the failed sensor is just emissions related your fuel mileage will not be effected, so those can be ruled out when diagnosing a check engine light and poor fuel mileage.
Source: Automotive Engine Sensors | Auto Repair Manuals