Skip to content

Ultrasonic Sensor Module HC-SR04

Published Updated 56 views Report an error

Ultrasonic Sensor Module HC-SR04 overview

Ultrasonic Sensor Module HC-SR04 is commonly used with both microcontroller and microprocessor platforms like Arduino, ARM, PIC, Raspberry Pie, etc. The following guide is universal since it has to be followed irrespective of the type of computational device used. Power the Ultrasonic Sensor Module using a regulated +5V through the Vcc ad Ground pins of the sensor. The current consumed by the sensor is less than 15mA and hence can directly power by the onboard 5V pins (If available). The Trigger and the Echo pins are both I/O pins and hence they can connect to the I/O pins of the microcontroller. To start the measurement, the trigger pin has to make high for 10uS and then turned off.

This action will trigger an ultrasonic wave at a frequency of 40Hz from the transmitter and the receiver will wait for the wave to return. Once the wave is returned after it gets reflected by any object the Echo pin goes high for a particular amount of time which will be equal to the time taken for the wave to return back to the sensor. The amount of time during which the Echo pin stays high is measured by the MCU/MPU as it gives the information about the time taken for the wave to return back to the Sensor. Using this information the distance is measured as explained in the above heading.

Key specifications

Theoretical Measuring Distance
2cm to 450cm
Operating voltage
+5V
Practical Measuring Distance
2cm to 80cm
Accuracy
3mm
Measuring angle covered
<15°
Operating Current
<15mA
Operating Frequency
40Hz

Ultrasonic Sensor Module HC-SR04 pinout

NameDescription
VccThe Vcc pin powers the sensor, typically with +5V
TriggerThe trigger pin is an Input pin. This pin has to be kept high for 10us to initialize measurement by sending a US wave.
EchoThe echo pin is an Output pin. This pin goes high for a period of time which will be equal to the time taken for the US wave to return back to the sensor.
GroundThis pin is connected to the Ground of the system.

Ultrasonic Sensor Module HC-SR04 applications

  • Used to avoid and detect obstacles with robots like biped robots, obstacle avoider robots, pathfinding robots, etc.
  • Used to measure the distance within a wide range of 2cm to 400cm
  • Can use to map the objects surrounding the sensor by rotating it
  • Depth of certain places like wells, pits, etc can measure since the waves can penetrate through the water

More about Ultrasonic Sensor Module HC-SR04

Datasheet

Download Datasheet from the link given below.

Comments 0

Leave a comment