Technical information
Maximum range is a little over 3m. As and example of the sensitivity of this design, it
will detect a 1inch thick plastic broom handle at 2.4m.
Average current consumption is reasonable at less than 50mA and typically about 30mA.
Download the source code and a ready assembled hex file.
Calculating the Distance
The SRF04 provides an echo pulse proportional to distance. If the width of the pulse is
measured in uS, then dividing by 58 will give you the distance in cm, or dividing by 148
will give the distance in inches. uS/58=cm or uS/148=inches.
Changing beam pattern and beam width
You can't! This is a question which crops up regularly, however there is no easy way to
reduce or change the beam width that I'm aware of. The beam pattern of the SRF04 is
conical with the width of the beam being a function of the surface area of the transducers
and is fixed. The beam pattern of the transducers used on the SRF04, taken from the
manufacturers data sheet, is shown below.
There is more information in the sonar faq.
Update - May 2003
Since the original design of the SRF04 was published, there have been incremental
improvements to improve performance and manufacturing reliability. The op-amp is now
an LMC6032 and the comparator is an LP311. The 10uF capacitor is now 22uF and a few
resistor values have been tweaked. These changes have happened over a period of time.
All SRF04's manufactured after May 2003 have new software implementing an optional
timing control input using the "do not connect" pin. This connection is the PIC's Vpp line
used to program the chip after assembly. After programming its just an unused input with