Sunday, April 17, 2011

Reed Switch Wiring Diagram

The Reed Switches didn't come in yet, but I thought it would be a good idea to draw up the circuit diagram a while so that I can just build it as soon as they come. The 64 Reed switches will be mounted on a 2 foot by 2 foot punch-board. They will be equally spaced 3 inches apart so that they are exactly in the center of our chessboard. The chessboard will be rather large at 2 feet by 2 feet with 3 inch squares so that the magnets do not interfere each other. A more refined version of our project, if it were to be sold to consumers would be much smaller.

The chessboard’s layout is labeled as in the following diagram. 
This is also what the chess program we have outputs. Thus we need to perform two overall conversions to interface with the chess program. We need to convert the numerical move coordinates of the human’s chess move into a (letter, number) to (letter,number) coordinate. We also need to convert the computer’s letter, number coordinates to numerical coordinates for the XY table to perform its task. 

The 8x8 “keypad” will be connected to PORTA and PORTB, so that it can be read by scanning the columns and reading the state of the row lines. Each lettered column line (“a” to “h”) will be connected to microcontroller output pins PA0 to PA7, and each horizontal numbered row will be connected to microcontroller input pins PB0 to PB7. It will be necessary to connect input pins PB0 to PB7 to pull-up resistors of value 10kΩ to 5V. The circuit schematic is shown below.

By successively driving a single column line low, and the other columns high, the microcontroller can then read the input ports to see whether any of them are low. A coincidence of a row and column line being low means that a human’s piece is occupying that particular square. If the input to the microcontroller is high when the column is driven low, this means there is no piece on that particular square. The scanning of the column lines will be done using a real-time interrupt.

No comments:

Post a Comment