RFID drink system eliminates the need for change

popcard_vending_machine

[Avatar-X] snagged a drink vending machine online a few years back, and has been selling drinks to his neighbors ever since. People are always asking him for change, and just the other day he was thirsty and out of change himself.  He considered adding an override key so that he could snag free drinks whenever he pleased, but decided to go all out and built a cash card system instead.

He didn’t know how to interface with the machine’s logic board, so after poring over the service manual he consulted with a support rep from the company that manufactured it. Luckily, he was able to get enough information from them to start making some headway. With his friend’s assistance, he was able to figure out which pins on the Bill Validator Interface needed to be shorted in order to simulate the addition of funds.

Using an Arduino with an Ethernet shield, LCD display, and an RFID reader, he had his PopCARD system up and running in no time. Now all his neighbors have to do when they want a drink is swipe their card in front of the machine and hit a button to add funds from their account.

As you can see in the video below it works great, and we’re sure his neighbors are pleased with the improvements he has made.

Comments

  1. Bryan says:

    I can’t wait for the first one of his neighbors to spoof his card and get free drinks

  2. Cold_Turkey says:

    What about the change from the $3.00? what happens to the remaining 60 cents? Does it get put back on the card?

  3. Angela says:

    For a moment I thought that this was describing also allowing users to add funds at the POS, but that appears to not be what’s happening. Nice interface between machine and Arduino, however “add $1.00 is really ambiguous. Are you adding $1.00 to the RFID card, or to the machine till? Probably would be easier to understand if it said “Spend $1.00″

  4. av says:

    @Bryan: Sure, but the pop machine is monitored by a video camera, and the transactions are all logged and time-stamped in a database :) But did you know that Dealextreme sells an RFID card duplicator for like, $60?!

    @Cold_Turkey: The prices are all set at $1, $2 and $3 to minimize change. But if change is required, it is dispensed via the coin changer already built into the machine — it dispenses dollar coins, quarters, nickels, and dimes.

  5. Life2Death says:

    Awesome example of someone who cant use a HOLE SAW.

  6. av says:

    @Life2Death: Why is it that on a website devoted to hacking, people seem to ignore the hack and focus on the unrelated or mundane stuff?

    A hole saw won’t cut through cardstock without destroying it. I used a knife, and I know it looks crummy, but it’s not a commercial product or anything. Why does this bother you so much?

  7. Pedro says:

    Haters gonna hate.

    Personally, I like the system.
    How are cards topped up, people just give you the money and you update the database? What happens if the DB is inaccessible (ethernet cable is yanked etc.)? How are IDs stored on the card, an incremental integer or a pseudo-random string?

  8. av says:

    @Angela: Thanks! It actually does say Spend $1 on the screen, and naturally I give a demonstration to a new person when I sell them the PopCARD.

  9. Rich_in_van says:

    @Life2Death:
    I love Internet trolls – post up your awesome projects so we can nitpick at your stuff!

    I agree – the cutout needs a little work, but who cares? Last time I checked, this wasn’t a site devoted to commercial-quality hacks?

    Get a life. Fer Srs.

  10. av says:

    @Pedro: Thanks :)

    They give me money and I update the DB, exactly. If the DB is inaccessible or the cable is yanked or the server is down, the software running on the Arduino puts a message on the screen, “offline – use coins”. But I am not expecting it to be offline often.

    The RFID cards I have are not programmable and already contain a unique 10-digit alphanumeric ID. I just store this ID in the database.

  11. TrollAWay says:

    av, welcome to Troll a Day.

    It is like a hacking site, except all the commenters do is piss and moan about insignificant things such as grammar, rough cardstock cuts, or the use of Arduinos instead of getting off their asses and building anything interesting themselves.

    Enjoy your stay!

    Also, awesome hack! If half these people had a fraction of the creativity you possess, this would be a far more pleasant place!

  12. Kaj says:

    @av: Don’t worry about it. There’s someone in every posting…
    “What? He built an electric car out of an El Camino and old laptops? PFff.. Should have used a Ranchero!”

  13. Em says:

    Excellent hack! Well done!

    Ignore the trolls! :o)

  14. swighton says:

    Although the appearance of the card-stock has no bearing on the performance of the device, it has a huge impact on the perceived quality – especially when it is juxtaposed next to such high quality artwork, and if I’m not mistaken is being used commercially.

  15. oxymoron says:

    Here’s a cool commecial version. We have one where I work and I use it all the time.

    http://drinkecowell.com/

  16. Life2Death says:

    Cardstock? I thought pop machines were plastic?

    If its cardstock, then nevermind. It looked like it was meant to be outside, in the elements, not paper.

  17. The guy at AvBrand just can’t stop doing cool stuff… o.O

  18. Arduitter says:

    I like it. The best part of it is that he really had the problem and came up with this SOLUTION. Now, problem solved. Awesome job.

  19. Tom says:

    I love how he used the 1-UP sound from Super Mario for the Add Coin Button :D

  20. av says:

    @TrollAway: Yeah :) I actually come from more of a programming background and am still learning basic digital electronics. The arduino was a huge eye-opener for me; allowing me to leverage my existing coding skills without needing to learn about assembly language, hardware-specific code, or delve too much into complex things like interrupts.

    @swighton: By “commercially” I mean I’m not selling the system, it is just for use by me and my neighbors. It’s just a cardboard cover — I can always upgrade it if I find a better way to cut it.

    @oxymoron: Sounds neat! There are kits that allow you to add a system like mine to vending machines, but they run $700-$2000 and I didn’t want to spend that much.

    @Life2Death: Well, my machine is actually made out of steel and weighs 750lbs empty. But it is indoors, so the cardboard will work just fine.

  21. Ben Wright says:

    The cutout also bugs me. It’s not the fact that the cutout is crocked – the button appears to be an arcade button that has a flange to cover the hole cutout. I like the ideal of the project and the rest of the hardware implementation. I wouldn’t use the button thinking someone before me smashed it through the hole.

  22. GTech says:

    So is this in an apartment building? They let you have a pop machine out there? Do they take some of the profit?

  23. Neato.

    If I buy a coke with a popcard for 80 cents, do I get change back or credit to my account?

  24. av says:

    @GTech: The owner and I are tight, so he doesn’t mind me having the machine there.

    @Standard Mischief: I actually apply the discount when the money is added to the account. So the price of a coke at the machine is always $1.00, but if you give me money for a PopCARD, I give you 25% extra. So $20 will turn into $25 on the PopCARD. This works out to make the price of a coke 80 cents.

  25. Shadyman says:

    I agree… Troll-a-day, haters gonna hate, etc, but this is pretty sweet :D

    Good job!

  26. liard nelson says:

    to give it a more professional look, you could put plexiglass over the Cardboard. This makes it also more weather-resistant, and you could fit your Button into it. It will also be more vandalism-proof.

  27. error404 says:

    Very cool project, I like that it actually solves a real problem for real users, but still very much a hack. And the basic reversing you managed to do with limited information is nice too.

    I’m not sure it wouldn’t have been easier to just implement the MDB though, 9-bit multi-processor serial is well supported and the protocol isn’t that complicated.

  28. Elias says:

    Just add some rubber grommet to the hole and it will hide the uneven edges, no biggie :)

  29. setlahs says:

    I would probably add a keypad and a 4 digit pin.

  30. Booker T. Worthington says:

    Nice hack!

    You might want to investigate the arm cortex for future projects. A bunch of them have on board ethernet and there are plenty of pins for connecting your RFID reader after that.

  31. Doug says:

    While it really doesn’t bother me, I have to admit that I noticed the roughness of the hole for the push button switch. Admittingly we can’t know how this shows up when using the machine, but all we see is clear photograph that harshly compares the home shop cut out to the machine perfect switch housing . Like it or not it’s attention to detail, or the lack there of, is what many people notice. Go to a custom car show show or any other exhibit of personal handiwork, you will hear the viewing public discussing what they are seeing amongst themselves. Placing one’s handiwork on the web for display is similar, but rather than comments(critical or complementary) being lost in the murmur of a crowd, they are in hard text. While I decided this wasn’t worthy of comment at first I’m now doing so because of other comments that categorize mildly critical comments as hating or trolling, when generally they are neither.

  32. Doug says:

    Evidently there must be size limit on comments I couldn’t include the following;
    While they are tools few of us own, and I really don’t know how well one would work on the material to used here, Greenlee chassis punches create the cleanest holes. Many electricians own them. Perhaps you can get one to punch the occasional hole for a beer or soda. If one drills the pilot hole where needed first, it doesn’t take long at all to punch out the hole. I call the chassis punches, because I was first familiar with the through electronic chassis construction, if you get a blank stare ask if they have knock out punches. Here’s a video of there use. http://www.youtube.com/watch?v=zJpc5CeiAtQ

  33. Parcanman says:

    Have you thought about being able to add money to the account with the coin collector?

    Another suggestion is to do away with the button entirely and instead have the Arduino watch the selection buttons. Since the buttons don’t do anything other than show the price on the LED display until there’s enough money in there, a user could scan their card then hit a selection button, this would tell the Arduino how much they want to spend, then the Arduino would credit it that much and send a signal to the same button they just pressed to release the product.

    Also, since you would now know what each person’s buying each time, it could figure out what that person’s average favorite is, then when they scan their card it could say “make selection or wait (countdown from 10 seconds) for your usual iced tea”.

    One more quick idea, find out what everybody’s birthday is, then the first time they scan their card on the date of their birthday, they get a freebie (which could be only the cheapest product you have if you want to keep it cheap).

  34. sagmag says:

    @Doug: “While I decided this wasn’t worthy of comment at first I’m now doing so because of other comments that categorize mildly critical comments as hating or trolling, when generally they are neither.”

    Really? How about comment #1:

    “I can’t wait for the first one of his neighbors to spoof his card and get free drinks”

    and #5:

    “Awesome example of someone who cant use a HOLE SAW.”

    I hope those were not the “mildly critical” comments you refer to.

  35. Mike says:

    @Doug – While it’s true that attention to detail is sometimes important, other times it’s the “git er dun” attitude that makes a hack so cool. After all, this is HACK a Day, not Mass Production Ready a Day. To draw on your car analogy, some hacks are like rat rods. The appeal is that someone made something out of nothing, or close to it. Now this project is sort of an end-user oriented deal so it would be nice if it was polished for Joe Public.

  36. TrollAWay says:

    People, this is a vending machine.

    In the hallway.

    Of an apartment building.

    If you live in an apartment, or ever had in the past – does the phrase “fit and finish” really come to mind?

    It is not a Porsche, it is not a surgical instrument, it is not the LHC. So the cut is a bit ragged – is that all there is to talk/debate about re: this hack?

    How about some constructive ideas like Parcanman suggests?

    For instance:

    I agree with Parcanman on the button thing – perhaps it can be done away with altogether. One way of doing so could be to automatically load the machine with the $3 maximum you have already defined(or the total amount left in a user’s account, if less than $3). Once a purchase has been made there could be a 15-second timeout after which the remaining funds are restored to the user’s account automatically. No need for change dispensing at all if items are purchased with the card.

    Less things for users to do, less things for users to break to break, one less hole for the complainers to complain about :)

    I’m off – it’s time to work on my Rube Goldberg machine constructed entirely out of Arduinos!

  37. av says:

    I really like the idea of determining what the user wants by intercepting the button presses… but I’d need 27 more data lines to do it (shift register or something).

    -9 to sense the buttons
    -9 to press the buttons
    -9 to attach to the “sold out” switches so the system doesn’t try to buy you a drink that it doesn’t have available.

    But it seems like it is overcomplicating it for a system that works quite well as it is.

  38. James Holden says:

    this is going to be on a lot of machines in the near future.

  39. addidis says:

    Few big problems here.

    First depending on the cards he used the codes are well known and easy to brute force with hardware thats easily made.

    RFID is not secure its useful when people dont know its employed.

    If you wanna get really creative hacking this , youd figure out a way to stick an antenna near the device and just clone different users cards then use them randomly at random times. Hard to trace, hard to stop (requires new cards) . Personally Id buy a change machine. Seems cheaper in the long run.

  40. Stevie says:

    We had a similar system back when I was in school. They scrapped it pretty quickly after random people would hit the ‘add funds’ button repeatedly after someone has swiped their card.

  41. echodelta says:

    Actually a hole punch is needed, but if this is cardstock it will eventually get shabby. This as is is way better than duct tape label or hard to read insert for price. Both and more are seen on commercial machines. Did someone say hack, I have made several hole punches from steel tubing of various size, to suit the job. Sand end square, hold and rotate at angle to belt till sharp to inside edge. Just as good as the cast and machined ones. Place and whack. Perfect circles or holes.

  42. cj says:

    Change is inevitable.

  43. Ros says:

    I love this project, but I think if you’re smart enough to design and implement such a system then you should be smart enough to figure out how to cut a neat hole in some material.

    Nice work all the same.

  44. av says:

    I am flabbergasted at the number of “hackers” reading this hacker blog who have absolutely nothing to say about the electronics, the programming, the wiring, or anything else technical.

    All they can do is bitch about the hole I cut, which looks fine in person, but in the photo it looks worse because the camera is only a few inches from the hole. In person you don’t stick your face right next to the machine.

    Seriously, the only thing you can think of that is worthy of saying is to complain about my hole-cutting skills? I’m not an artist. I have a box of crappy Exacto knives. I honestly don’t give a shit about the hole.

    The complaining about the unsecure cards, see, I can identify with that because it is a technical issue. But bitching about hole-cutting on a hacker blog? Seriously?

    -av

  45. Puppetteer says:

    All the comments about holes are the people who can’t ignore the superficial apearance and relish in the clearly astounding hack you’ve created. You must be familiar with these sort of people IRL, so ignore them like you already do when you hear them.

    Just keep in mind for ever person bitching about the hole a dozen more are wishing you’d have posted a how to because they wish they had the originality you do.

    Also, you might be able to use a device similar to this: http://ww1.microchip.com/downloads/en/DeviceDoc/21952b.pdf
    to accept enough inputs for the buttons and other i/o channels without the complications of a shift register.

  46. Pedro says:

    “but I’d need 27 more data lines to do it (shift register or something).” – av

    Use a resistor ladder and a single analogue input pin (see Physical computing: sensing and controlling the physical world with computers By Dan O’Sullivan, Tom Igoe http://books.google.co.uk/books?id=6JRcqhVUszEC&pg=PA388&lpg=PA388&dq=digital+button+input+resistor+ladder+to+single+analog+pin&source=bl&ots=q2t7ndO39b&sig=1t-6hIZQmM-Apb7zJZwxaaayxig&hl=en&ei=_jabTda1A5G0hAeJ2bjPBg&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBYQ6AEwAA#v=onepage&q&f=false) for the button input. AND the input with the NOT of the sold out light (so grab a handful of quad 2-input NAND gates) so you can’t buy sold out drinks.

    The Arduino probably has 9 digital I/O pins free to ‘press’ the buttons, or you can use a SIPO shift register (2 digital pins; data and clock. maybe use a 3rd for clear, or just transmit data very carefully, or clear it when a selection is made).
    Hint: use an 8-bit register with an AND gate between the MSB and MSB-1 of the output. Trigger your outputs with FETs which are switched by the serial data (in denary) 1,2,4,6,8,16,32,128 and 160. The input of drink number 9’s FET is taken from the output of the AND gate whereas drink 8 and 7 come straight from the output of the shift register. (drink indexes are 1-based in this example)

    Hope this makes sense, I know you’re new to digital/analogue electronics.

  47. John says:

    Care to share any rough financials? How much do you have into the system and the drinks? Do you buy wholesale? How much are you making per month?

    Also, did you bite out that hole or was there some sort of animal involved? I kid I kid.

  48. av says:

    @Pedro: It’s a really neat idea but I think it complicates things a bit more than I need to right now. I like the idea of knowing what people are buying and knowing what is sold out, so I might still do that at some point. Another option is to upgrade to an Arduino Mega which has a ton more digital inputs/outputs and only costs about $50 more.

    @John: Sure. I spent about $200 on the Arduino, RFID reader, LCD screen, RFID cards, ethernet board, ethernet module, and RFID breakout board. The pop machine cost me $800, used, on craiglist, plus another $100 to rent a truck to move it.

    The drinks I sell for a reasonable profit, Coke for example costs me 33 cents a can but I sell for 80 cents (or $1). The Red Bull is the most expensive, it costs me about $1.95 a can and I sell for $3 or $2.40 with the card. I buy from wholesalers, distributers, and Costco (which often has the best price).

  49. Pedro says:

    sorry, addendum to above, I meant to say drink 8 and 7 need to come from the shift register pins XORd together and ANDed with their individual pin. Otherwise the input for drink 9 satisfies the conditions for drink 7, 8 and 9.

    How can I explain this a bit better?
    Your outputs are QA..QH.
    Drink 1: QH
    2: QG
    3: QF
    4: QE
    5: QD
    6: QC
    7: (QB XOR QA) AND QB
    8: (QB XOR QA) AND QA
    Drink 9: QB AND QA

    OK writing this down it sounds a LOT more complicated than it first sounded in my hed. You could of course just use a larger than 8-bit shift register….

    I feel a bit dumb now. :(

  50. Parcanman says:

    Have you tried looking for serial debugging pins on the microcontroller that’s driving the original system? You might be able to determine what button is being pressed and what is sold out right from the MCU debugging system.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,123 other followers