Can a shelf know what is standing on it without cameras?
This is a project I had dreamed up a year before I got to build it. When the IoT course started I realized it was the perfect opportunity to actually try it, and fortunately my assigned group agreed. So we built a proof of concept: a shelf that keeps track of your items using nothing but weight. No cameras.
You scan the barcode with your phone before putting an item on the shelf. After that the shelf takes over. It keeps track of usage and lets you know if the milk has been out on the counter for too long, or if you are soon out of butter.
The hardware consist of four load cells with amplifiers, one in each corner of the shelf, are read by an ESP32. When something changes, the ESP32 sends the data over MQTT to a Raspberry Pi running Node-RED, which pushes it on to a Python API built with FastAPI. That is where all the logic lives. On top of that we built a ReactJS interface with a barcode scanner, an overview of the shelf contents and notifications, and we integrated a European food database for product information.
What's fascinating with this isn't the logic in itself, it's not that complex. But when calibrated correctly, and when weighing different calculations of the signal against each other, we managed to get quite accurate results. The most fascinating part was to see how accurate it really became: you can remove multiple items, use them so their weight changes, put them back in random order at new positions, and the shelf still keeps track of each one! That in combination with the open food database and barcode scanning makes this a surprisingly functional product, even in this early prototyping stage.
An item’s weight is shared between the four corner sensors. The closer a corner is to the item, the more of the weight it carries, so the sum gives the weight and the split gives the position.
Dividing each sensor value by the total removes the weight and leaves only the pattern. A light and a heavy item in the same spot give the same normalized signature. Comparing both raw signatures and normalized signatures gives us a toolbox to use when algorithmically identifying an item. There is a lot of fun stuff we can do here, more on that later.
Each time something is lifted off or put back, the measured change is scored against the candidates: the items on the shelf when something is removed, the items currently out when something is returned. The score is based mainly on weight, supported by the sensor pattern, and the highest score wins. When several items are out, the returns are held pending until all are back and then assigned together, resolved based on match scores and layers of rules - like the fact that using a product in general make it weigh less.
Future ideas for the project
One idea that came up during the project but never got explored fully is touch. The load cells are quite sensitive, so the shelf could also pick up when you tap or press on it, and use that as input. Imagine interactions like tapping the items in the fridge to add them to your households shared shopping list. Basically any item on, and the shelf itself can act like a touch screen.
Another thing I want to explore is the footprint of the packaging. Four sensors in the corners basically give you the total weight and the center of mass, and in theory two packages with the same weight and the same center of mass look identical to the shelf, no matter how wide they are. But there are four values and only three are needed for weight and center of mass, and a real shelf bends a little and is not perfectly even. During testing I saw that packages with different footprints do give different readings. That effect is already in there implicitly, because the shelf saves the raw values from all four sensors for each item and compares against them. What I don’t know yet is how the effect works and how much it actually contributes to the correct identification, compared with weight and position. I want to explore that, and then find out how to exploit it on purpose for more accurate identification.
Wanna see more of it?
The API and UI are available on my GitHub: @ellieskod and if you wanna talk more with me about this feel free to reach out on linkedin or email me!