The Basics of Ultrasonic Sensors

By Jeff Smoot

The Basics of Ultrasonic Sensors

Ultrasonic sensors have been available for decades, and yet they continue to own a large portion of the sensing market due to their capabilities, flexibility, and low cost. As more products have become autonomous, demand has increased even further with their inclusion in robots, autonomous vehicles, and drones. Understanding how an ultrasonic sensor works, how it can be utilized, the pros and cons of using one, and their common applications will show how they are just as pertinent now as when they were first introduced.

What is an Ultrasonic Sensor?

Ultrasonic sensors emit a chirp usually between 23 kHz and 40 kHz, much higher than the typical audible range of human hearing at 20 kHz, hence the term ultrasonic. Using this chirp, they measure the amount of time it takes for the sound to bounce off an object. This is based on the same basic principles of echolocation used by bats to find their prey. As the speed of sound in air at room temperature is 343 meters per second, that time can be easily converted to distance, remembering that the ultrasonic chirp travels both to and from the object being sensed.

Distance (meters) = (time elapsed [seconds] * 343 [meters/second]) / 2

The units can be changed in this equation to fit the needs of a specific application, but the simplicity of the equation shows the relatively straightforward operation of an ultrasonic sensor.

How Does an Ultrasonic Sensor Work?

Moving from theory to reality, an ultrasonic sensor requires two parts, both a transmitter and a receiver. In the most standard configuration, these are placed side-by-side as close together as reasonably possible. With the receiver close to the transmitter, sound travels in a straighter line from the transmitter to the detected object and back to the receiver, yielding smaller errors in the measurements. There are also ultrasonic transceivers where the transmitter and receiver functions are integrated into a single unit, minimizing error as much as physically possible while also significantly reducing the PCB footprint.

Diagram of an ultrasonic sensor’s basic operation
Basic operation of an ultrasonic transmitter and receiver pair

The acoustic waves that leave the transmitter are more similar in shape to light leaving a flashlight than a laser, so spread and beam angle must be considered. As the sound waves travel farther from the transmitter, the area of detection grows laterally and vertically. This changing area is why ultrasonic sensors give their coverage specification in either beam width or beam angle instead of a standard detection area. When comparing this beam angle between manufacturers, it is recommended to verify that the beam angle is either the full angle of the beam or the angle of variation from the straight line from a transducer.

Diagram demonstrating an ultrasonic sensor with a wide and narrow beam angle
Understanding the beam angle is essential for establishing the detection area

A secondary effect of the beam angle is the range of the device. In general, a narrow beam yields a greater detection range as the energy of the ultrasonic pulse is more focused and can go farther before dissipating to unusable levels. Inversely, a wider beam spreads that energy in a wider arc, reducing the expected detection range. Choosing the ideal beam width is highly dependent on the application, with wide beams better at covering larger areas and general detection, while more narrow beams avoid false positives by limiting the detection area.

When searching for individual components, ultrasonic sensors can be acquired as independent transmitters and receivers or as a combination of the two in a single unit, known as an ultrasonic transceiver. Most analog ultrasonic sensor options are actuated by sending a trigger signal to the transmitter with the receiver sending back a signal when the echo is detected. The length of the pulse and any encoding can be customized by the designer as needed. This process ultimately leaves the time calculation between trigger and echo, as well as the decoding, to a host controller. There are digital ultrasonic sensor modules that calculate the distance onboard and then transmit the distance to the host through the communication bus. Although ultrasonic transmitters, receivers, or transceivers are often purchased separately and assembled with custom circuitry and firmware, they are also sometimes available as a single unit, pre-mounted on a PCB in the standard range finding configuration and a simple logic board. While simpler to use, designers do give up a great deal of flexibility and customization by using these modules.

Examples of an ultrasonic transmitter, receiver, and transceiver
Examples of an ultrasonic transmitter, receiver, and transceiver

Strengths and Weaknesses of Ultrasonic Sensors

As with any technology, ultrasonic sensors are best utilized in certain situations or applications over others. A few of their strengths include the following:

  • Ultrasonic sensors are unaffected by the color of the objects being detected, including translucent or transparent objects such as water or glass.
  • Their minimum and maximum ranges are quite flexible, with most ultrasonic sensors capable of detecting as near as a few centimeters up to approximately five meters. Specifically configured modules can even measure up to nearly 20 meters.
  • With decades of use, this mature technology is very reliable and well understood, yielding consistent results.
  • Ultrasonic sensors provide relatively precise measurements, within 1% typically and even more precision if desired.
  • They can make many measurements per second, yielding quick refresh rates.
  • As there are no rare materials needed, they are usually quite inexpensive.
  • Ultrasonic sensors are resistant to electrically noisy environments as well as most acoustic noise, particularly when using modules equipped with encoded chirps.

Although a versatile technology, ultrasonic sensors due have several limitations to consider before making a final sensor selection:

  • As the speed of sound is dependent on temperature and humidity, environmental conditions may change the precision of the measurements.
  • Although the detection zone is three dimensional, an ultrasonic sensor only detects that there is something a certain distance from the detector and cannot provide feedback on where the object is in the sensing area nor any features such as shape or color.
  • While their form factor is relatively small and they can be integrated into cars or industrial applications without any concerns, ultrasonic sensors may be too large for very small, embedded projects.
  • Like any sensor, they can get dirty, wet, or frozen, which will cause them to be erratic or non-functional.
  • Due to their dependence on sound, which in turn depends on a medium of some sort, ultrasonic sensors do not work in a vacuum.

Where are Ultrasonic Sensors Typically Used?

The first of the two most common ultrasonic sensor applications is liquid level sensing, as they can detect liquids of any color or opacity yet are also non-contact. The second is general object detection due to their low cost and simplicity. Specific object detection applications include anti-collision detection for vehicles, people detection, presence detection, box sorting, pallet detection with forklifts, bottle counting on drink filling machines, and many more.

Drawing of a robot vacuum utilizing ultrasonic sensors for object detection
Ultrasonic sensors can be used in autonomous vacuum cleaners for object detection

An example of a more creative usage for ultrasonic sensors would be to use the one-way functionality of ultrasonic transmitters and receivers separately. While the ultrasonic pulses are outside of human audible ranges, they are within the hearing ranges of various animals. An ultrasonic transmitter could conceivably use its emitters to scare off animals, such as birds, while an ultrasonic receiver could be used for noise detection.

Summary

Ultrasonic sensors are a well-known technology that continues to be extremely relevant in many industrial and consumer applications. Their simplicity, low cost, and robust build make them an excellent choice for many new products requiring presence detection or distance measurement. Yet the ability to change both the hardware and software configurations make them extremely versatile for even more demanding situations.

Additional Resources


Have comments regarding this post or topics that you would like to see us cover in the future?
Send us an email at cuiinsights@cuidevices.com

TODO: tags & categories
Jeff Smoot

Jeff Smoot

V.P. of Engineering

Since joining CUI Devices in 2004, Jeff Smoot has revitalized the company's Quality and Engineering departments with an emphasis on developing, supporting, and bringing products to market. With a focus on the customer’s success, he also spearheaded the establishment of an Application Engineering team to provide enhanced in the field and online engineering design and technical support to engineers during their design process. Outside of the office, Jeff enjoys the outdoors (skiing, backpacking, camping), spending time with his wife and four children, and being a lifelong fan of the Denver Broncos.

 
Chat with us
Chat with Us

Choose your department