The proper ratio of air to fuel that must be fed to the engine is 14.7:1. For this ratio to be maintained, the engine management computer continuously adjusts the amount of fuel it will feed to the engine. But for the engine management computer to properly do so, it needs information on how much air is being fed to the engine. In your BMW, the component that provides the computer with this data is the BMW oxygen sensor.
The BMW oxygen sensor is a small electronic sensor inserted into the exhaust system of gasoline-powered BMW vehicles. Prior to the introduction of OBD II in 1995, most petrol powered vehicles were equipped with only one or two oxygen sensors that were attached to the exhaust manifold. After the implementation of the OBD II, however, the number of O2 sensors used in vehicles doubled, with the added sensors used downstream the catalytic converter to measure its performance.
The primary function of oxygen sensors is to measure the amount of oxygen remaining in the exhaust gas. After doing so, the sensor relays this information to the engine management computer through voltage signals. From these signals, the engine management computer would base its fuel adjustments. So in the event that the BMW oxygen sensor fails, the engine management computer of your BMW will be left guessing as to the amount of oxygen being fed to the engine. In such cases, the computer would end up giving off more fuel than what the engine actually needs, thus increasing fuel consumption, increasing the amount of harmful exhausts produced and decreasing the efficiency of the engine and the catalytic converter.