This article describes an example of creating an ultrasonic rangefinder on the ARDUINO platform using inexpensive modules and components. The main feature of the device is the use of a software method of filtering values, which significantly increases its accuracy, and makes the device comparable in accuracy with industrial analogues, with a relatively low cost.