PopCARD: Pop Machine Cash Card
Just 6 days ago, as I was fishing around for change to buy a drink from my own machine, I wondered how difficult it would be to add a key-override for myself, so I could buy drinks without having to put money in. That idea quickly ballooned into building a full-fledged cash card system that all of my neighbors could use. But, what was the best way to make the machine think that money had been inserted without actually doing it?
Digging through the service manual for the machine, I found and then quickly ruled out using the "modern" protocol that coin changers and credit card readers use to interface with the machine. This protocol is called MDB, short for Multi Drop Bus. It's a powerful protocol, but it has an irritating 9-bit word with an 11-bit transmission protocol, and it seemed to be much too complicated for what I really needed. So, I turned my attention to the mysterious port on the machine's main board, labeled "P8", designated for dollar bill acceptors.
In this photo, you can see the port circled in red. It is labelled "Bill Validator Interface" and has 8 pins. However, no other information about the connections was forthcoming. The service manual only contained information about compatible changers, but that didn't get me far. I spent hours digging around on the internet as well as speaking to the authorized distributer for Dixie-Narco in Canada, with no luck.
The big break came when a phone call to 'Dennis', a tech rep at Crane (the company that bought Dixie-Narco), was able to find me the pinout of the port. Here's what he gave me:
1 - Vend NO
2 - Vend COM
3 - Low Level Inhibit COM
4 - AC HOT
5 - AC Neutral
6 - Low Level Inhibit 2
7 - Low Level Inhibit 1
8 - High Level Inhibit 1
So, those pinouts looked about as greek to me as I'm sure they do to you. And with 110V right on the same connector, I wanted to be really sure of the wiring before I put any connections to them! With help from my friend Justin, we were able to figure out that shorting Vend NO and Vend COM twice caused the machine to add a credit of $1.00. In addition, I discovered that when 5V is present on Low Level Inhibit 2, the machine is ready to accept money, and otherwise it is not.
Armed with this information, I bought a new Arduino, an Adafruit ethernet shield, a Wiznet ethernet module, an LCD screen, and an RFID reader. Here's the initial set up:
The basic operation of the system is like this: A user scans their card, which is read via the RFID reader. The ID is sent to a piece of software running on one of my servers, which compares it to a database and retrieves the user name and their current credit amount. This is then displayed. If the vending machine is ready to accept money, pressing a "buy" button subtracts $1 from the account and places it in the machine. The user can then use that money to make a beverage purchase.
The final setup before it was mounted into the pop machine. I added a speaker to provide audio feedback. It plays the "1-up" sound from Mario!
Inside the machine, the relay board and the Arduino were mounted into a plastic case.
Since we don't have dollar bills in Canada, my machine doesn't have a bill changer. So I used the bill changer opening as an access hole for the LCD display, RFID reader, and pushbutton. The alligator clips are temporary -- I need to buy some spade connectors.
Here's that 8-port connector on the back of the vending control board. I found that a 6-pin PCI-E power cable matched the bottom 6 holes perfectly, while also leaving the 110V AC holes not connected.
On the front of the machine, I create a (crappy) template to display instructions and tell people what to do:
This is probably one of the more complicated Arduino-based builds I have done, and I am very happy with how well it works!
View the Arduino source code for the pop machine interface here.
Here's a schematic of the electronics. Click to enlarge.