1997 Toyota Camry's engine revs all by itself!

My son’s Camry engine revs up and down without touching the gas pedal when in park. When in drive, the car can go at 35mph without touching the gas.



Another son got in and said he turned off the overdrive button and the engine revving stopped.



The check engine light comes on ocassionally but not all the time.



Anyone have any thoughts?

There may be an IAC (Idle Air Control) system fault. Perhaps just a dirty valve.

Check for a vacuum leak(s) too.

Also check for an EGR system fault.

The next time the check engine light is on drive it into an auto parts chain and ask them to pull the codes (many do it for free). This will give you a place to start looking. You can post the codes here, but get the actual code (e.g. P0123) not someone’s interpretation of it.