Subscribe to Comments for "Vending Machine" Subscribe to SYN Shop - All comments
29 Oct 2013

Vending machines are wonderful works of electro-mechanical complexity. The machine in the shop is no different. If you’ve ever opened it up (go ahead, take a peek while it’s still busted) it’s like a Rube Goldberg machine with antique parts. In its prime, it was a glorious coin operated magic box that ate money and threw up snacks, candy or cigarettes.

The Big Idea

We’re swapping out the old logic board that processes key presses, coins and motor timing with a networked Raspberry Pi. It’ll process credit cards and have a LCD display for a user interface.

Leftover kits from classes, Raspberry Pi’s, common parts, pieces and supplies could be sold out of the machine. It will help draw cash into the shop to help keep it awesome while providing a convenient service to anyone who comes in.

How it Works

Take a seat, this is about to get nerdy. Check out the Demo Video Above for a quick walkthrough. Here’s the flow for the entire process.

  1. Idle: We show a welcome message and possibly move it around to avoid “burn-in” on the LCD screen.
  2. Make a Selection: The user can make a 2 digit selection based on what’s inside the machine. This should timeout after a while during mid-selection. Timeout goes back to #1.
  3. Details: After a selection, look up the details for the selection. If no product was found, show an error message and shoot them back to #1. Otherwise display the details for the chosen product.
  4. Pay or Cancel: Cancel goes to #1. Timeout after a bit and go to #1. Credit card swipe triggers credit card validation. On card failure, show the error and send user back to #3. Otherwise, send the card to Stripe for processing.
  5. Processing by Stripe: If the card declines, show an error message and send them to #3. If the card passes, record the adjusted stock total for the product purchased and vend the product.
  6. Receipt: Show a QR code that when scanned provides a textual receipt of the transaction. This screen will stay put for at least 30 seconds, until the vend process is over and will disappear after 60 seconds and goes back to #1.

QR Code ContentsQR Code Contents

What’s next?

Even though the interface works OK, there’s still a ways to go. There are plenty of bugs and use-cases to account for. If this machine sits out in the wild, it needs lots of testing and a way to maintain it.

We need to make the circuitry more permanent. As you can see from the video, it’s all built on a through-hole protoboard. Then the screen and the keypad/card reader need to be installed into the machine. And then we test, test, test.