# Using the HC-SR04 for level detection in a bottle

**URL:** <https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882>\
**Category:** Distance\
**Created:** [May 15, 2019, 9:57am UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882 "2019-05-15T09:57:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frans\_Ravn](https://avatars.discourse-cdn.com/v4/letter/f/4af34b/32.png) [@Frans\_Ravn](https://community.sparkfun.com/u/Frans_Ravn)\
**Post date:** [May 15, 2019, 9:57am UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882/1 "2019-05-15T09:57:40Z")

</div>

Hi Sparkfun.

I am evaluating the module HC-SR04 in order to use it for level detection in a bottle.

The bottle I am using is 90 x 120 x 210 mm.

Attached you will find my first test of the device, which I actually finds quite OK 🙂

You also see at photo indicating the setup I am using. I have the Transmitter placed in the center of the opening of the bottle.

I can see that the reported distance can be affected if I am pressing on the sides of the bottle so the dimension of 90 mm becomes e.g. 70 mm, which I understand.

The datasheet report a beam og 15 degree. Is this +/- 15 degree or is it the full beam angle?

Is it possible to lower this beam angle?

Is it possible to decrease the distance between the transmitter and the receiver?

Best Regards

Frans Ravn

ChemoMetec A/S

[www.chemometec.com](http://www.chemometec.com)

 ![Setup.JPG](https://canada1.discourse-cdn.com/sparkfun/original/3X/6/c/6c4f8ba9f002a11debfcc8e4a9a56794bccbd5b6.jpeg)

[Response.pdf](https://community.sparkfun.com/uploads/short-url/t6lpk8LjrH7YZdBPBHxMxQKYETx.pdf) (214 KB)

---

<div class="post-metadata">

**Author:** ![TS-Chris](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-chris/32/6057_2.png) [@TS-Chris](https://community.sparkfun.com/u/TS-Chris)\
**Post date:** [May 15, 2019, 8:15pm UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882/2 "2019-05-15T20:15:30Z")

</div>

Hi Frans. Thanks for your post.

We don’t make the HC-SR04 and don’t have a lot of information on it so I don’t have an answer on the beam angle.

For decreasing the distance between the transmitter and receiver, you might try mounting them on a separate board and see what happens. I would imagine you could move them around a bit before they stop working.

---

<div class="post-metadata">

**Author:** ![Frans\_Ravn](https://avatars.discourse-cdn.com/v4/letter/f/4af34b/32.png) [@Frans\_Ravn](https://community.sparkfun.com/u/Frans_Ravn)\
**Post date:** [May 22, 2019, 8:59am UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882/3 "2019-05-22T08:59:11Z")

</div>

Hi Chris. Are you able to answer my question regarding the beam angle. The datasheet report a beam og 15 degree. Is this +/- 15 degree or is it the full beam angle?

Best Frans.

---

<div class="post-metadata">

**Author:** ![TS-Chris](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-chris/32/6057_2.png) [@TS-Chris](https://community.sparkfun.com/u/TS-Chris)\
**Post date:** [May 29, 2019, 9:25pm UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882/4 "2019-05-29T21:25:00Z")

</div>

Sorry, I don’t have an answer on the beam angle.

---

<div class="post-metadata">

**Author:** ![PthDE](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@PthDE](https://community.sparkfun.com/u/PthDE)\
**Post date:** [June 6, 2019, 11:51am UTC](https://community.sparkfun.com/t/using-the-hc-sr04-for-level-detection-in-a-bottle/36882/5 "2019-06-06T11:51:41Z")

</div>

> TS-Chris:  
> Hi Frans. Thanks for your post.
> 
> We don’t make the HC-SR04 and don’t have a lot of information on it so I don’t have an answer on the beam angle.
> 
> For decreasing the distance between the transmitter and receiver, you might try mounting them on a separate board and see what happens. I would imagine you could move them around a bit before they stop working.

I would go for a 15° (like +/- 7.5° if you will) beam angle. I come from a back ground of antennae and light reflectors and know “beam angle” to be the angle of a cone who’s tip or point is at the transmitter or receiver (sensor).

Pete
