Oct 29 2009
Audio Memory / Concentration Game : Part 1
After putting together my Halloween Sound Effect Tower, and realizing how AWESOME it is having screams available at the touch of a button, I had a thought: What if I made an audio version of the classic “memory” card game? (Also known as Concentration.)
Instead of flipping cards over, you would press buttons and hear sounds. Press one and you might get a cow, another a sheep, and so on. You need to match the sounds.
I did a big of searching and found that there were computer implementation of this game, but nothing in hardware. So I decided to make my own.
First off, the grid. To keep things simple for the prototype, yet complicated enough to be fun, I decided to use 16 positions. This would be a solid proof of concept, in case I wanted to build a really complicated unit later.
Because I love the sturdy feel of arcade buttons, and I have a bunch on hand, I decided to use them again for this project. They are sturdy, easy to work with, and not horribly expensive.
For my game top, I went with a piece of 12″ x 12″ 3/4″ plywood. The 12″ square surface would fit the 16 buttons quite nicely.
Here is the top all cut, drilled, and with the arcade buttons mounted:
Evelyn really likes the look of the black buttons against the light plywood background, so I think I’ll leave it natural and just protect it with clear polyurethane.
The buttons require quite large (1 1/8″ holes), so I laid out a grid, spacing the buttons about 2″ from the edges and 2 1/4″ on center from each other. Here is how they look from the back, without the micro switches installed:
Because arcade button are so large, and have replaceable switches, you install them a little differently than other types. First you drill the big hole, then you insert the upper switch assembly (the part the user presses). Then you screw a big plastic nut along the body of the switch, holding it in place. Then the micro switch snaps into place on the bottom mount of the switch. It’s a very cool and easy to work with configuration. It’s necessary because these switches are often mounted in very thick cabinets. They can easily be mounted in a 1″ thick surface!
Now comes the wiring. To keep things simple, I wired the switches into a standard matrix pattern. This means that each row is connected and each column is connected. In the below photo you can see that I used different colored wire for the rows and columns.
In a normal matrix setup, you would need 8 digital data lines to read the buttons. For example, if the upper left button was pressed, the top right yellow wire and the bottom left blue wire would conduct.
The problem is that I’m short on data lines on my Arduino (Atmel AVR) microcontroller. I need about 6 lines for driving the Arduino Wave Shield. and want to reserve another 3 for possible LED Driver action (lighting up each button).
One was to reduce the number of wires needed is to use a device called an encoder. An encoder basically takes all these lines and simplifies them for downstream use. (This is how your computer keyboard works — you don’t have 102 wires going to your computer, you have only a handful.) I have decoders, but no encoders, so I’d have to order something. So much for that.
Instead, I poked around a bit, looked at some application notes, and discovered — yet again — that the engineers of yore have done the thinking for me. The engineers who work on these sorts of devices are constantly coming up against hardware and software limitations. You can’t just throw in more hard drives, you have to actually solve the problem.
In this case, I discovered a method which will allow me to tell if a button was pressed with only ONE data line. Can you guess how it will be done?
(Keep in mind that I only need to know if one button at a time is pressed. I don’t care if two buttons [or more] are pressed simultaneously. That’s an invalid condition in the game of Concentration. Also, I’m using a microcontroller, which is pretty much required for this solution.)
Next up, testing the method of polling the buttons.
Comments Off



