Measure distance like bat does, with ultrasonic waveform!
The HC-SR04 is an ultrasound module allowing the evaluation of a distance from 2cm to 400cm. The measurement is made "contactless" and has a precision of 3mm under optimal conditions. The module includes a transmitter and an ultrasonic receiver as well as an electronic control. The operation of this module is similar to that of a submarine sonar and its implementation is relatively simple.
Unlike our other ultrasound module, HC-SR4 is not autonomous and requires the use of an Arduino (or other microcontroller) to work.
Functional principle of the module:
- The module emits a sonar wave consisting of a series of 8 pulse at 40 kHz.
A sound at 40 KHz is inaudible to the human ear capable of perceiving sounds between 16Hz et 16KHz (cfr Wikipédia).
- Using the Trig pin, you send a signal to activate the triggering of the sonar pulse.
- The advantage of using an acute sound is that it is directional (spreads in a straight line) while the low frequencies pass through the material. It's for this reason that we hear only the bass when the neighbors make fiesta!
- If the signal returns... the output goes high during the entire period the wave travels to the object and returns after being reflected by it last.
The estimated distance = time during which the output signal is high x the speed of sound (340m/s) / 2.
If the output pulse time is less than 60ms, you can also use the simplified formula distance_in_cm = pulse_time_µS / 58.
- It is important to connect the ground (GND pin) before placing the power supply on VCC. This strongly affects the operation of the module.
- Make sure that the surface of the object to be detected is at least 0.5 m² (for better performances)
- VCC - 5V power supply
- Trig - Input to trigger the pulse
- Echo - Output, to determine the reception of the echo
- GND - The ground
- Operating voltage: 5V continuous
- Consumption (in operation): 15mA
- Operating frequency: 40Hz
- Minimum distance: 2cm
- Maximum distance: 400cm (4m) (in good conditions)
- Angle of measurement: 15 degrees
- Input signal - trig: triggering the measurement: pulse 10µS TTL
- Output signal - echo: pulse when the echo is received: TTL signal (depends on the measured distance)
- Dimensions: 45 x 20 x 15mm