June 2018
Beginner to intermediate
280 pages
6h 58m
English
The timing of the waveform on each pin is shown in the following diagram. We need to apply a short 10 µs pulse to the trigger input to start the ranging and then the module will send out an eight-cycle burst of ultrasound at 40 KHz and raise its echo. The echo is a distance object that is the pulse width and the range in proportion. You can calculate the range through the time interval between sending trigger signals and receiving echo signals using the following formula:
Range = high level time of echo pin output * velocity (340 M/S) / 2.
It will be better to use a delay of 60 ms before each trigger to avoid overlapping between trigger and echo: