Technical information
The SRF04 Timing diagram is shown below. You only need to supply a short 10uS pulse
to the trigger input to start the ranging. The SRF04 will send out an 8 cycle burst of
ultrasound at 40khz and raise its echo line high. It then listens for an echo, and as soon as
it detects one it lowers the echo line again. The echo line is therefore a pulse whose width
is proportional to the distance to the object. By timing the pulse it is possible to calculate
the range in inches/centimeters or anything else. If nothing is detected then the SRF04
will lower its echo line anyway after about 36mS.