A proximity sensor and a method of changing a detection distance are provided to suppress changes in a consumption current of an oscillation circuit. The proximity sensor includes an oscillation circuit having an oscillation amplitude that changes with a feedback current, a comparing part comparing the oscillation amplitude with a threshold, a detecting part detecting a target object based on a comparison result of the comparing part, a voltage value signal generating part generating a voltage value signal based on the feedback current and the detection distance, a threshold setting part setting an analog signal converted from the voltage value signal as the threshold, a current value signal generating part generating a current value signal based on the detection distance and the voltage value signal, and a current value setting part setting an analog signal converted from the current value signal as a current value of the feedback current. |