A distance measuring device (1A, 1B) comprising: an emitting unit which emits a signal; a receiving unit which receives the signal emitted from the emitting unit and reflected on an object and which outputs a received signal according to received strength; a received signal detector which outputs a digital signal to discriminate whether the received signal output from the receiving unit exceeds a predetermined threshold of signal strength or not; and a signal processor which controls emitting of the signal by the emitting unit and starts counting time at an emitted timing of the signal, calculates received timing when the receiving unit receives the signal based on the digital signal output by the received signal detector, and calculates a distance to the object based on transmitting time of the signal from the emitting unit to the object and then to the receiving unit, the transmitting time obtained by ending the counting of time at the received timing, wherein the signal processor considers a distance or a time of flight to be a valid value when a condition that the calculated distance or time of flight is longer than a predetermined reference distance or time of flight is satisfied, and when the condition is not satisfied, the signal processor considers the distance, etc. to be an invalid value, wherein, a plurality of thresholds with a height difference are set in the received signal detector, and characterized in that the signal processor outputs a window stain notification signal which notifies there is a possibility that dirt is attached to a window material on a transmitting path of the signal when the distance or time of flight can be calculated based on a relatively high threshold and the condition that the distance or time of flight calculated based on the relatively high threshold is longer than the predetermined reference distance or time of flight is not satisfied, wherein the relatively high threshold is set to a value larger than an internal noise by scattered light and a value higher than the relatively low threshold, and wherein the relatively low threshold is set to a value larger than random sun light noise and power source noise or laser noise after emitting light. an emitting unit which emits a signal; a receiving unit which receives the signal emitted from the emitting unit and reflected on an object and which outputs a received signal according to received strength; a received signal detector which outputs a digital signal to discriminate whether the received signal output from the receiving unit exceeds a predetermined threshold of signal strength or not; and a signal processor which controls emitting of the signal by the emitting unit and starts counting time at an emitted timing of the signal, calculates received timing when the receiving unit receives the signal based on the digital signal output by the received signal detector, and calculates a distance to the object based on transmitting time of the signal from the emitting unit to the object and then to the receiving unit, the transmitting time obtained by ending the counting of time at the received timing, wherein the signal processor considers a distance or a time of flight to be a valid value when a condition that the calculated distance or time of flight is longer than a predetermined reference distance or time of flight is satisfied, and when the condition is not satisfied, the signal processor considers the distance, etc. to be an invalid value, wherein, a plurality of thresholds with a height difference are set in the received signal detector, and characterized in that the signal processor outputs a window stain notification signal which notifies there is a possibility that dirt is attached to a window material on a transmitting path of the signal when the distance or time of flight can be calculated based on a relatively high threshold and the condition that the distance or time of flight calculated based on the relatively high threshold is longer than the predetermined reference distance or time of flight is not satisfied, wherein the relatively high threshold is set to a value larger than an internal noise by scattered light and a value higher than the relatively low threshold, and wherein the relatively low threshold is set to a value larger than random sun light noise and power source noise or laser noise after emitting light.