2014 Mazda 6

Car will randomly rev up at idle (around 1500-2000 rpm) and then return to normal. Is throwing a lean engine code p0171 and p0507. Unplugging maf sensor returns car to regular idle (around 750) instantly. Tried replacing maf sensor and getting same issue. Unplugged battery before sensor change for about 15 minutes and pushed brake pedal. It’s been driven twice since maf sensor change for about 100 miles. This is a 4 cyliner in-line.

Might be 2 problems, might be one driving the second. That P0507 is a throttle body error code caused by something or things on the list below:

  • Dirty throttle body
  • Electric throttle control actuator misadjusted or damaged
  • Faulty Electric throttle control actuator Intake air leak
  • Poor electrical connection to the Intake Air Control (IAC) valve

The air leak mention third would also cause a lean fuel condition and throw the P0171.

I’d start by giving the throttle body a good cleaning. Electrical connections to it as well. While the engine is running, I’d spray a little brake clean on the outside of the throttle body towards the gasket base and the shaft end. If the idle jumps when you do that, there is a leak in the gasket or the housing itself. If it doesn’t jump, clear the codes and drive it. If the problem persists, you may need a rebuilt throttle body.

Sometimes it’s hard to start after filling tank. I unplugged the evaporative hose from near the throttle body and cover it with tape and that seems to fix it. However, I need to plug the hose back in of course. What could be causing the issue?