← Back to list

2004 BMW 325i P0171 and P0174 Lean Mixture Codes: Diagnosis and Fixes for Idle Issues

Model: 04 bmw 325i Fault Code: P0171 Posted: 2007-10-25 11:50

Hi everyone, I'm currently troubleshooting a persistent idle issue on my 2004 BMW 325i (2.5L V6, 105k miles) with an automatic Steptronic transmission. The car has started idling significantly slower—now around 500–550 RPM instead of the normal 650–700 RPM—and recently triggered the 'Service Engine Soon' light. An OBD-II scan reveals two primary diagnostic trouble codes: - P0171: Lean Mixture Bank 1 - P0174: Too Lean Mixture Bank 2 Additionally, in 2 out of 12 instances, a P2231 code appeared (O2 Sensor Bank 1, Sensor 1: Signal Circuit Shorted to Heater Circuit). I’ve already performed the following checks: 1. Replaced the air filter (never used an oiled filter or OEM replacement) 2. Removed and cleaned the Mass Airflow (MAF) sensor twice using CRC MAF Cleaner 3. Inspected visible vacuum hoses—no obvious leaks found 4. Did not inspect the intake manifold for leaks due to uncertainty on proper procedure 5. Avoided using brake cleaner to test for vacuum leaks, as I was advised that engine compensation may mask any immediate changes 6. Heard about a 'smoke test' but don’t understand how it works—can someone explain briefly? 7. Recognize that the vehicle is past due for oxygen sensor replacement (each costs ~$190). Replacing all four would cost between $380 and $760 depending on whether pre-cat or post-cat sensors are replaced. I’ve also collected 'Freeze Frame' and 'I/M Monitor Data' from the scan tool. After driving approximately 15 miles with the OBD-II scanner connected, the P0171/P0174 codes reappeared, but all I/M Monitor readings showed as 'OK' (except N/A entries). My key questions: - Does the OBD-II scan tool need to remain connected during a specific driving distance for I/M monitors to complete their checks? Can this be done in segments or must it be continuous? - If vacuum leaks are present, could they cause lean mixture conditions? - What happens if I remove the oil fill cap while idling? The car sputters and nearly stalls—does this indicate a clogged Crankcase Ventilation (CCV) valve? I’ve tried cleaning the MAF sensor twice with no improvement. A scan tool could potentially verify MAF calibration by comparing barometric readings to actual atmospheric pressure—but I don’t have access to such equipment. Any insights or step-by-step guidance on diagnosing this issue would be greatly appreciated, especially for a DIYer working on a BMW platform that is known for complex emissions systems.

Related fault codes
P0171P0174
Comments (11)
Anonymous 2007-10-25 12:33

Here are some 'Freeze Frame' and 'I/M Monitor' data readings: EDIT: A follow-up scan after driving ~15 miles showed all I/M monitors as 'OK' (excluding N/A entries).

Anonymous 2007-10-25 12:39

Cleaning the MAF sensor can sometimes improve drivability, but if idle issues persist, it likely indicates a severely degraded sensor. A scan tool should compare actual barometric pressure to the MAF’s reading—this helps determine calibration accuracy. BMW engines are notoriously difficult for DIYers due to their complex emissions and sensor integration.

Anonymous 2007-10-25 20:24

Thanks for your reply, Jeff! I agree—DIYing a BMW is no easy task. I’ve already cleaned the MAF twice. It looked clean both times, but there was no improvement in idle behavior or drivability. While it was the cheapest option, it’s still on my list as a first step due to cost. I’ve updated my I/M Monitor data—after driving ~15 miles with the scan tool plugged into the OBD-II port, the P0171 and P0174 codes returned, but all monitors now show 'OK' (except N/A). My follow-up question: Do I/M monitors require a specific distance of continuous driving to complete their diagnostics? Can this be broken up into shorter segments or must it be uninterrupted?

Anonymous 2007-10-25 22:51

I recommend cleaning both the MAF sensor and throttle body. Then, inspect all throttle body hoses for looseness or vacuum leaks—especially those connected to the throttle body. Also check all vacuum hoses leading into the engine. A broken or loose hose can cause a lean condition. Have you checked the PCV valve? If not, verify its operation and vacuum connection. A clogged PCV valve may fail to regulate crankcase pressure properly. If these checks don’t resolve the issue, consider cleaning fuel injectors (possible clogs) or inspecting the fuel pressure regulator—ensure it has proper vacuum in its main hose and is not damaged or blocked.

Anonymous 2007-10-26 08:31

Jeff, you read the post correctly—he’s already cleaned the MAF twice! The third attempt won’t help. This is a common misconception among DIYers.

Anonymous 2007-10-30 15:57

No vacuum leaks have been found so far. P0171 and P0174 codes persist. I have one question: Under normal conditions, what should happen if I remove the oil fill cap while idling? The car sputters and nearly stalls when I do this. If this isn’t typical behavior, does it suggest a clogged or malfunctioning Crankcase Ventilation (CCV) valve that needs replacement? Thanks for any input!

Anonymous 2007-10-31 08:00

Some manufacturers do this—older Saabs, for example.

Anonymous 2007-10-31 08:18

If removing the oil fill cap causes severe idle instability, it likely indicates a vacuum leak into the crankcase. The oil cap acts as a partial seal; when removed, the leak is exposed and can cause engine misfires or stalling. A properly functioning engine should maintain stable idling with the cap off, even under slight crankcase pressure. I recommend performing a crankcase vacuum test to check for intake gasket leaks into the crankcase.

Anonymous 2007-10-31 09:26

Correction—I misread that. Darkrooms is correct again!

Anonymous 2007-11-05 19:31

Darkrooms wrote: If removing the oil fill cap causes severe idle instability, it likely indicates a vacuum leak into the crankcase. The oil cap acts as a partial seal; when removed, the leak is exposed and can cause engine misfires or stalling. A properly functioning engine should maintain stable idling with the cap off, even under slight crankcase pressure. I recommend performing a crankcase vacuum test to check for intake gasket leaks into the crankcase. Thanks for this clarification! Can you explain how to perform a crankcase vacuum test? Is it something I can do at home or does it require taking the car to a shop?

Anonymous 2007-11-06 09:10

You may be able to do this yourself. First, disconnect all PCV hoses except one that will connect to a vacuum gauge. Remove the oil fill cap and seal it tightly (many caps have built-in pressure relief—ensure you block the crankcase). Start the engine and perform a short acceleration-deceleration cycle. A healthy engine should show positive pressure in the crankcase. If negative pressure (vacuum) is detected, it indicates an intake leak into the crankcase. Be cautious—high pressure can blow out poorly sealed connections.