I need to measure the distance to a solid or liquid in a round tank about 2 feet wide and 5 feet deep using a sensor that can output PWM and run at 3.3 or 5 volts.

After testing, I've found that the HC-SR04 has too wide a beam to measure accurately at all distances within the tank, from what I assume is echos off the walls. I've found a MaxBotics sensor that works but is too expensive to use when making multiple sensing units.

Do you guys know of any cheap sensors that may be able to fulfill these requirements or a way to narrow the beam of the HC-SR04? It seems like an "exponential horn" on the sensor is one way to narrow the beam, but I can't find any resources on the dimensions of such a horn.


1 Answer 1


Since your specs are just hand-waving arguments, I can suggest a really small Satelite parabolic dish with an offset sensor.

But for giggles, I would try a long heat-shrunk tubing over the sensor to attenuate the stray angular signals.

But this path loss will also attenuate the sensing range so refocusing all the energy makes more sense. (no pun intended) Focal path dispersion will occur from irregular shapes and result in weaker noisy edges.

Spec: effectual angle: less than 15°; distance: 2cm~500cm

It might be tried to measure the acoustic resonant frequency of the remaining air in the tank using a low-level sweep generator to an acoustically flat external speaker air plenum. (like a bass reflex effect)Then calibrate.

Another possible solution is plastic coated electrodes for capacitance or SRF frequency measurements.

Yet another is using UHF to measure the return loss in a splitter to a diode detector and FET buffered mV reading. Sweep the RF to detect the wavelngth for either a null detection or a peak half wave. Then calibrate for accuracy. The antenna could be a short rubber ducky, that does not need to be even unity gain as antenna efficiency drops with length.

But if you are trying to make a $1 sensor, you got your work cut out for you.

  • \$\begingroup\$ Sorry, I don't really know the correct terminology for ultrasonic sensors. Can you provide a link to such a device? Thanks! \$\endgroup\$
    – Max Maeder
    Commented Jun 20, 2020 at 0:10
  • \$\begingroup\$ Could I use a satellite parabolic dish with the HC-SR04? I don't really want to use a tube because it decreases the sensor's dead zone. Could I use a horn? If so, could you specify the approximate angle of the horn wall? Thanks for all your help, I'm obviously not an expert at ultrasonics. \$\endgroup\$
    – Max Maeder
    Commented Jun 20, 2020 at 0:37
  • \$\begingroup\$ You have the correct terminology. I dont have any links \$\endgroup\$ Commented Jun 20, 2020 at 0:37
  • \$\begingroup\$ Sorry, I believe we commented at nearly the same time, and you might not have seen my latest comment. Please see above. \$\endgroup\$
    – Max Maeder
    Commented Jun 20, 2020 at 0:44
  • \$\begingroup\$ I don't think a tube will narrow the beam since that sensor (in air) is only about 1 wavelength wide. The end of the tube would be a point source, which would also radiate over a very wide angle. You would have to let the beam expand and then focus it with a dish or horn. I suggest getting a big, metal mixing bowel. \$\endgroup\$ Commented Jun 20, 2020 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.