A power tool is provided, which comprises a housing, a motor located within the housing, and a motion sensor. The motion sensor is adapted to control the operation of the motor in response to changes in position or angle of the power tool. The motion sensor can determine the angle between the power tool and the horizontal plane, and operation of the motor is controlled accordingly.