[ChrisN219] has an antique Coke machine that used to hold glass bottles. Now it holds around 30 tall boy cans of his favorite post-work suds. The only problem is that [Chris] has no idea how many cans are in it without opening up the door or keeping tally on a nearby slate board. Enter the Arduino.
He wanted to make something completely non-invasive to the machine (phew!) while using as many parts he already had as possible. The result is a simple circuit that uses an ultrasonic sensor mounted inside the machine to ping the depths, and a Nano in a nifty 3D printed box up top to do some math and display the number of cans remaining as a simple bar graph. The sensor reads one bay, and the code multiplies by two to get the total. It was touch and go there for a minute as he wasn’t sure that the HC-SR04s would get a good response from the cylindrical cans. Not only did they give a good reading, the first test was quite accurate.
[Chris] recently finished Mk. II, which replaces the momentary (and the Coke logo) with a second HC-SR04. The first version required the push of a button to do inventory, but now he simply walks up to the machine and knows at a glance if it’s time to make a beer run.
Okay, so maybe you don’t have cool old Coke machine problems. But surely you can find something that needs pinging, like an inconvenient rain barrel.