What you are calling the air/fuel sensor is the oxygen sensor. They only measure oxygen, not fuel. Your terminology can confuse someone who is thinking about the mass air flow sensor, which actually does not measure fuel either. Many people call that the "air/fuel" sensor because its readings are used to calculate the amount of fuel the engine needs.
What is important to understand is the oxygen sensor is reporting a lean condition. That is what it is supposed to detect when the condition exists, and that can only be done by a properly-working sensor. Replacing the sensor is not going to solve the condition it is detecting.
The way to approach this is to connect a scanner and view live data, then see what you can do to affect the oxygen sensor's readings. You will see it switching between "rich" and "lean" about two times per second once the engine is warmed up. To set code 171, you will typically find it staying "lean" longer than normal, but it is also possible for the lean condition to only occur at certain times, like extended highway driving. For that, most scanners have a "record" feature that allows you to record a few seconds of sensor data when the problem occurs. In this case you would press the "record" button when the check engine light turned on. That would be when the problem occurred and was detected. Later you can plat it back slowly and see what changed that may have triggered the problem.
If you see an excessively-lean condition with the engine idling, you can pinch off various vacuum hoses, then observe if the oxygen sensor reports longer "rich" pulses. The scanner will also show the voltage being developed by the O2 sensor but those bounce around a lot, so it is hard to tell if pinching a vacuum hose caused a change. You can also spray some water over the engine while it is idling and still cool. If you see it get sucked in, typically through an intake manifold gasket or vacuum hose, you found the leak.
As a last resort, you can use a smoke machine to inject a white, non-toxic smoke at two pounds of pressure into a vacuum hose, then watch where it sneaks out. That can identify leak locations that are not easy to see otherwise.
Also be aware that almost all vehicles other than Chrysler products use the mass air flow sensor you mentioned. The fresh air tube between it and the throttle body can not have any leaks from loose hose clamps or cracks. Any air that gets into the engine without going through that sensor will not be measured, and no fuel will be calculated to go with it. That will result in a lean condition.
Sunday, June 25th, 2017 AT 2:03 PM