Electronic Design Studio 2007 Game Module
![]() |
![]() |
The Game Module circuit diagram is located here and testing the module after assembley is located here
The game uses nine switches for ease of selection of what led to light as your next move, so the choices of what to use are individual tactile switches or a keypad. I decided to use a numeric keypad for the game module for several reasons. We use an Altronics H0173 jiffy box to hold pcb's after assembley as it allows a battery to be stored inside it if needed and stops the componenet side of the pcb from being shorting out. This gives us a pcb footprint of 69mm x 126mm with four mounting screws required in the corners. By choosing a self contained keypad S5381 I can use the space underneath the keypad to fit more pcb components.
The switches can be scanned as a matrix so nine push buttons would be a 3 by 3 matrix, plus adding a reset and who's turn option would take it to a 4 by 3 matrix, which would need seven input lines. Using shift registers could reduce it to four lines required. However this would use up most of the Picaxe 08M input lines so another method of knowing which key is pressed is needed.
I had recently done another design that used a twelve position rotary switch with a resistor devider network to provide an analogue voltage in discrete steps, which was read into the analogue input of a Picaxe. By putting a resistor across each row and column connection on the keypad, we are able to read in the dc voltage for each button pressed. However if we used the same value resistor for each connection, say 1000 ohms, some keypress values are the same value for different rows. and colums. By using 1000 ohm resistors on the row contacts and 620 ohm resistors across the column contacts, chosen as 620 is not a multiple of 1000, we get a different value voltage for every individual keypress. This simplistic design does not allow for multiple keys being pressed at the same time as that would not normally occur during a game. This analogue keypad allows us to read in which key is pressed by using one analogue to digital input of the Picaxe 08M.
The next step is to drive the 9 dual colour led's which will need 18 outputs. The dual colour led allows us to show who has chosen that locatiob as it can be red or green or orange.
In Programming and Customizing the Picaxe Microcontroller by David Lincoln pages 188 to 210 Input and Output Expansion and in Silicon Chip June 2003 Picaxe-08 Port Expansion by David Lincoln, he shows how to use serial in parralel out shift registers to provide 8 outputs per shift register ic. As we want 18 outputs, which calls for a third shift register, I decided to add six small green led's as optional status led's for project flexibility. When looking at what serial in/parallel out shift registers were available, I chose the 74HC595 as it had a latch. This meant that while the Picaxe was clocking in the 24 bits of serial data, the output states would not be changing or the led's flashing randomly.
The shift registers can drive the led's direct. The choice of led current limiting resistor was revised from the initial 270 ohms to 470 ohms to reduce current consumption so more power from the M9260 plugpack can be used for the stepper motor option. Individual resistors were used for the bicolour led's to allow for easier pcb layout and a single in line resistor pack was chosen for the six green status led's to show the advantages of different packages as these are very compact, plus there are lass holes required.
DC power comes in via a 2.1mm pcb centre pin positive dc power connector to a 1N4004 reverse voltage protection diode as dc plugpacks can have either positive or negative polarity on the centre pin. The a 100uF resevoir capacitor and a 0.1uF filter capacitor are across the input to a LM340T positive voltage regulator which can handle 1 amp with a suitable heatsink, provides thermal shutdown protection and provides a +5 volt regulated output for an input voltage ranging from +8 volts to +30 volts. There is a 33uF resevoir capacitor and a 0.1uF filter capacitor on the output of the regulator then a green led with a 470 ohm resistor as a power on indicator. Ther is a decoupling capacitor for the Picaxe and the shift registers.
The Picaxe is connected to a 3.5 mm stereo programming connector, but note the non standard connections as Revolution Education have chosen to make the tip common instead of the omre conventional sleeve common. This project uses the enhanced serial download circuit where a BAT85 schottky diode provides a low voltage reference for the serial input as some computers RS232 ports use up to -15 volts on their serial ports and this affects the Picaxes analogue to digital converter input. The 180 ohm resistor provides current limiting protection for the serial out. The 22K resistor clamps the serial in data volts to the Picaxe supply volts and the 10K resitor provides load resistance to stop the input floating high when the download cable is disconnected.
There is a connector that allows for external sensor inputs to be connected in parallel with the keypad as an expansion option for mechatronics and the other connector allows for control of the cranes motors via suitable buffer circuits. The game board's led's double up as output control indicators.
| Return to EE&CE Electronic Workshop Don Allen Home | last updated 13 December 2007 |