Description: HC-SR04 ultrasonic module can offer non-contact distance sensing function, the range from 2cm to 450cm. and the range accuracy is up to 3mm; the module includes ultrasonic transmitter, receiver and control circuit.
The sensor measures distance using sonar; an ultrasonic (well above human hearing) pulse is transmitted from the unit and distance-to-target is determined by measuring the time required for the echo return.
The module is based on the measurement of time flight of ultrasonic pulse, which is reflected by an object. The distance to be measured mainly depends on the speed of ultrasonic waves in space or air –which is a constant- and the flight time of the pulse. The module performs these calculations and outputs a pulse width depends on the measured distance, this pulse is easily interfaced to any microcontroller.
Module main technical parameters:
● Working Voltage : 5V (DC)
● Static current: Less than 2mA.
● Output signal: Electric frequency signal, high level 5V, low level 0V.
● Sensor angle: Not more than 15 degrees.
● Detection distance: 2cm - 400cm.
● High accuracy : Up to 0.3cm
● Input trigger signal: 10us TTL impulse
● Echo signal : output TTL PWL signal
● Interface connector: 4-pin header SIP.
● Board dimensions: 45.5mm x 20mm
The basic operation principle:
use IO port TRIG to trigger ranging. It needs 10 us high level signal at least
Module can send 8 pro 40 kz square wave automatically, and will test if there is any signal returned. If there is signal returned, output one high level signal via IO port ECHO. The duration of the high level signal is the time from transmitter to receiving with the ultrasonic.
Distance (cm) = duration of high level * sound velocity (340m/s) / 2
or
Distance (cm) = Echo back Pulse width time (μs) / 58
Interface connection pins:
1. VCC
2. Trig (T)
3. Echo (R)
4. GND
Some useful resources: