MilkMate: Liquid Level Sensor Project
Moderators: grovkillen, Stuntteam, TD-er
MilkMate: Liquid Level Sensor Project
I thought I would share a bit about my Milk Level Sensor that is based on ESPEasy. It's built and running, but unfortunately the ending is not a happy one. At least not yet.
BTW, I've briefly mentioned this project in this thread: viewtopic.php?p=70133
The goal was simple: Show the remaining level of refrigerated milk that is locked inside a cabinet that is stored below a coffee machine. The milk is in a one gallon container that frequently needs to be changed. It is used to make hot milk foam on a fully automated EverSys coffee machine. Here is what the machine looks like:
There were some self-imposed rules.
(1) Must be "fool proof." Fools in this case are mostly college educated retirees.
(2) No changes permitted to the equipment, cabinets, and countertops.
(3) Nothing can have direct contact with the milk or other food items.
(4) Materials must be suitable for food contact applications and tolerate alcohol based sanitizing chemicals.
(5) Must be easy to install and/or remove. Simple hand tools allowed.
The finished system is shown below.
The ESPEasy Hardware is shown below:
Some notable things:
▪ A VL53L1X non-contact distance sensor (optical laser) determines liquid level. It measures distance from top of jug downward to milk surface. Math does the rest.
▪ This optical laser is in a plastic assembly that rests on top of the milk container. It touches the container, NOT the milk.
▪ The color display mounts on a cup holder rack next to the machine. It reports 0-100% milk level and its temperature.
▪ A large RGB NEOPixel LED shows status at a glance. Green=Good Milk Level, Yellow=Low Level, Red=Milk Empty
▪ Emails are sent to report status that needs immediate attention.
In the end I was able to check off all the boxes in my "rule" list except #1. The system is not fool proof. Which is a deal killer.
The issue is that the long milk suction tubing (which goes into the top of the milk container) often gets in the view of the optical sensor and disrupts the measurements. And unfortunately it causes the display to report good milk levels, even if the jug is empty.
I could solve the issue by replacing this flexible silicone hose with a stiffer suction tube so it could be directed away from view. But that would violate rule #2; No changes to equipment are permitted.
The suction tube goes though the plastic assembly that holds the sensors. It's made of three pieces, shown below. The big "tongue" seen on the top piece is used to push the milk suction tubing away from the VL53L1X distance sensor. But the tubing has a mind of its own and managing its direction is like controlling a room full of angry cats.
TL;DR The project is assembled, hardware working, ESPEasy rules written and debugged. Too bad I have to find a solution to make it work for the intended application.
- Thomas
BTW, I've briefly mentioned this project in this thread: viewtopic.php?p=70133
The goal was simple: Show the remaining level of refrigerated milk that is locked inside a cabinet that is stored below a coffee machine. The milk is in a one gallon container that frequently needs to be changed. It is used to make hot milk foam on a fully automated EverSys coffee machine. Here is what the machine looks like:
There were some self-imposed rules.
(1) Must be "fool proof." Fools in this case are mostly college educated retirees.
(2) No changes permitted to the equipment, cabinets, and countertops.
(3) Nothing can have direct contact with the milk or other food items.
(4) Materials must be suitable for food contact applications and tolerate alcohol based sanitizing chemicals.
(5) Must be easy to install and/or remove. Simple hand tools allowed.
The finished system is shown below.
The ESPEasy Hardware is shown below:
Some notable things:
▪ A VL53L1X non-contact distance sensor (optical laser) determines liquid level. It measures distance from top of jug downward to milk surface. Math does the rest.
▪ This optical laser is in a plastic assembly that rests on top of the milk container. It touches the container, NOT the milk.
▪ The color display mounts on a cup holder rack next to the machine. It reports 0-100% milk level and its temperature.
▪ A large RGB NEOPixel LED shows status at a glance. Green=Good Milk Level, Yellow=Low Level, Red=Milk Empty
▪ Emails are sent to report status that needs immediate attention.
In the end I was able to check off all the boxes in my "rule" list except #1. The system is not fool proof. Which is a deal killer.
The issue is that the long milk suction tubing (which goes into the top of the milk container) often gets in the view of the optical sensor and disrupts the measurements. And unfortunately it causes the display to report good milk levels, even if the jug is empty.
I could solve the issue by replacing this flexible silicone hose with a stiffer suction tube so it could be directed away from view. But that would violate rule #2; No changes to equipment are permitted.
The suction tube goes though the plastic assembly that holds the sensors. It's made of three pieces, shown below. The big "tongue" seen on the top piece is used to push the milk suction tubing away from the VL53L1X distance sensor. But the tubing has a mind of its own and managing its direction is like controlling a room full of angry cats.
TL;DR The project is assembled, hardware working, ESPEasy rules written and debugged. Too bad I have to find a solution to make it work for the intended application.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
P.S. Thanks to TD-er and Ath for providing solutions to some issues I ran into. I appreciate it!
Re: MilkMate: Liquid Level Sensor Project
Thomas,
You have a very well executed and documented project, chapeau!
Unfortunately the tube is working against you for now; as a possible solution you could separate the tube/milk input and the level sensor, and move the sensor into a more fixed position at the back of the container, where it doesn't get obtruded by the tube? It will require to add another (small) opening to the container, so that might be a no-go, or even unfeasible if the complete container is replaced with a fresh one when empty
Second suggestion is to direct the sensor angle diagonal to the back-bottom of the container, so the chances of the tube getting in the way are smaller. You'll have to slightly adjust the volume calculation, but that's in capable hands, AFAICS
You have a very well executed and documented project, chapeau!
Unfortunately the tube is working against you for now; as a possible solution you could separate the tube/milk input and the level sensor, and move the sensor into a more fixed position at the back of the container, where it doesn't get obtruded by the tube? It will require to add another (small) opening to the container, so that might be a no-go, or even unfeasible if the complete container is replaced with a fresh one when empty
Second suggestion is to direct the sensor angle diagonal to the back-bottom of the container, so the chances of the tube getting in the way are smaller. You'll have to slightly adjust the volume calculation, but that's in capable hands, AFAICS
/Ton (PayPal.me)
Re: MilkMate: Liquid Level Sensor Project
I have not yet looked closely at this exact version of the sensor you use, but maybe we could also do a read-out of several sections of the field-of-view and then not take the closest object, or perform some filtering.
Maybe you could find something in the datasheet to see if there is some indication the sensor is capable of doing so?
Maybe you could find something in the datasheet to see if there is some indication the sensor is capable of doing so?
Re: MilkMate: Liquid Level Sensor Project
The VL53L1X has settings to narrow its ROI (Region Of Interest), that's planned to be implemented, though I didn't start with that project yet...
/Ton (PayPal.me)
Re: MilkMate: Liquid Level Sensor Project
I also thought about changing the ROI / Field of View. Probably won't fully solve my dilemma, but could help.
Like TD-er mentioned, what would have been cool is if this sensor had electronic beam steering. But as far as I know that's not supported.
BTW, I spent twenty years in medical ultrasound, so beam steering is something I understand.
EDIT:
- Thomas
Like TD-er mentioned, what would have been cool is if this sensor had electronic beam steering. But as far as I know that's not supported.
BTW, I spent twenty years in medical ultrasound, so beam steering is something I understand.
EDIT:
That is correct, the entire milk container is changed. And poking a hole in it violates at least one of the "rules."... unfeasible if the complete container is replaced with a fresh one when empty
- Thomas
Re: MilkMate: Liquid Level Sensor Project
Ultrasound beamsteering is slightly different from what this sensor does... or at least what I suspect it does.
If it does indeed look at phase shifts in IR, then I'm extremely impressed.
I think it does just have multiple "pixels" to see in slightly different angles.
Anyway, with your background, I think you can already form some ideas of why I have been working lately in improving time-sync among ESPEasy nodes to get sub-msec jitter
If it does indeed look at phase shifts in IR, then I'm extremely impressed.
I think it does just have multiple "pixels" to see in slightly different angles.
Anyway, with your background, I think you can already form some ideas of why I have been working lately in improving time-sync among ESPEasy nodes to get sub-msec jitter
Re: MilkMate: Liquid Level Sensor Project
According to the application notes, by default it uses the entire 16x16 photo diode array for 27°FOV. That is about 10cm diameter at the bottom of the milk container. But the FOV can be programmed to use as little as a 4x4 region, which narrows it to about 15°. So there is merit in this idea.I think it does just have multiple "pixels" to see in slightly different angles.
Increase your clock frequency. A lot. And switch to decaf. You're welcome.I think you can already form some ideas of why I have been working lately in improving time-sync among ESPEasy nodes to get sub-msec jitter
- Thomas
Re: MilkMate: Liquid Level Sensor Project
Not sure if my clock frequency should be increased...
It is not like my brain will be in 'sleep mode' while waiting for just about anything.
So better not make those waiting periods even longer.
It is not like my brain will be in 'sleep mode' while waiting for just about anything.
So better not make those waiting periods even longer.
Re: MilkMate: Liquid Level Sensor Project
Hey Thomas,
nice project! I once had a similar problem with a flexible silicone hose. I therefore shortened it and attached a stainless steel tube. It violates your rule #2 but only a tiny bit And rules are meant to be broken...sometimes.
nice project! I once had a similar problem with a flexible silicone hose. I therefore shortened it and attached a stainless steel tube. It violates your rule #2 but only a tiny bit And rules are meant to be broken...sometimes.
Re: MilkMate: Liquid Level Sensor Project
Well at least to be "bent a bit".
Quite on-topic in more than one way
Quite on-topic in more than one way
Re: MilkMate: Liquid Level Sensor Project
BTW: Thomas, you are not the first one that is ESPEasyfying a coffeemachine
viewtopic.php?p=65029#p65029
viewtopic.php?p=65029#p65029
Re: MilkMate: Liquid Level Sensor Project
Hello Mr. Thomas,I have a question. if I use homemade low-cost sensors like this https://www.pcbway.com/project/sharepro ... 69c3d.html
instead of the VL53L1X sensor, how will it effect the performance do you think?
instead of the VL53L1X sensor, how will it effect the performance do you think?
Re: MilkMate: Liquid Level Sensor Project
I agree, a stiff hose would solve it. But I would be hated by the coffee crew. Because inserting it into the container would be difficult due to the cramped space in the little refrigerator.I once had a similar problem with a flexible silicone hose. I therefore shortened it and attached a stainless steel tube. It violates your rule #2 but only a tiny bit
BTW, any changes to the coffee machine's parts, no matter how simple, would allow the manufacturer's repair tech to blame me for everything that goes wrong. Some of my "rules" are intended to prevent that situation.
Nice. Maybe we should start a club for ESPEasy Coffee Machine Hackers.BTW: Thomas, you are not the first one that is ESPEasyfying a coffeemachine
BTW, you would have been filled with joy if you got to hack the mechanics on the machine I show in the first post. There are many solenoids, valves, motors, and clicky/blinky things to play with. Here's a top view into the main part, which shows the boiler (right) and bean grinder (left).
Sensors like those typically have direct contact with the liquid. Which opens up a whole can of worms in my situation due to food safety issues. Which is the reason I need to use a non-contact method of measuring the milk level.f I use homemade low-cost sensors like this https://www.pcbway.com/project/sharepro ... 69c3d.html
instead of the VL53L1X sensor, how will it effect the performance do you think?
When I was conceiving this project I initially thought of using a strain gauge and measure the weight (0-3.6 kg) of the milk container. But space in the refrigerator was limited and I worried about the sensor accuracy as ice built up on it. Then the idea of using a laser based sensor took hold. And I got what I asked for, but the results are not exactly what I wanted. I hope to rectify that soon.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
I see, so my next best recommendation would be something like ptfe tubing. Stiff enough but also flexible.
I definitely would be...
There have to be. Otherwise the high price of these machines would not be justified.
Re: MilkMate: Liquid Level Sensor Project
Another idea would be to put the load cell unter the fridge if possible....
Re: MilkMate: Liquid Level Sensor Project
i missed that... so no ptfe tube i guess
Re: MilkMate: Liquid Level Sensor Project
In the planning phase I considered something like that. I looked at digital shipping scales that had a serial port. Prices are low too.Another idea would be to put the load cell unter the fridge if possible....
But I eventually decided that the laser distance sensor solution was more elegant and appeared simpler. Got it half right.
Crazy high prices! This machine sells for >$20K USD. But it is a coffee brewing miracle. It grinds beans, presses them, adds water and milk foam, and mostly cleans itself. All menu driven, so the user can choose their favorite brew.There have to be. Otherwise the high price of these machines would not be justified.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
Based on all the suggestions, and the advice from a magic eight ball, I think I can solve this. Hopefully I won't violate any of the rules, at least not in an obvious way.
Currently playing with a short piece of semi-rigid PE poly tubing that I heat-formed into a gentle "S." With a bit of luck I won't have to modify anything on the coffee machine. Will report back soon.
- Thomas
Currently playing with a short piece of semi-rigid PE poly tubing that I heat-formed into a gentle "S." With a bit of luck I won't have to modify anything on the coffee machine. Will report back soon.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
The solution I decided to use requires cutting the coffee machine's milk suction tubing. Not a horrible thing, but it bothers me because this is a modification and that breaks one of my self-imposed rules.
I'm using 6mm clear PTFE tubing that was heat-formed into a "S" curved shape. The milk cap was redesigned to hold it in a fixed position. When the cap is placed on the milk container the suction tubing is forced into a corner, out of the way of the optical sensor's view.
The PTFE tubing's top end will be connected to the long silicone hose that feeds the coffee machine. The bottom end gets a 17cm length of silicone hose terminated in a filter/sinker that lays on the bottom of the milk jug. This section of hose is the piece that will get cut off the existing suction hose.
The PTFE tubing is semi-flexible and so it's not difficult to insert it into the milk container while everything is still inside the refrigerator's tight quarters.
I haven't installed the MilkMate system on the coffee machine yet. I need to do a demo and earn approval before I can proceed. But I think I can say the project is done. And a success.
- Thomas
I'm using 6mm clear PTFE tubing that was heat-formed into a "S" curved shape. The milk cap was redesigned to hold it in a fixed position. When the cap is placed on the milk container the suction tubing is forced into a corner, out of the way of the optical sensor's view.
The PTFE tubing's top end will be connected to the long silicone hose that feeds the coffee machine. The bottom end gets a 17cm length of silicone hose terminated in a filter/sinker that lays on the bottom of the milk jug. This section of hose is the piece that will get cut off the existing suction hose.
The PTFE tubing is semi-flexible and so it's not difficult to insert it into the milk container while everything is still inside the refrigerator's tight quarters.
I haven't installed the MilkMate system on the coffee machine yet. I need to do a demo and earn approval before I can proceed. But I think I can say the project is done. And a success.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
Maybe you can also write some rules to trigger a warning when the level gradually rises
Re: MilkMate: Liquid Level Sensor Project
Good idea. And maybe there should be an air quality sensor on the milk cap so it can analyze the odor.Maybe you can also write some rules to trigger a warning when the level gradually rises
Looks like I'm back to the drawing board; Version 2 will fix these missing features.
- Thomas
Re: MilkMate: Liquid Level Sensor Project
Do you want to wait till v2 is ready, or do you want more new suggestions now?
Re: MilkMate: Liquid Level Sensor Project
You are a brat.
Re: MilkMate: Liquid Level Sensor Project
OK, so some more ideas...
You could also wire some current sensing (thus no modifications needed) so you could detect how often it is used.
And some reflective sensor to detect if the stack of cups is low, or change of milk holder so you know how long it has been since last replacement.
Might only need some reflective tape on the milk can.
And maybe adding some presence sensor to turn on some light if needed.
You could also wire some current sensing (thus no modifications needed) so you could detect how often it is used.
And some reflective sensor to detect if the stack of cups is low, or change of milk holder so you know how long it has been since last replacement.
Might only need some reflective tape on the milk can.
And maybe adding some presence sensor to turn on some light if needed.
Re: MilkMate: Liquid Level Sensor Project
An active mind can be a burden... but also very helpful
/Ton (PayPal.me)
Re: MilkMate: Liquid Level Sensor Project
That's a tough one. Because the machine periodically does automated functions that current-wise would look similar to beverage dispensing. For example, boiler heating, hot water flushes, coffee rinses, and other operations.You could also wire some current sensing (thus no modifications needed) so you could detect how often it is used.
But I have access to the beverage logs using the front touch display. Went rogue and found the password in order to do that. Because I'm a nerd. And the machine has remote access via its Ethernet port that is currently unused (no nearby jack). One of these days I will get it connected to the network and crack that function so ESPEasy can read its mind.
I like that sort of thing. But it is very low fruit. The rack holds about a week's worth of cups and we (coffee crew) visit the machine several times a day to clean/check it. So cup inventory never gets low.And some reflective sensor to detect if the stack of cups is low,
No need for another sensor to detect if it was replaced. The MilkMate system has an open door sensor, plus the milk cap has a luminance sensor (along with the distance sensor). So plenty of clues to decide if the carton was changed. I considered adding a rule to email me that the milk was changed, but not interested in knowing that (yet).change of milk holder so you know how long it has been since last replacement. Might only need some reflective tape on the milk can.
Good ideas, thanks for the suggestions. Even if you are trying to be a brat.
Yes, nerd-people like us seem to be afflicted with that problem.An active mind can be a burden... but also very helpful
- Thomas
Re: MilkMate: Liquid Level Sensor Project
A number of years ago, I've done some work for a company (1.5 year on location) which employs lots of nerds in all kinds of degrees of nerdyness (radio-astronomy) and one day the cleaning crew (or maintenance crew) did not properly lock the front of the coffee machine.
There you could see an USB connector and some view of the PCB.
Within a day someone had tried to write a new firmware for the coffee machine, probably trying to add some easter egg.
That didn't go as well as planned, as one of those firmware-upgrades did actually brick the machine (not even the first attempt) and we had to walk to another one further away for at least a week.
And no, it wasn't me... I only heard about it from various people.
There you could see an USB connector and some view of the PCB.
Within a day someone had tried to write a new firmware for the coffee machine, probably trying to add some easter egg.
That didn't go as well as planned, as one of those firmware-upgrades did actually brick the machine (not even the first attempt) and we had to walk to another one further away for at least a week.
And no, it wasn't me... I only heard about it from various people.
Re: MilkMate: Liquid Level Sensor Project
Hee-hee. Yes you were being "a brat." This is not the same as "being brat."
https://www.reddit.com/r/OutOfTheLoop/c ... term_brat/
- Thomas
https://www.reddit.com/r/OutOfTheLoop/c ... term_brat/
- Thomas
Re: MilkMate: Liquid Level Sensor Project
I also found this as a description:
Sounds like typical Dutch to me
To double-down on this definition;"very honest, very blunt, a little bit volatile."
Sounds like typical Dutch to me
Who is online
Users browsing this forum: No registered users and 10 guests