Article Preview
Buy Now
FEATURE
Ultrasonic Range Sensor
Determining distance with sonar
Issue: 24.2 (March/April 2026)
Author: Eugene Dakin
Author Bio: Eugene works as a Senior Oilfield Technical Specialist. He has university degrees in the disciplines of Engineering, Chemistry, Biology, Business, and a Ph.D. in Chemical Engineering. He is the author of dozens of books on Xojo available on the xdevlibrary.com website.
Article Description: No description available.
Article Length (in bytes): 14,579
Starting Page Number: 12
Article Number: 24202
Resource File(s):
project24202.zip Updated: 2026-03-01 13:10:39
Related Link(s): None
Excerpt of article text...
This section uses the Ultrasonic Range Finder to determine the distance from the electronic device to a solid object. Humans can typically hear frequencies from about 20 Hertz to about 20,000 Hertz, and the HC-SR04 Range Finder device operates at a frequency of approximately double the highest frequency, which is about 40,000 Hertz, or 40 kHz.
The way the Ultrasonic Range Finder works is by sending an ultrasonic wave in a direction, and a timer is started when the wave leaves the device. The wave bounces off an object and returns to the sensor on the finder, stopping the timer. The distance from the sensor to the object is determined by cleverly calculating the speed of the wave and the time it takes for the wave to reach the object and return to the sensor.
Some of the applications that the range finder can be used for are:
- Detecting barriers for robotics, such as walls or obstacles
- Measuring the distance of an object
- Calculating how level an object is
...End of Excerpt. Please purchase the magazine to read the full article.









