We were recently tasked with making a vending machine for pic and mix sweets which proved surprisingly challenging. We decided to use a Beaglebone Black for the processing unit running Ubuntu. Upon analysing the digital I/O required to drive lamps and other lighting, hopper motors slider motors and cup dispensers etc. plus reading buttons sensor states, scales values and other bits and bobs we decided to make a I2C cape for the Beaglebone and I2C I/O PCBs with 8 inputs and 8 outputs which could be individually configured for 5/12/24 volt operation. In the end, we used four of these PCB for each cabinet connected together in a ring with Cat5 Ethernet cable. The outputs are capable of handling 60A, which is enough to handle the stall current of any motor we were likely to need to drive.
The machine has a lovely transparent LCD screen which allows the customer to witness their sweets being mixed and falling from the dispensing hoppers into their cup. We used SDL to display the videos for the LCD and for the Sounds and music.
The machine dispenses sweets by weight so the cup is dispensed onto a load cell connected to a LX711 which is in turn connected to an Arduino Uno which averages the values and sends them to the Beaglebone over USB. The Arduino also performs watchdog duty for the system.
Inside the cabinet we utilised a Stone HMI touch screen STI080WT-01 for maintenance operations and for showing the status of the machine.
The first 50 of the machines have been built and some have been installed in Amusement Arcades and Holiday Parks across the UK with some destined for Europe and the Middle East.