• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Microcontroller Tips

Microcontroller engineering resources, new microcontroller products and electronics engineering news

  • Products
    • 8-bit
    • 16-bit
    • 32-bit
    • 64-bit
  • Applications
    • Automotive
    • Connectivity
    • Consumer Electronics
    • Industrial
    • Medical
    • Security
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Videos
    • TI Microcontroller Videos
  • EE Resources
    • DesignFast
    • eBooks / Tech Tips
    • FAQs
    • LEAP Awards
    • Podcasts
    • Webinars
    • White Papers
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
      • Power Electronics & Programmable Power

The working principle, applications and limitations of ultrasonic sensors

August 6, 2019 By Lynnette Reese

Figure 1: HC SR04 ultrasonic sensor. (Source: Digikey

The ultrasonic sensor (or transducer) works on the same principles as a radar system. An ultrasonic sensor can convert electrical energy into acoustic waves and vice versa. The acoustic wave signal is an ultrasonic wave traveling at a frequency above 18kHz. The famous HC SR04 ultrasonic sensor generates ultrasonic waves at 40kHz frequency.

Typically, a microcontroller is used for communication with an ultrasonic sensor. To begin measuring the distance, the microcontroller sends a trigger signal to the ultrasonic sensor. The duty cycle of this trigger signal is 10µS for the HC-SR04 ultrasonic sensor. When triggered, the ultrasonic sensor generates eight acoustic (ultrasonic) wave bursts and initiates a time counter. As soon as the reflected (echo) signal is received, the timer stops. The output of the ultrasonic sensor is a high pulse with the same duration as the time difference between transmitted ultrasonic bursts and the received echo signal.

Figure 2: Representation of trigger signal, acoustic bursts, reflected signal and output of echo pin. (Source: HC-SR04 User Guide)

The microcontroller interprets the time signal into distance using the following functions:

Theoretically, the distance can be calculated using the TRD (time/rate/distance) measurement formula. Since the calculated distance is the distance traveled from the ultrasonic transducer to the object—and back to the transducer—it is a two-way trip. By dividing this distance by 2, you can determine the actual distance from the transducer to the object. Ultrasonic waves travel at the speed of sound (343 m/s at 20°C). The distance between the object and the sensor is half of the distance traveled by the sound wave.[iv] The following equation calculates the distance to an object placed in front of an ultrasonic sensor:

­­­­

Applications

Multiple areas of engineering use ultrasonic sensors. “No-contact” distance measuring is very useful in automation, robotics, and instrumentation. Below, we investigate the applications of ultrasonic sensors:

Ultrasonic Anemometers

Figure 3: A 2D Ultrasonic anemometer detects the horizontal component of wind speed and direction (Source: Biral)

Weather stations commonly used anemometers since they detect wind speed and direction efficiently. The 2D anemometers can measure only the horizontal component of wind speed and direction, whereas 3D anemometers can measure the vertical component of wind, as well.

Apart from measuring wind speed and direction, ultrasonic anemometers can also measure temperature because the speed of ultrasonic sound waves is affected by variations in temperature while maintaining independence from changes in pressure. Temperature is calculated by measuring speed variations in ultrasonic sound.

The ultrasonic anemometer is more durable as compared to the cup anemometer and vane anemometer since it has no moving parts and it operates using ultrasonic sound waves. [vi]

Figure 4: A 3D Ultrasonic anemometer measures both horizontal and vertical components of the wind speed and direction. (Source: Biral)

Tide gauge

A tide gauge is used to monitor sea level. It also detects tides, storm surges, tsunamis, swells, and other coastal processes. [vii] A tide gauge can use an ultrasonic sensor to detect real-time water level. The gauge is often linked to an online database where a record is maintained, and in case of a risky situation, the system can trigger an alarm.

Tank level

Measuring fluid level in a tank is similar to a tide gauge. However, in this case, the fluid can be clear water, a corrosive chemical, or a flammable fluid. Unlike optical sensors and float switches, ultrasonic sensors are less likely to corrode as they do not make contact with the fluid.

Functional in sunlight

The sunlight at Earth’s surface is composed of around 52-55% of infrared light.[ix] If an infrared sensor detects an object using infrared light, the process is disturbed due to the interference of infrared light present in sunlight. However, ultrasonic sensors are not affected by the infrared spectrum present in sunlight.

Web-guiding systems

Web-guiding systems position flat materials (e.g., newspaper, plastic film) and widely use ultrasonic sensors. According to Maxcess, “In 1939, Irwin Fife invented the first web guide in his Garage in Oklahoma City, Oklahoma, solving a newspaper owner’s challenge of keeping paper aligned in his high-speed newspaper press.“ [x] A web-guiding system uses a non-contact sensor for detecting and tracking objects at multiple stages. The purpose is to ensure that the material is positioned correctly. If the material is moving out of alignment, the system mechanically places it back on the machine’s processing path. Ultrasonic sensors are suitable for web-guiding systems as the process requires non-contact, high-speed, and efficient functionality.

UAV navigation

Figure 5: Ultrasonic sensor measuring height during drone’s flight. (Source: RadioLink)

Unmanned aerial vehicles (UAVs)—or drones—commonly use ultrasonic sensors for monitoring any objects in the UAV’s path and distance from the ground.

The autonomous feature of detecting safe distances enables the aircraft to avoid crashing. And as the flight of path changes instantaneously, the ultrasonic detection of distances can prenvent a drone from crashing.

Figure 6: Ultrasonic sensor measuring distance from object during drone’s flight. (Source: RadioLink)

Limitations of ultrasonic sensors

Ultrasonic sensors such as the HC-SR04 can efficiently measure distances up to 400 cm with a slight tolerance of 3 mm. [xiii] However, if a target object is positioned such that the ultrasonic signal is deflected away rather than reflected back to the ultrasonic sensor, the calculated distance can be incorrect. In some cases, the target object is so small that the reflected ultrasonic signal is insufficient for detection, and the distance cannot be measured correctly.

Furthermore, objects like fabric and carpet can absorb acoustic signals. If the signal is absorbed in the target object’s end, it cannot reflect back to the sensor, and hence, the distance cannot be measured.

Figure 7: Representation of ultrasonic signal deflected due to target object’s position, resulting in error. (Source: Macduino)

The intense sensitivity of ultrasonic sensors makes them efficient, but that sensitivity can also cause problems. Ultrasonic sensors can detect false signals coming from the airwaves disturbed by an air conditioning system and a pulse coming from a ceiling fan, for instance.

Ultrasonic sensors can detect objects placed within their range, but they cannot distinguish between different shapes and sizes. However, one can overcome this limitation can by using two sensors instead of just one sensor. One can install both sensors a distance away from each other, or they can be adjacent. By observing the overlapped shaded region, one can get a better idea of the shape and size of the target object.

Figure 8: Representation of overlapping region when one places two ultrasonic sensors at a distance or adjacent to each other. (Source: msu.edu)

 

References:

https://www.mouser.com/ds/2/813/HCSR04-1022824.pdf[ii] https://www.mpja.com/download/hc-sr04_ultrasonic_module_user_guidejohn.pdf
https://www.mpja.com/download/hc-sr04_ultrasonic_module_user_guidejohn.pdf
https://www.teachengineering.org/activities/view/nyu_soundwaves_activity1
https://www.arrow.com/en/research-and-events/articles/ultrasonic-sensors-how-they-work-and-how-to-use-them-with-arduino
https://en.wikipedia.org/wiki/Anemometer

ToughSonic® Ultrasonic Sensors Help Provide Tsunami Warning


Principles of Thermal Ecology: Temperature, Energy and Life; Clarke, Andrew. 2017
http://www.maxcessintl.com/fife
https://en.wikipedia.org/wiki/Web-guiding_systems
https://www.maxbotix.com/uav-ultrasonic-sensors.htm
https://www.mouser.com/ds/2/813/HCSR04-1022824.pdf
http://cmra.rec.ri.cmu.edu/content/electronics/boe/ultrasonic_sensor/1.html
https://www.egr.msu.edu/classes/ece480/capstone/fall09/group05/docs/ece480_dt5_application_note_nkelly.pdf
https://www.egr.msu.edu/classes/ece480/capstone/fall09/group05/docs/ece480_dt5_application_note_nkelly.pdf

You may also like:


  • Microcontroller Top Talks in July 2019 on EDABoard.com
  • Inertial Measurement Unit
    Inertial Measurement Units: The hidden key to Apollo success, now…

  • Ultrasonic sensors detect multiple objects using wide field of view
  • rohm
    Ultra-compact earthquake detection sensor modules include false-indicator prevention
  • Chirp CH-101
    Time-of-Flight sensor combines ultrasonic transducer with DSP on mixed-signal ASIC

Filed Under: FAQ, Featured, microcontroller, Sensor modules Tagged With: biral, FAQ

Primary Sidebar

DesignFast

Design Fast Logo
Component Selection Made Simple.

Try it Today
design fast globle

EE Training Center Classrooms

EE Classrooms

CURRENT DIGITAL ISSUE

A frequency you can count on There are few constants in life, but what few there are might include death, taxes, and a U.S. grid frequency that doesn’t vary by more than ±0.5 Hz. However, the certainty of the grid frequency is coming into question, thanks to the rising percentage of renewable energy sources that…

Digital Edition Back Issues

Subscribe to our Newsletter

Subscribe to weekly industry news, new product innovations and more.

Subscribe today

RSS Current EDABoard.com discussions

  • How to set USB port as RS-485 entrance? How to interpret Growatt solar inverter commands?
  • Find Critical Path in Cadence Genus?
  • Simulation of a Press-ON-Press-OFF push button
  • HFSS 2022 R2 - Waveguide port configuration
  • Why this antenna azimuth and elevation direction are the same?

RSS Current Electro-Tech-Online.com Discussions

  • How know if solder iron has good quality tip?
  • How does a transistor works as a switch?
  • Peltier control
  • How to set USB port as RS-485 entrance? How to interpret Growatt solar inverter commands?
  • Component Identification

Footer

Microcontroller Tips

EE World Online Network

  • DesignFast
  • EE World Online
  • EDA Board Forums
  • Electro Tech Online Forums
  • Connector Tips
  • Analog IC Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • Wire and Cable Tips
  • 5G Technology World

Microcontroller Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us
Follow us on Twitter Add us on Facebook Follow us on YouTube  Follow us on Instagram

Copyright © 2022 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy