Understanding How Ultrasonic Sensors Work


how ultrasonic sensors work

Ultrasonic sensing is one of the best ways to sense proximity and detect levels with high reliability.

Our technical support gets emails all of the time about how our sensors work and what environments our sensors work (or don’t work) in.

This guide was created as an introduction to ultrasonic sensing, it’s principles, and how ultrasonic sensors work in your applications.


At a top level, you need to know what an ultrasonic sensor is…

What is an ultrasonic sensor?

An ultrasonic sensor is an instrument that measures the distance to an object using ultrasonic sound waves.

An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay back information about an object’s proximity.  

High-frequency sound waves reflect from boundaries to produce distinct echo patterns.


How Ultrasonic Sensors Work.

Ultrasonic sensors work by sending out a sound wave at a frequency above the range of human hearing.  The transducer of the sensor acts as a microphone to receive and send the ultrasonic sound. Our ultrasonic sensors, like many others, use a single transducer to send a pulse and to receive the echo.  The sensor determines the distance to a target by measuring time lapses between the sending and receiving of the ultrasonic pulse.


how ultrasonic sensors work


The working principle of this module is simple.  It sends an ultrasonic pulse out at 40kHz which travels through the air and if there is an obstacle or object, it will bounce back to the sensor.  By calculating the travel time and the speed of sound, the distance can be calculated.  

Using Your Ultrasonic Sensor in Your Project


We used an Arduino in this example, but you can use another controller and program of your choice.Direct HRLV AV Arduino Wiring


Install Arduino Sketch coding software onto your PC. This is where you type the code you want to compile and send to the Arduino board.



Plug your Arduino into the USB cable and into your computer. Once you upload Arduino, you can then compile and activate the code.



The code below will allow you to read distance in centimeters. Compile and run this code to obtain real-time distance measurements to the closest object. (Please note: this code is not only for Arduino and will run on most controllers)


Why use an Ultrasonic Sensor?

Ultrasound is reliable in any lighting environment and can be used inside or outside.  Ultrasonic sensors can handle collision avoidance for a robot, and being moved often, as long as it isn’t too fast.  

Ultrasonics are so widely used, they can be reliably implemented in grain bin sensing applications, water level sensing, drone applications and sensing cars at your local drive-thru restaurant or bank.

Ultrasonic rangefinders are commonly used as devices to detect a collision.  

Ultrasonic Sensors are best used in the non-contact detection of:

  • Presence
  • Level
  • Position
  • Distance

Non-contact sensors are also referred to as proximity sensors.

Ultrasonics are Independent of:

  • Light
  • Smoke
  • Dust
  • Color
  • Material (except for soft surfaces, i.e. wool, because the surface absorbs the ultrasonic sound wave and doesn’t reflect sound.)


Long range detection of targets with varied surface properties.


Ultrasonic sensors are superior to infrared sensors because they aren’t affected by smoke or black materials, however, soft materials which don’t reflect the sonar (ultrasonic) waves very well may cause issues. It’s not a perfect system, but it’s good and reliable.


Applications Involving Ultrasonic Detection:

Ultrasonic Distance Measuring

Distance measurement is based on the measurement of time-of-flight.  The time between sending and receiving the reflected sound signal is calculated by the sensor.  Ultrasonic distance sensors, like the MB7360 HRXL-MaxSonar-WR, are used as height monitors, in bin level measurement and proximity zone detection applications.   

      • Ex. Distance measurement would be applied in a garage parking application, sensing when a vehicle is pulled completely into a garage.
      • The MB7360 has been used as a bin level sensor to detect the presence or absence of grain and other materials in bins.


Popular Sensors for Measuring Distance


Ultrasonic Level Sensors

      • Tank level measurement, Fuel gauging, irrigation control.
      • This project for a Low Power Water Level Sensor, from Hackster.io developer Amedee,  uses a weather resistant sensor from our WR line.  In combination with a LoraWan node and The Things IoT open source network, this project was developed to measure the water level in a rainwater tank.  Although, it can be used in many applications. 


Popular Sensors for Liquid Level Sensing


Ultrasonic Obstacle Detection

      • Our UAV Sensors for Drones as well as our proximity sensors that are used for robots are for obstacle detection.
      • Ultrasonic sensors are suitable for close range detection up to ten meters and provide multiple range measurements per second.
      • Main advantages:
        • Low power consumption – can be powered by battery, inexpensively.
        • Can operate in many environmental conditions – ultrasonic sensors work in smoke filled environments, where other sensors would fail.


Popular Sensors for UAV Applications

Have you checked out these Case Studies from our Collaborators?

We currently have a Collaborator program that highlights the use cases of our sensors in various applications.  You can view a few of them below.

Interested in joining the Collaborator program?  Contact us here.


radiobridge sensor

Radio Bridge developed a Wireless Ultrasonic Level Sensor with LoRaWAN

Ultrasonic Distance Sensor for Tank Level Measurement

LX Group developed an Ultrasonic Distance Sensor for Tank Level Measurement

IoT distance sensor

Sweden based company ELSYS uses a sensor from our WR line in their IoT Distance Sensor


IoT Level Sensor

TECLAB and FAST provide an IoT Level Sensor named Level-X


In Conclusion…

Ultrasonic sensors are a reliable, cost-effective solution for distance sensing, level, and obstacle detection.

Once you understand how ultrasonic sensors work and what ultrasonic technology is perfect for and not so good for, you can make a more educated decision on the right sensor system for your application.  

Take a look at our patent pending solution for sensing cargo in 53′ trailers to detect the fullness or absence.  Read about the Trailer Cargo Sensor.


Review our product catalog and contact our Technical Support Team by clicking the button below to get help selecting a sensor.


Understanding How Ultrasonic Sensors Work
Article Name
Understanding How Ultrasonic Sensors Work
If you're considering using ultrasonic technology to sense in your project there are things you need to understand. This article provides information on how ultrasonic sensors work.
Publisher Name
MaxBotix Inc.
Publisher Logo
Do NOT follow this link or you will be banned from the site!