The check-engine light comes on and a scan shows P0171: system too lean. The engine may idle roughly, or seem to run normally. Because an oxygen sensor monitors the mixture, replacing it can sound like an obvious solution. It may leave the actual fault untouched.
P0171 means the control system has identified a lean condition on bank 1 and fuel compensation has reached that vehicle's fault-setting criteria. Bank 1 generally means the bank containing cylinder 1, not a fault confined to that cylinder. The code does not identify a failed sensor, pump or hose.
Adding fuel does not explain the cause
On gasoline engines with the relevant feedback control, the computer adjusts injection using exhaust oxygen information and other inputs. Short-term fuel trim describes the current correction; long-term trim reflects learned adaptation. Positive trim generally means fuel is being added to the base calculation.
That correction may respond to unmetered intake air, inadequate fuel delivery or inaccurate air measurement. Exhaust leaks, sensors or wiring can also distort the feedback. An oxygen sensor may be reporting a real problem correctly. Check the inputs and supply before blaming it.
Compare idle with other operating conditions
Some intake leaks account for a larger share of total airflow at idle, so positive correction may be greater there and decrease under suitable other conditions. This can direct a technician toward intake joints, vacuum hoses and crankcase ventilation. It is a clue, not a pattern every leak or vehicle must follow.
If substantial correction persists elsewhere, assess air measurement, fuel pressure and delivery, injection and feedback using vehicle-specific information. No single percentage or engine speed is a universal pass/fail limit. Temperature, load, closed-loop operation and accompanying codes affect interpretation.
Start with loose connections, cracks and recently disturbed parts, then use the prescribed leak tests and measurements. Do not spray flammable liquids around a running engine to find a leak or open high-pressure fuel lines yourself.
Save the conditions before clearing codes
Freeze-frame data can preserve engine speed, temperature and load when the fault occurred. Some leaks depend on temperature, and clearing codes can remove useful evidence. Tell the workshop whether it happens cold or warm, at idle or during acceleration, and whether the intake or engine was recently serviced. Unmeasured fuel pressure and unread codes remain unknown.
After repair, recheck fuel trims and running quality near the original conditions, and complete the vehicle's relevant monitoring procedure. A light that has just gone out is not proof of success. Severe shaking, stalling or a sudden loss of power call for an inspection before continuing to drive.
In Repair AI, select your vehicle and enter P0171 with all available codes, operating conditions and actual measurements to find relevant diagnostic and repair guidance.
Look up my vehicle