My car runs rough at idle, stalls at idle, surges, and idles at 40 miles an hour

What do I need to replace to stop rough idling, stalling ,fast idling (40mps) and surging. Already replaced throttle body sensor.

My car has 75000 miles.
My car has an automatic transmission.

Experienced mechanics share their insights in answering this question :
A number of components or faults can cause your issues. A vacuum leak can cause your issues. Depending on the vehicle, components such as the mass airflow sensor, throttle position sensor, coolant temperature sensor, and a number of others can be the cause. Since randomly replacing parts can get expensive as most electronic components are not returnable once installed, having a certified technician, such as one from YourMechanic, diagnose the stalling/surging is the best place to start.

How to Identify and Fix Common car Problems ?

Our sources include academic articles, blog posts, and personal essays from experienced mechanics :

Many different problems could result in a rough idle for your car or truck, including: dirty fuel injectors, clogged air filters, bad spark plugs, and a variety of exhaust system issues.
Oxygen (O2) sensor

An oxygen sensor monitors and analyzes the amount of oxygen in a vehicle`s exhaust system after combustion. A dirty, damaged or malfunctioning O2 sensor (or sensors) affects the air/fuel mixture, causing the engine to idle rough.

If the engine stalls while idling or driving, the engine may be running out of fuel or not receiving enough fuel pressure to keep it running. The most likely cause of this kind of stalling would be a fuel pump that is not spinning fast enough or is intermittently cutting out.
Along with faulty spark plugs, a build-up of dirt and grime is the likely cause of cars stuttering when idle. A clogged filter or fuel injection system can starve your engine of fuel or oxygen, causing your car to judder and shake.
Engine hunting and surging at idle is usually caused by a fuel delivery, air leak, or governor system problem. Cleaning/overhauling the carburettor, adjustment of the governor, and/or changing the air filer may be required.
Engine Misfires

Perhaps the single most common cause of rough idle comes in the form of a misfiring engine. As you may know, any automotive engine contains multiple cylinders. Each of these cylinders contributes to powering your car by combusting a mixture of gasoline and air.

Common faults caused by a dirty MAF sensor include: rough running at idle, increased fuel consumption, low power, poor throttle response, poor starting and black smoke (diesels). Even the dreaded check engine light (MIL) lighting up can be a sign of dirty MAF sensor.
Engine Idles Roughly: A rough idling engine could be caused by a failing camshaft position sensor. This issue is more evident when the engine is idling. Hesitation: Hesitation during acceleration is a common issue that you may experience with a bad camshaft sensor.
Some of the most common sensors that lead to engine stalling include the mass airflow sensor (MAF), engine coolant temperature sensor (ECT) and manifold absolute pressure sesnsor (MAP). The idle air control valve (IAC) and exhaust gas recirculation valve (EGR) are also well known for causing engine stalling.
How to fix it? Cleaning or replacing the fuel filter and adding a fuel injector cleaning treatment to the fuel tank should take care of clogged fuel injectors. If the rough idle persists, it`s time to take your car to an auto repair shop.
Common culprits include the ignition control module, plug wires, coils, and spark plugs. Defective Airflow Sensor: A defective airflow sensor can be responsible for a rough idle. A mass airflow sensor detects the amount of air coming into the fuel injection system and sends that information to the vehicle`s computer.
The problem may involve an annoying change (up/down) of engine speed while cruising at a steady pace, a low drop (or even cut-out) at idle or when approaching a stop, a wild high engine speed of several thousand rpm followed by a drop to near zero, etc.
An idle air control valve, also called an idle air sensor control motor, is an electrically operated valve that controls the amount of air that bypasses the throttle plate in cars with a fuel injection system [source: Autozone]. This causes the idling speed of the engine to change as needed.
The catalytic converter, or cat for short, is responsible for removing harmful emissions from the exhaust. If the two O2 sensors collectively sense that the oxygen levels don`t change significantly after running through the cat, it`s a sign of a bad catalytic converter.
If your engine has been surging or hesitating lately, it`s possible that the mass airflow (MAF) sensor is too dirty. Del Hatt Automotive advises that it is rare that the sensor goes bad and needs to be replaced.
A bad MAF sensor can cause your vehicle to experience poor drivability issues such as engine stalling, jerking or hesitation during acceleration. This could happen while speeding up on the highway on-ramp or cruising down a city street. These issues can create dangerous situations causing accidents and injury.
Bad solenoid may be causing vehicle to stall.
When the idle air control valve fails, it inhibits the flow of air through the engine. When the car can`t receive air, it leads to engine stalling. The severity of this symptom can range from occasional stalling at first, to stalling immediately after ignition.
The IAC valve is controlled by an input signal from the ECU as required by the engine management system, the duration and frequency of the ECU input signal determines how long and how far the IAC valve opens, hence the amount of air that is allowed to bypass the throttle plate.
A bad fuel pump may overheat and inadequately deliver gas to the engine, causing it to run hot and turn off while on the road. In this scenario, your vehicle may start back up after overheating and shutting down, only to do the same thing a half-hour later. This scenario is a common sign of a bad fuel pump.
Simply put, a rough idle describes an engine that is not firing consistently when your vehicle is in park, with no gas applied. Most vehicles idle between 600 and 1,200 RPM and should hold their idle speed.
The idle speed should feel consistent without skipping or slipping. In most of today`s cars, an idle speed of 600 to 1000 RPMs is average. If your car is idling rough, though, it won`t feel smooth. The RPMs will jump up and down, for example, or they`ll fall below 600 RPM (or whatever is typical for your vehicle).
Engine surging is usually a warning sign that your car or truck is having combustion problems. Since a vehicle`s ignition wires and spark plugs play a major role in proper engine performance, it is likely time to check your engine`s electrical components.

Relevant Questions and Answers :

the most relevant questions and answers related to your specific issue

My car runs rough at idle, stalls at idle, surges, and idles at 40 miles an hour
ANSWER : A number of components or faults can cause your issues. A vacuum leak can cause your issues. Depending on the vehicle, components such as the mass airflow sensor, throttle position sensor, coolant temperature sensor, and a number of others can be the cause. Since randomly replacing parts can get expensive as most electronic components are not returnable once installed, having a certified technician, such as one from YourMechanic, diagnose the stalling/surging is the best place to start.

01 mustang v6 running rough at idle and drive. Please help. Replaced a bunch, still can’t figure out issue.
ANSWER : This may be a sign of a faulty MAP sensor as the vehicle responds adversely to a load put on the motor (i.e. putting it in gear, turning on AC or engaging the brakes). The Manifold Absolute Pressure (MAP) sensor senses engine load and generates a signal that is proportional to the amount of vacuum in the intake manifold. The engine computer then uses this information to adjust ignition timing and fuel enrichment. When the engine is working hard, intake vacuum drops as the throttle opens wide. The engine takes in more air, which requires more fuel to keep the air/fuel ratio in balance. When the computer reads a heavy load signal from the MAP sensor, it adjusts the fuel mixture to slightly more rich than normal so the engine can produce more power. The computer will then retard (back off) ignition timing slightly to prevent detonation that can damage the engine and decrease performance. This may also be caused by other closely related components such as a dirty or failing mass air-flow sensor, a faulty throttle position sensor or potentially a vacuum leak. I would recommend having an expert from YourMechanic come to your location to diagnose and inspect your vehicle.

Why does my car lose power at 20 miles an hour and 60 miles an hour and my check engine light goes on and off
ANSWER : Hello. It sounds like you may have a sensor issue going on with your car. Most of the time when something like this occurs it is caused by a throttle position sensor that is not working properly. It can also be caused by worn out fuel system or ignition system parts but it is most commonly a sensor. I will usually install my scan tool and drive the vehicle while monitoring what the sensors are doing. This would tell me if there is a sensor issue going on. If the sensors are reading correctly then I inspect the ignition system and also test the fuel pressure. If you are looking to have this loss of power checked, consider having a YourMechanic certified technician come to your home or office to diagnose why it is losing power.

My car idles kinda rough, and it stalls when I come to complete stop and stalls when I let it run.
ANSWER : Failures in the charging circuit (alternator, etc.) do not typically cause a rough idle. A faulty throttle position sensor and/or clogged fuel injectors can cause the engine to run roughly but those are just two among many, many potential causes of a rough running engine. What will help you is a rough idle diagnostic during which the individual cylinder firing patterns can be evaluated on a scope. Those firing patterns will allow the mechanic to see if perhaps there is "a" or a couple bad cylinders and also whether the engine is experiencing a fuel system versus ignition system problem and in which cylinders. On an engine with so many miles, 240,000 in your case, compression should be tested in each cylinder as wear in the engine could potentially cause enough imbalance, from cylinder to cylinder, to cause the engine to run roughly. You have to keep in mind that typically there will be multiple issues with an old engine, for example you could have dirty fuel injectors, a sticky EGR valve and fouled plugs due to the inevitable leakage from old valve stem oil seals, or any of a number of other combinations. The best thing to do, to see if you can get additional service life out of the engine, and you likely can, is to methodically and carefully go through the list of possibilities. YourMechanic certified technicians specialize in just that so if you set up a diagnostic, a technician will get to the bottom of this for you and give you repair options so that the engine can be restored to reasonable operating condition.

My car has a rough idle when I start my car, when I stop at a light my car turns off. Is it the purge sensor?
ANSWER : This may be a result of a dirty or failing idle air control valve. The idle air control valve reads the air intake as it is mixed with fuel prior to being injected into the engine at low speeds and at idle. Since this valve is controlled by the vehicle’s computer, it will adjust idle speed based upon other measurements such as engine temperature, intake air temperature and electrical system load or voltage. When you accelerate, the engine RPM increases, and as you let off the gas, the RPM slowly returns to the normal idling speed with the help of the idle air control valve making the transition from a higher RPM back down to idle speed. When the engine RPM drops below the normal range of about ~800 RPM, this often times will cause the engine to stall indicating a dirty or faulty idle air control valve. I would recommend having an expert from YourMechanic come to your location to diagnose and repair your idle air control valve.

Replaced alternator on car 2 times each time shows it’s charging 14v let car run for a little bit then test drive and car voltage
ANSWER : There are reports that the replacement alternators will not communicate with the engine computer and will not charge correctly. I recommend using only the manufacturer approved replacement part. It can be new or remanufactured but approved for use in the vehicle. Some lower cost alternators on the aftermarket will have charging problems since they will not communicate with the ECM on the vehicle and will stop charging.

Could this cause ur car to stall in warmer weather? My car never stalls during winter months. But from spring on its a neverendin
ANSWER : You should have the check engine light and engine scanned to see if the engine may be running lean due to low fuel pressures or clogged injectors. You should also have the mass airflow sensor cleaned and checked for proper readings and replace if not within specifications. The vehicle runs richer in colder weather and may be the reason for not stalling. You should clean injectors, clean throttle body and idle control valve then clean mass air sensor and relearn idle.

My car had a rough idle, and if I sit at a red light or let the car run in idle for a few minutes my check engine light starts to
ANSWER : A dead misfire on a single cylinder may be deeper than just a spark plug. If the compression for that cylinder is very low, the cylinder cannot fire. Low compression would be caused by worn piston rings. Also, if the fuel injector is leaking or not flowing enough fuel, this may cause a misfire as well if the injector is leaking bad enough. A fouled spark plug usually leads to a coil that is not functioning or lack of compression in that cylinder. If you would like to have this taken care of, a qualified professional from YourMechanic can come to your car’s location to diagnose the rough idle and help you move forward with repairs.