My car is shutting down while I am driving it and coming to a stop. I have to put it in neutral to restart, and then shift into drive. This began after I replaced my battery.
The most likely cause is a dirty throttle body. The throttle body controls the amount of air the engine is getting. Your engine is drive by wire meaning there are sensors in the accelerator pedal, and a motor controlling the throttle plate. Over time carbon builds up around the throttle plate. The computer compensates by opening the plate a little more. This compensation is erased when you disconnect the battery. I found a Ford service bulletin for the RPM surging at low speeds. It calls for cleaning the throttle plates and reprogramming the PCM (powertrain control module) to cope with carbon buildup better. The reference number is 12N03. Ford was covering it for 10 years, 150,000 miles. You can call your local Ford dealer to see if they will still cover it. Any qualified mechanic can clean the throttle plate. However, to my knowledge only Ford can reprogram your PCM. All of this being said, if it idled well before the new battery, it may just be a matter of time until the PCM relearns. Some tips for speeding up the PCM re-learning process would be to turn on everything electrical (lights, heater on high, 4-ways, rear defrost, etc.) with the car fully warmed up. Also, you can place your foot on brake, shift from P to D with the AC off, and then back to P. After that, turn the AC on, shift from P to D, and repeat several times to help speed up the PCM re-learning process.
Our certified mechanics come to you ・Backed by 12-month, 12,000-mile guarantee・Fair and transparent pricing