Engine reving on it's own

I have a 99 ford ranger 4x4 xlt flex fuel 3.0 liter automatic with 159k miles. Two weeks ago I noticed that the engine revs up from standard idle rpm of 8,500 to about 11,000 rpm. I hear a clicking sound from engine compartment when this occurs like the fan/clutch switching off and on but when I looked under the hood this does not appear to be the case. This rev up happens about every minute or so whether in park, neutral or drive. So the truck surges when this rev up happens. I notice it most when at a stop but also when driving on freeway. Engine accelerates on it’s own. I’d like some advice on how best to approach this short of taking it to the dealer and pay them a handsom fee to diagnose. I’d like to think it’s just a sensor or switch but fear it maybe something major like a timing chain/belt. Any advice is greatly appreaciated!

Look for a vacuum leak into the intake manifold. You might be able to hear the hissing of the air entering the break.

I think you have a Mass Air Flow sensor so inspect the hose that goes from this to the throttle body.

If it is none of these, you might try cleaning the throttle body with emphasis on the Idle Air Control actuator and passages.

Also is the Check Engine Light or Service Engine Soon light ‘on’?

I’ll bet this happens only when your A/C is switched on. Is this correct?

nope… haven’t used the A/C… this just started and happens about every minute or so when the engine is on

First off, you’ve got an extra zero on your speeds-- you’re in real trouble if your truck is idling at 8500 RPM, let alone 11,000!

I’m thinking the engine might be switching between high idle and low idle maybe due to low coolant level, air in the system or a bad coolant temp sensor. Does the truck idle solidly at the higher speed when you first start it or does it fluctuate cold as well?

Check the idle air controller if the rest of the suggestions don’t pan out.

You don’t happen to have an aftermarket cruise control unit, do you? How about a factory-installed one?

Fluctuates when cold also… now that you metion it… seems that it idles in higher rpm’s for longer period now upon cold starts. I always wait for the choke or high idle to go back to normal rpm’s before driving away… seem to wait longer now for this to idle down… then it revs up every minute or so… continuously… whether engine is cold or warm.

OKAY… would I need a vacuum gauge to check idle air controller? Don’t know if there’s any wear parts, seals, etc. or just inspect/clean as necessary?

As a first check on the IAC, unplug the electrical connector when it is in both the slow and fast modes and see if there is a change.

Could the climate control be set at DEF? If so, the AC will cycle causing the clicking and idle-up.