A sensor that is capable of detecting a pulse of a user by using a proximity illumination sensor or a proximity sensor is provided. A proximity sensor (14) that includes a pulse detection function includes a count adjustment circuit (5) that performs adjustment such that a digital output value (ADCOUT1) from an analog-digital conversion circuit (4) changes in accordance with each value of a distance at least in a prescribed range of the distance between a photodiode (2) and a detected object (a finger in the drawing) and a digital filter (6) for detecting a cycle of the digital output value (ADCOUT1) from the analog-digital conversion circuit (4).