This is the HC-SR04 ultrasonic ranging sensor. It is the heart of the Ultrasonic Rangefinder demonstrator. This sensor provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit. There are four pins: VCC (Power), Trig (Trigger), Echo (Receive), and GND (Ground}
A short 10uS pulse to the trigger input starts the ranging, and then the module sends out an 8 cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a distance object that is pulse width and the range in proportion . One can calculate the range through the time interval between sending trigger signal and receiving echo signal. Formula: uS / 58 = centimeters or uS / 148.148 =inch; or: the range = high level time * velocity (340M/S) / 2
The speed of sound is the distance traveled per unit time by a sound wave as it propagates through an elastic medium. In dry air at 20 °C (68 °F), the speed of sound is 343 metres per second (1,125 ft/s; 1,235 km/h; 767 mph; 667 kn), or a kilometre in 2.91 s or a mile in 4.69 s.
For an Ultrasonic Range Finder the calibration can be calculated as follows:
The average speed is 1125 ft/sec.
1125 ft/sec x 12 in/ft = 13500 in/sec
To calculate the time for sound to travel 1 inch: 1/13500 in/sec = .000074074 sec/in
The time in microseconds = .000074074 x 1000000 = 74.074 microseconds/in
The time for round trip out and back = 2 x 74.074 msec/in = 148.148 msec/in
The distance determined by the system timing signals from the Ultrasonic Range finder is simply calculated by: Distance = microseconds/148.148 msec/in
ULTRASONIC RANGE FINDER SYSTEM
To enlarge the image left click on it
The Ultrasonic Range Finder Demonstrator system diagram is shown above. The system is operated with a specific program running in the Microcontroler. The system operates as follows:
(1) The system is completely off until the push button is pushed. This starts the program which configures the microcontroller to operate the ultrasonic finder module.
(2) A positive trigger pulse is sent to the ultrasonic range finder module.
(3) A transmit pulse ultrasound is sent through the air in the direction of the target object.
(4) The echo pulse is sent to the receiver.
(5) The ultrasonic range finder module sends a pulse to the microcontroller which is positive during the time that the ultrasound pulse is traveling to the object and back.
(6) The controller calculates the total travel time.
(7) In this demonstrator the microcontroller compares the travel time with the time for accepted distance the object is away from the module. A distance of about 12 +/- 1 inch of is accepted as correct.
(8) If the distance is correct the appropriate beeps will be produced by the piezo buzzer. If the distance is wrong only one beep will be heard.
Development of the Range Finder Demonstrator
Right click on pictures for larger view
Above is a picture of the oscilloscope display of the signal returned on the Echo output of the range finder module with the ultrasonic pulse bouncing off from an object held above it. The total time between the Pulse Sent and Pulse Return is 1890 microseconds.
The distance the object was above the module is calculated by 1890 msec/in / 148.148 in/msec = 12.75 inches