Hacker “ChrisN219” had a problem. Perhaps a problem isn’t the right word though, as he notes that he’s fortunate enough to have an old-school Coke machine used for refreshments. While it makes a great functional piece of furniture, one thing it doesn’t normally do is tell you how many cans are left.
To add this functionality, he made a device that sits on top of the machine with a set of wires that run to a remote HC-SR04 ultrasonic sensing module to measure the number of cans remaining. While he anticipated having to do some tinkering in order to get it to work correctly — especially since it’s measuring distance to cylindrical objects — the gadget worked correctly on the first try.
The sensing setup is powered by an Arduino Nano that he had lying around, and the main part of the unit is contained in a nicely 3D-printed housing. The original version had a button to activate the sensor, as well as a display that interestingly reads as “beer cans left,” giving a number as well as a graphic display for quick reference. Since then, the button has cleverly been replaced with another ultrasonic sensor, displaying data automatically when someone walks up to it.