A proximity sensor comprising: an oscillation circuit comprising a coil and having an oscillating output voltage waveform with an amplitude that changes with a value of a feedback current, the feedback current being input from a current value setting part; a comparing part configured to compare the oscillation amplitude with a threshold voltage; a detecting part configured to detect a target object based on a comparison result of the comparing part; a voltage value signal generating part configured to generate a voltage value signal for a voltage value corresponding to the threshold voltage (Vthl) for a set detection distance, wherein the voltage value signal indicates a digital quantity of the voltage value determined by using a relationship between the oscillation amplitude, the value of the feedback current and the detection distance, the relationship being stored in a memory, and wherein the voltage value is generated maintaining the value of the feedback current as a present value of the feedback current, the present value of the feedback current being read from the memory; a threshold setting part configured to set an analog signal converted from the voltage value signal as the threshold voltage; a current value signal generating part configured to generate a current value signal for an updated value of the feedback current at which the oscillation amplitude at the set detection distance is at the voltage value indicated by the voltage value signal, whereby the current value signal indicates a digital quantity of the updated value of the feedback current determined by using the relationship between the oscillation amplitude, the value of the feedback current, and the detection distance, wherein the current value generating part is configured to write the updated value of the feedback current in the memory; wherein the current value setting part is configured to set an analog signal converted from the current value signal as the updated value of the feedback current, and wherein the detection distance indicates a distance from the coil to a position where the target object can be detected. an oscillation circuit comprising a coil and having an oscillating output voltage waveform with an amplitude that changes with a value of a feedback current, the feedback current being input from a current value setting part; a comparing part configured to compare the oscillation amplitude with a threshold voltage; a detecting part configured to detect a target object based on a comparison result of the comparing part; a voltage value signal generating part configured to generate a voltage value signal for a voltage value corresponding to the threshold voltage (Vthl) for a set detection distance, wherein the voltage value signal indicates a digital quantity of the voltage value determined by using a relationship between the oscillation amplitude, the value of the feedback current and the detection distance, the relationship being stored in a memory, and wherein the voltage value is generated maintaining the value of the feedback current as a present value of the feedback current, the present value of the feedback current being read from the memory; a threshold setting part configured to set an analog signal converted from the voltage value signal as the threshold voltage; a current value signal generating part configured to generate a current value signal for an updated value of the feedback current at which the oscillation amplitude at the set detection distance is at the voltage value indicated by the voltage value signal, whereby the current value signal indicates a digital quantity of the updated value of the feedback current determined by using the relationship between the oscillation amplitude, the value of the feedback current, and the detection distance, wherein the current value generating part is configured to write the updated value of the feedback current in the memory; wherein the current value setting part is configured to set an analog signal converted from the current value signal as the updated value of the feedback current, and wherein the detection distance indicates a distance from the coil to a position where the target object can be detected.