Rev 2.5 - tidied up the 3D printed parts and updated the plug connector to a common PCB unit.



Rev 2 - ultrasonic "button" replaces manual push-button.



Pushing a button is so old fashion, particularly when I'm already using an Ultrasonic sensor. Why not use an ultrasonic sensor to activate the can level detector! Rev 2 removes the push-button and replaces it with another HC-SR04 module. Now, just walk up to the machine and it turns on automatically to reveal the can level. I lost the "Coke" logo in the process, but I only had to change the faceplate - all other printed components remain the same.

I'm fortunate enough to have an old Coke machine that I use for, er, "refreshments". It holds about 30ish cans when full. The trouble is, how many cans are in it at any given time? When do I need to make a run to replenish the machine?

A solution (apart from opening the machine all the time) is to whip up a sensor, or "can level detector" that can approximate the number of cans in the machine at any given time. I decide that it had to meet the following requirements:

- must be cheap and simple

- non invasive (I don't want to start drilling or cutting into my machine)

- Use Arduino Nano

- Use an LCD screen to give me easy-to-understand readings

- be powered by the native USB or an external power supply

- use a momentary push-button for "as-needed" readings (now using 2nd HC-SR04 module instead).

I had some ultrasonic modules, some Nanos, and a tiny LCD screen and decided that they might come in handy here.

After a bit of searching, I had all the necessary elements (hardware and coding) to make this work. The only outstanding question was - would the ultrasonic sensor be able to register a meaningful distance by bouncing the signal off of cylindrical cans?? It turns out that it in fact "can"! (sorry for the pun).