To adaptively adjust a threshold value depending on an overall change of an output from a sensor.
A comparison device 100 comprises: a magnetic sensor 10 for outputting a signal Vin; a threshold value selector 20 for selecting and outputting any one of three threshold values Vref1, Vref2, and Vrefr as a selected threshold value Vref; a comparator 30 for comparing the signal Vin and the selected threshold value Vref and outputting a binarized comparison result COMP; and a controller 40 for increasing the three threshold values Vref1, Vref2, and Vrefr altogether if the comparator 30 outputs for a predetermined number of times or more the comparison result COMP indicating that the signal Vin is not less than a threshold value for adjustment Vrefr, within the predetermined period, and decreasing the three threshold values Vref1, Vref2, and Vrefr altogether if the comparator 30 does not output for the predetermined number of times or more the comparison result COMP indicating that the signal Vin is not less than the threshold value for adjustment Vrefr, within the predetermined period.
Yashiro Hitoshi
Taro Takahashi