I had the emissions light come on about 18 months ago when my Z4MC was still in warranty and BMW replaced all four O2 sensors and the MAF sensor just to be sure. Anyway, a couple of weeks ago had the emissions light on again. Car ran fine for a day or so and then started to run lumpy with varying idle.
Did a bit of reading on some of the forums and brought an OBD port scanner from amazon for £26 and read the code which turned out to be the front cylinder bank pre-cat O2 sensor. Brought the sensor from BMW for £140 inc VAT (was actually the cheapest you could get, internet shops wanted £165) and a set of crows foot wrenches from ebay and fitted it myself.
It wasnt too hard to get the old one out, you need two extension bars connected together with a 22mm crows foot wrench on the end to get down to the sensor. You can see the sensors on the manifold if you look down the back of the engine bay on the drivers side. Once the old one was loosened up you disconnect the cable to it which is under the engine cover and take the sensor out. You then have to jack the car up and get underneath to put the new one in, this is the tricky bit as you cant actually see the tapping on the manifold so you have to feel where the tapping is and then move the sensor into position. You need to be careful so not to get any crud on the sensor head. Once its in and finger tight hook the cable up in the engine so you can reach it from above, drop the car back down, get the cable and plug it back in, tighten the sensor up and thats it. I was worried that the sensor was faulty as the emissions light stayed on even though the car was running perfectly. The car basically has to reset itself on its ECU, this took about a day of driving and the light put itself out. I did try disconnecting the battery but it didnt reset the light, you either wait for it to reset or take it to BMW to reset it, the fault gets hard coded onto the ECU so disconnecting from power makes no difference.
Anyway, i wouldn't hesitate to do this again as it was pretty easy if you have basic car skills, the right tools and a bit of patience. I could do another one in about 30mins I reckon. BMW will charge an hours labour probably. This rough guide is to replace either front (pre-cat) sensors, the post cat ones require the centre of the exhaust to be removed i think so might be a bit more difficult. One other word of warning, dont do this until the car is cold... exhausts and engines (especially 3.2litre ones) get very hot! Hope this helps someone.
This shows the front (pre cat) sensors;
http://www.realoem.com/bmw/showparts.do?model=DU92&mospid=49422&btnr=18_0661&hg=18&fg=10
This shows the rear (post cat) sensors;
http://www.realoem.com/bmw/showparts.do?model=DU92&mospid=49422&btnr=18_0658&hg=18&fg=10