This is an implementation of a tic tac toe game using a 3x3 array of bicoloured LEDs for a display, a simple resistive touchpad, and an Arduino to tie everything together.
To see how it works, check out the video:
What this project requires:
Parts and consumables
One perf board (or strip board)
Nine bicoloured LEDs, common cathode
Nine identical resistors, in the 100-220 ohm range
Six identical resistors, in the 10kohm - 500kohm range
One single pole, double throw switch
A bunch of header pins
A bunch of electrical wire
One small square sheet of transparent acrylic, ~ 1 mm thick, 8 cm on the side
Clear sticky tape
All of the above are quite common items, total cost should not exceed USD$20.
One Arduino setup (Arduino Duemilanove, Arduino IDE, computer, USB cable)
Usual electrical tools (multimeter, solder solder gun, wire snips, wire cutter)
Everything Arduino related can be found at http://www.arduino.cc.
On with the build!
Step 1: Wiring up the LED matrix
To do this, the LEDs are wired up in a crossbar fashion, as shown in the first figure. The LEDs are grouped in columns of threes, and their cathodes are grouped in rows of sixes.
By setting a particular anode line high, and a particular cathode line low, and having a high impedance on all the other anode and cathode lines, we can select which LED we want lit up, as there is only one possible path the current can take.
For instance, in the second figure, setting the green anode 1 line high, and the cathode 1 line low, the bottom left green LED lights up. The current path in this case is shown in blue.
But what if you want to light up more than one LED on different lines? We'll use persistence of vision to achieve this. By selecting pairs of LED lines very very quickly, it gives the illusion that all the selected LEDs are lit at the same time.