In a sensor including an emitter which emits a detection signal such that the detection signal can be blocked by or reflected from an object and a detection means for generating an electronic signal representing the presence, absence or condition of the object, and switch means operatively connected to said detection means for generating a sensor output signal representing the presence, absence, or condition of the object, the sensor being configured to perform a method for automatically adjusting the signal threshold level at which the output signal of the sensor switches comprising the steps of:
- determining the amplitude of said electronic signal in one state corresponding to the minimum detection signal received by said detection means;
- determining the amplitude of said electronic signal in another state corresponding to the maximum detection signal received by said detection means;
- comparing the amplitude of said electronic signal in said one and said another states;
- and
- adjusting the threshold signal level at which said output signal of said sensor switches based upon said comparison.