An Ultrasonic sensor is a device that can measure the distance to an object by using sound waves. It measures distance by sending out a sound wave at a specific frequency and listening for that sound wave to bounce back. By recording the elapsed time between the sound wave being generated and the sound wave bouncing back, it is possible to calculate the distance between the sonar sensor and the object.
Since it is known that sound travels through air at about 344 m/s (1129 ft/s), you can take the time for the sound wave to return and multiply it by 344 meters (or 1129 feet) to find the total round-trip distance of the sound wave. Round-trip means that the sound wave traveled 2 times the distance to the object before it was detected by the sensor; it includes the ‘trip’ from the sonar sensor to the object AND the ‘trip’ from the object to the Ultrasonic sensor (after the sound wave bounced off the object). To find the distance to the object, simply divide the round-trip distance in half.
Working Of Ultrasonic Sensor
It is important to understand that some objects might not be detected by ultrasonic sensors. This is because some objects are shaped or positioned in such a way that the sound wave bounces off the object, but is deflected away from the Ultrasonic sensor. It is also possible for the object to be too small to reflect enough of the sound wave back to the sensor to be detected. Other objects can absorb the sound wave together (cloth, carpeting, etc), which means that there is no way for the sensor to detect them accurately. These are important factors to consider when designing and programming a robot using an ultrasonic sensor.
Ultrasonic sensors generate high-frequency sound waves and evaluate the echo which is received back by the sensor, measuring the time interval between sending the signal and receiving the echo to determine the distance to an object.
Fig. Principle of sensor
The ultrasonic sensor sends a high-frequency sound pulse and calculates how long it takes for the echo of sound to revert back.
The speed of sound is approximately 341 meters per second in air. The sensor uses the speed of sound in air and time taken by the sensor to transmit and receive the sound to calculate the distance. Thus detects the object and finds the location of the object.
Distance = time X (speed of sound)/2
The sound has to travel from the sensor to the object and revert it back so, divide the speed by 2.
Laws of physics for sound waves
Sound waves are having specific frequencies or number of oscillations per second. Humans can detect sounds in a frequency range from about 20Hz to 20 kHz. However, the frequency range normally employed in ultrasonic detection is 100 kHz to 50MHz. The velocity of ultrasound at a particular time and temperature is constant in a medium.
W = C/F (or) W = CT
Where W = Wave length
C = Velocity of sound in a medium
F = Frequency of wave
T=Time Period
The most common methods of ultrasonic examination utilize either longitudinal waves or shear waves. The longitudinal wave is a compression wave in which the particle motion is in the same direction as the propagation wave. The shear wave is a wave motion in which the particle motion is perpendicular to the direction of propagation. Ultrasonic detection introduces high-frequency sound waves into a test object to obtain information about the object without altering or damaging it in any way. Two values are measured in ultrasonic detection.
The amount of time, taken for the sound to travel through the medium and amplitude of the received signal. Based on velocity and time thickness can be calculated.
The thickness of material = Material sound velocity X Time of Fight
Transducers for Wave Propagation and particle detection
For sending sound waves and receiving echoes, ultrasonic sensors, normally called transceivers or transducers will be used. They work on a principle similar to radar that will convert electrical energy into mechanical energy in the form of sound, and vice versa.
The commonly used transducers are contact transducers, angle beam transducers, delay line transducers, immersion transducers, and dual element transducers. Contact transducers are typically used for locating voids and cracks to the outside surface of a part as well as measuring thickness. Angle beam transducers use the principle of reflection and mode conversion to produce refracted shear or longitudinal waves in the test material.
Delay line transducers are single element longitudinal wave transducers used in conjunction with a replaceable delay line. One of the reasons for choosing a delay line transducer is that near-surface resolution can be improved. The delay allows the element to stop vibrating before a return signal from the reflector can be received.
The major advantages offered by immersion transducers over contact transducers are Uniform coupling reduces sensitivity variations, Reduction in scan time, and increases sensitivity to small reflectors.
Connection
- Vcc: Input voltage +5 V
- GND: External ground
- Trig: Digital Pin
- Echo: Digital Pin
The Trig pin is used to send the signals and the Echo pin is used to listen to the returning signals.
Note: when installing, connect the GND terminal first, otherwise, the module may get damaged.
Specifications
- Input voltage: 5 V DC
- Static current: <2 mA
- Output voltage: 5 V high and 0 V low
- Detection range: 2 cm to 500 cm
- Dimensions: 3.4 x 2 x 1.5 cm
- Input trigger signal: 10 us TTL impulse
- Echo signal: output TTL PWM signal
Advantages
- Provides precise and noncontact distance measurement within 2cm to 3m range.
- Ultrasonic measurement works in any lighting condition, hence a supplement for infrared object detectors.
- Burst indicator LED shows measurements in progress.
- 3 pin header makes it easy to connect to the development board directly or with an extension cable without any soldering.
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 are 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.
3 Applications involving Ultrasonic detection:
The distance of obstacles or discontinuities in metals is related to the velocity of sound waves in a medium through which waves are passed and the time taken for echo reception. Hence ultrasonic detection can be used for finding the distances between particles, for detecting the discontinuities in metals, and for indicating the liquid level.