Accelerator position sensors detect how far the driver is pushing the gas pedal. The sensor feeds information to the car's computer, which helps it determine the correct fuel-to-air ratio and when to shift.
While gasoline or diesel fuel provides the energy for a car's engine, fuel also needs air to combust cleanly and efficiently; with the right mixture, engines can get better gas mileage and prevent misfires. Carburetors provide a manual means of achieving the appropriate ratio, but fuel injection systems need to calculate this ratio based on information fed to one of the car's internal computers. The accelerator position sensor plays a key role.
The accelerator position sensor also helps automatic transmissions determine when to shift gears. Pressing the accelerator pedal fully often indicates that the driver wants maximum acceleration, and the transmission typically stays in a lower gear. When the driver lets off of the pedal, the transmission shifts to a higher gear for better efficiency. Drivers looking to pass a vehicle on a road can generally shift to a lower gear to gain extra acceleration by pressing hard on the pedal, which signals to the transmission that the driver wants to downshift. Because of this, mechanics sometimes look at improper shifting as a potential sign of problems with the accelerator position sensor.