Height of a loose solid material


After a device that will measure the height of a solid (dry dog food) pile inside an enclosure (1.5m high, 100mm deep and 300mm wide). Prefer a height measurement device but would also consider something where a beam gets broken. Assuming a mmwave device may not work on this confinement? Prefer something simple that is independent, but it could run off an esp8266 or esp32 device if that's the only option.


I have created a dry dog Feeder using a custom housing (can take 20kg of food), 3d printed oaddel wheel and a servo motor. Using an esp device with a hubduino sketch.

Now I've been using this for a while. It originally had a button input and an led driver but it's now back to basics and just the servo motor after I had some wiring changes performed by my dog.. However I'd like to have a device to tell me when it's near empty. I have used a samsung SmartThings Multipurpose sensor and a vibration sensor where the food drops out but that's more a fully empty measurement and prefer it to occur before it runs out.

Weight might be another possibility but I don't know of a sensor off the top of my head.

1 Like

Throwing some ideas out there..

Add a spring loaded switch that gets buried under the dog food so the weight closes the switch. Connect that to the esp8266 I have on the system. Have a feeling it may not be reliable.

Use one of my Samsung water leak sensors and connect a switch sensor across the terminals. Same principle as above.

Was hoping to not change code or modify a sensor ideally but I feel it may be the better options..

How about a lux/light sensor. When the sensor is uncovered the sensor triggers the refill warning. I did something similar for my Tegu and her humidifier. It has a leak sensor on her humidifier so when it triggers dry, it sends me a message to refill the humidifier.

Another option is for the dispenser to work out how many meals it can do from full and count the number less a certain amount and then warn you..

Even simpler is a microswitch on the side of the hopper that is held down by the food. As the level drops, the switch opens..

1 Like

Thanks for your thoughts.

For this I'd need a light inside, but I was considering putting the led back inside so I can see the level from outside (I routed slots with a clear cover).. And I'd need to keep the sensor outside of the food otherwise it may get dirty. However it's on the list of potentials.

I'd also need to measure what goes in for this. Easy to implement though as I have hubitat counting daily feeds already.

This is the route I've been thinking about. I'd need to stop food going under the switch or pedal that's mounted on it otherwise the switch won't depress. Ideally if I found a ip rated switch all that may be taken care of already.

I am wondering if an infrared based beam breaking thing may be good. I could have the omitted or receiver outside but I'd need to keep the one inside the box clean.. Unless I used a reflective system then I guess both could be outside.

I use weight to measure the level of salt in a water softener salt tank. I combined a cheap scale with an arduino board.

It was a project for sure, but it has been rock solid for the last year or so.

If you’re interested in this path I’d be happy to dig up the post I used as my guide.


Interested as I already have an esp8266 mounted to the unit. I guess the box I built weights 20kg. So scales should be ok with measuring when there is only say 100kg of food left.

I don't mind to go searching.

Any ideas of costs for this approach? I was actually looking for some smart scales (personal weighing ones) this morning but I feel they all go to sleep and potentially self tare.. Plus they are expensive.

I'm thinking this may work fairly hooked up to the esp8266 digital pin I hope that the emitter has enough power to bounce of the box surface so I can have both emitter and reciever outside the box beaming through the clear acrylic slot window on the box..

The scale was $20, an amp was $8, plus a little for a project box. That plus an arduino board is all that I used.

The scale was an Eteckcity (link below). The HX711 amp module came with 4 half bridge strain gauges (second link below). I used the the amp, but stuck with the strain gauges that came with the scale. Basically, I wired the strain gauges that were on the scale to the HX711 and then wired the HX711 to the Arduino.



1 Like

here the post that followed...


1 Like

Ok so I have now bought the hx711 and the 4x load cells (strain gauges). Seems combined the 4x gauges make a full bridge load cell so I guess if I use them under the legs then I'll need to calibrate based on where the dog Feeder sits seeing the bridge will be unbalanced. Which works OK in this case as the dog Feeder doesn't get moved around.

Thing that concerns me is the drift I have read somewhere in the links you said (I went around and around to many pages so thanks for those links). Potentially this could even be a temperature based drift, although with all strain gauges in the same climate seeing all are active gauges I hope I don't see that drift (potentially they used bridge completion resistors I didn't pay attention).

I made mine even easier. I use a water sensor with a pigtail on it. The pig tail sits on top of the salt and when it hit's the brine it notifies me. Almost 2 years and no corrosion on the pigtail.

I'm using an ESP8266 with an SR04 ultrasonic sensor to measure the salt level in my water softener. It's been working well for a few years now.

This isn't my post, but the concept is the same.


Oh man I can't help myself now.. So I have ordered the hx711 plus load cells, and now I've also ordered a few sr04 ultrasonic sensors.. Plus almost bought an infra red break beam... I need to stop ha ha.

Going to play around to see which works best. Then likely use the other one somewhere else around the home.


Below is my initial thought when reading the project details.

I've ordered the ultrasonic sensors already and they will come today. So I'll have all three types.

My order of preference to work.

  1. Weight as that gives a good gauge of volume
  2. Ultrasonic as that gives height (although for a solid it may not be a flat pile so volume a little less accurate)
  3. Infrared break beam, as it only indicates when low not the actual level.

However I feel the order of difficulties arising is in the same order.

I'm yet to see if the weight measurement with those amplifiers will give 100g confidence. I'm not convinced the ultrasonic sensor will work well inside a narrow box with reflections off the side walls. The IR I feel will have the least complications as I'll have one each side of the outside of the box so they won't even get dirty.

Ok so I have all three sensors working in tasmota, and more relavent to this forum also showing in hubitat.

I tried the ultrasonic distance device first, and while it works OK I have found the pile can change in flatness when the food dispenses so it's not always accurate. The signal fluctuates a little but that's ok accuracy for me in this situation, it's more the uneven surface that's the problem.

I will look at printing brackets for the load cells next.. As that'll get around the mound of dog food bit stating flat. Although I hope they don't drift so can't accurately measure the true weight. Also a little harder to mount them which is why I didn't try them first.

Otherwise I could run more than one ultrasonic sensor buy I feel that may interfere with each other inside the enclosure.

Ok so load cell brackets printed but I have found the drift on the load cell arrangement too high. Especially when this goes goes outside where temperatures change even more so. From what I have read I don't think I can resolve this so the load cell idea is just not accurate enough for long term monitoring in my case.

So it's back to the ultrasonic sensor, either potentially relocate the sensor to reduce error due to uneven surface. Or potentially use 2x but I feel they may interfere.