Sunday, October 11, 2009

Hardware hacking

At the last DC949 meeting, I was inspired to look into hardware hacking some more. The GNU radio talk was what really got me started on how awesome I find hardware hacking. I'd buy a GNU radio if I thought I'd put it to good use, but it's expensive and there's no point in buying it if I'm not going to use it for something. But Brad mentioned he was using the Arduino with an XBee (transmitter which supports AES encryption) and that just kicked up my motivation another notch. I need to figure out what I can do with my Arduino which would be fun and educational.

The next day I got to play with my Arduino and a GPS receiver and we pulled our location, the current time, and some other interesting stuff. We also spent some time playing with the accelerometers in a Wii numchuck. When he showed me some hardware which would bridge XBees to computer networks, I felt like I just had to put my Arduino to some good use. I started thinking of the number of inputs I'd need to run the vending machine and quickly determined that I couldn't do it with my model, but the Arduino Mega would be able to handle it with its 54 digital I/O ports.

So I started working on the basic stuff with my Arduino just handling 2 buttons and 2 chutes, inserting dollars/quarters/dimes/nickels, and the change release. I'm up to the point where I can keep track of how much money has been inserted and can calculate how many of each coin to give back in change. I can detect when a chute is sold out, and it would print a message on the LCD (if I had an LCD here). The code to print a message on the LCD when they need to put in more money is also done.

Things to do:
1.) Make each button map to one or more chutes. Currently, it's a 1 to 1 mapping.
2.) Dig into the vending machine and see how each part interfaces with one another. Mainly how dollar bill acceptor sends out messages, what signals need to be sent to get the servos/motors which do the vending to vend, how the coin release detects which coins are inserted (serial, just a switch which is momentarially pressed when the coin drops, or something else), how it knows what change it has to give out.
3.) Detect when it doesn't have enough coins to give back change. When this happens it should require that exact change is used and reject any attempt to put in dollar bills.
4.) Get an LCD (or take the one out of the machine) and use it while testing.

Once I get the vending basics down, it'll be on to the fun stuff... wireless communication, RFID fun, digital camera, LED lighting with different patterns, games like "Simon" for people to play (complete with high scores which last until the machine loses power), maybe insert a computer and have a digital jukebox / video player, and whatever other shenanigans we can think up.