Refurbished vending machine

A tech fan’s plan to give something back to his community led to a Raspberry Pi-based dispenser. This #MagPiMonday (yes, we know it’s Tuesday but we weren’t around yesterday) we take a look at this Raspberry Pi-powered vending machine.

refurbished vending machine
Proceeds from the Raspberry Pi 4-controlled vending machine now benefit his local church

If you can think of it, “you can probably do it on a Raspberry Pi,” believes 17-year-old Fady Faheem, who saw a broken vending machine for sale online and decided to give it a tech upgrade. Fady wanted to use his tech chops to benefit his community in Fort Worth, Texas, and the refurbished vending machine seemed an ideal gift to his local church – “the best place I knew” – which could do some micro fundraising too. The project has kick-started his career: “If I didn’t do this, I wouldn’t be where I am today, working as a software engineer at 17.” 

Feeling blessed

Task one was the discover whether the vending machine was fixable. Buying it for so little, “knowing it was broken and the motherboard fried, I wasn’t sure what I was walking into,”
reveals Fady.

Fady put his love of Java to great use by providing a welcome refreshments machine for fellow members of his church
Fady put his love of Java to great use by providing a welcome refreshments machine for fellow members of his church

Even so, having learned Java and programming since his freshman year, he felt sure he had the power to accomplish it. He became interested in Raspberry Pi because it can be used for “just about any project”, noting the range of different-sized models, “different ways to utilise it, low energy, and overall simplicity.” 

Raspberry Pi 4 now handles the logic and electronics and interfaces with the selection database

Raspberry Pi would become the heart of his vending machine, connecting everything: communicating with the dollar bill acceptor, sending data to relays to activate them, and handling power between all devices. There was little to no space to put a machine or full-size computer behind the vending machine screen, so the diminutive Raspberry Pi was “the ultimate solution to all my problems,” he says. “I had a small corner to run the hardware. If it could fit in my hand, I knew it would fit in the machine.” Fady’s refurbished vending machine originally used a 3B+, but he recently upgraded it to Raspberry Pi 4 for performance on start-up, should he ever need to pull the plug and restart.

Money makers

Fady began to tackle the project by researching how other people were able to use a specific combination of dollar bill acceptor and a circuit board to run Java. For the first version, Fady used a Pyramid Apex 5400, but later switched to the Apex 7400 bill acceptor, resulting in better support and handling through Java. Vending machine selections are handled by the MariaDB database and Raspberry Pi using a number of libraries Fady found on GitHub. Meanwhile an Arduino connected to Raspberry Pi via the vending machine’s printer cable, and accessed using Java, handles the signals to the relays and the relays themselves. 

At the ‘heart’ of the vending machine a Raspberry Pi 4 controls everything, alongside an Arduino connected to relays to fulfil customer selections
At the ‘heart’ of the vending machine a Raspberry Pi 4 controls everything, alongside an Arduino connected to relays to fulfil customer selections

“At the end of the day, all the work that went into it was designed and 3D-printed by me,” he says proudly. 

The MagPi #130 out NOW!

You can grab the brand-new issue right now from Tesco, Sainsbury’s, Asda, WHSmith, and other newsagents, including the Raspberry Pi Store in Cambridge. It’s also available at our online store which ships around the world. You can also get it via our app on Android or iOS.

magpi 130

You can also subscribe to the print version of The MagPi. Not only do we deliver it globally, but people who sign up to the six- or twelve-month print subscription get a FREE Raspberry Pi Zero Pico W!

The free PDF will be available in three weeks time. Visit the issue page for more details.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Server Status

Aradippou Chat Larnaca Nicosia

Chat Links

Official Links.

Chat.

Alternative Mirror Links.

1. KiwiIRC 1.
2. KiwiIRC 2.

Other Web Clients.

1. IrcCloud.

Recent Posts

Related Posts:

Archives

Follow me on Mastodon

Super Club Radio

Mighty Deals

CyIRC

CyIRC Tweets