Automatically determining volume

Was thinking about some project that revolves around mugs and would use the volume of whatever mug was placed within it to activate a separate component. The part that stumps me is I'm not entirely sure of the best approach. I was considering something like lidar or lidar adjacent but I was wondering if there was a simpler method I had missed. The idea would be to automatically calculate the volume of the empty mug to be used elsewhere, so as long as it can output volume it's good.

Any advice would be appreciated and as always if this is the wrong section to post this in just point me in the right direction and I'll be on my way.

Are we considering something that is designed to contain liquid? Are you wanting to measure the inside volume or the outside volume. There is different shapes to consider.
Paul

Can you fill it with a liquid and measure the volume pumped into it? You could use a simple float switch to sense when full.

Hi, @theaetherbunny

I think @theaetherbunny wants to be able to determine the volume of the mug before filling it.
If each different mug volume is associated with a specific empty mug mass, then weighing the mug before filling may be the way.
But using a "full" sensor may be the easiest way to go.

Tom... :smiley: :+1: :coffee: :australia:

Ideally it would be the inside volume of a mug that would be measured, and yes it would be designed to hold liquid.

Though that would be a quick solution, I was looking for something that would be able to take different volume measurements from different mugs. Ideally you could only swap out the mugs without having to reconnect the switch to each mug.

Could you elaborate on "If each different mug volume is associated with a specific empty mug mass, then weighing the mug before filling may be the way."
I would like to use that idea but I'd be worried that not all mugs would have the same volume to mass ratio.

Hi,

What is the application?
Are you filling a set of different types of mugs that you know their empty mass and volume,
or are you just aiming to fill any old mug that comes in off the street?

Sounds like an automated barista or coffee pod machine?

Tom... :smiley: :+1: :coffee: :australia:

Yea, you got me. I'll spill the proverbial beans or I guess leaves in this case. I'm looking to make an automated tea machine. The idea would be to be able to use any old mug, cup or anything in between, find its volume and then use that volume to dispense the optimal amount of tea leaves to be used. As opposed to using one size of tea bag for different sized mugs this ideally would automatically do it depending on the mugs volume.

By the by, thanks for the interest in it.

Hi,
Yes, makes sense for a proper cup of tea.
Fine China or just a good old ceramic/plastic mug, you will have differences in size/mass/volume ratios.

You could go Rasp Pi and have a camera look at a profile of the cup and make an approximation.
If it detects a proper tea cup then that will probably have thinner walls compared to a mug that may have thicker.

Experiment, overkill can sometimes produce some good stuff.

Tom.. :smiley: :+1: :coffee: :australia:
PS. I'm not am image recognition expert, very far from it.

Hi,
Another thought, with a level sensor, pre fill the cup/mug and get the volume that way.
Prefill with hot, to preheat the cup/mug.

Of course we have to remember you use boiling water for proper tea!

You need a pressure cooker on Everest to make a proper cup of tea.

Tom... :smiley: :+1: :coffee: :australia:

You could use two stainless steel rods and when the liquid reaches them turn it off.