Hyundai Repair: rough idle, poor fuel economy, mass air flow sensor


Question
QUESTION: i have a 2001 hyundai sonata and when i start it it always has a rough idle to it the code shows 171 which is system to lean bank.i dont know if it could be the oxygen sensor or the mass air flow sensor.another question i had is that my rpm gauge works sometimes and sometimes it doesnt.         thanks

ANSWER: Since you have a P0171 and a rough idle, you should first check for vacuum leaks.  Check especially the PCV hose.  But since you have a rough idle, also be sure to check the manifold gasket thoroughly for leaks.

Also, P0171 could be stored due to lack of fuel rather than too much air.  Again, the rough idle causes me some concern that you may have low fuel pressure.  If the vehicle runs worse the more you depress the accelerator, you should immediately suspect a fuel pressure issue.  If it runs better, then it's very unlikely you have a fuel pressure issue.

If there are no leaks, and your fuel pressure is normal, you probably have a problem with the air flow sensor.  Hyundai oxygen sensors almost never fail in such a way as to cause code P0171.

---------- FOLLOW-UP ----------

QUESTION: it is also hard on fuel.is this caused by the rough idle issue.

Answer
It's possible that the poor fuel economy is caused by the same thing that's causing the rough idle and P0171, but it's also possible there's another issue.  

Address the P0171/rough idle first.  If you continue to have the poor fuel economy issue after these repairs, then investigate other potential problems.