Tic Tac Toe Player
This is the design for a Tic-tac-toe player which uses 9 buttons assigned to numbers correlating to the number pad on a laptop to play the the game. The number pad numbers correspond to the specific placement of an x or an o on the 3 x 3 board. Switch cases were used to relay the different outcomes and instruct the bot on the different options for play.
Supplies
he structure was designed in differentCAD software for the purpose of 3d printingall structural pieces.
- Arduino Uno
- 2 Breed board
- Wires
- Alligator clips
- 9 Buttons
- 5 red LEDS
- 4 green LEDS
- 9 - 10k ohm resistors
- Cardboard
CAD Models Pictures and Drawings
Many different software models like Fusion, SolidWorks, and Onshape were used amongst the physical design group to design the different parts to the tic tac toe player. The designs and drawings of the parts used in the final design are as follows.
Downloads
STL Files of the CAD MODELS
Tinker CAD Arduino Design
The Arduino Board was set up like so on Tinker CAD. Nine buttons were used along with a piezo speaker, and a switch to turn on the whole system.
Then Nine LED's on the second Arduino were used to indicate the selection of the robot on the tic-tac-toe grid.
Arduino Code
The Arduino code was written using switch cases. The piezo speaker would play a sad tune when the player lost and a happy tone when the player wins and a different tone to indicate a tie between the robot and the player. Else if and functions were used to read the buttons and output different LED's lights based on the square/button that was chosen by the robot .
Downloads
Assembly
Refer to the tinker cad Arduino design as assembly steps and pictures are complicated to follow, due to the amount of wires used.
LED Assembly
1) The LED's were inserted into the cardboard pillars and alligator clips were attached to the legs.
2) Those alligator wires were extended by FF wires in order to attach them to 1 breadboard for the power and ground lines.
3) The Led assembly breadboard was then wired to the 9 digital pins on the main breadboard in the bottom left corner of the 5th picture.
Button Assembly
1) 3 Breadboards were used for the button display. With 3 buttons and 2 resistors on each board.
2) The wire leading to ground was grouped for each row by making a chain of wires and having 1 wire per breadboard that would connect to the ground slot of the main breadboard in the bottom of the 5th picture.
3) The same was done to connect the buttons to the analog pins which resulted in 3 analog pins used and 3 ground slots used to create the button assembly. The resistors and pins were made as similar to the tinker CAD model so please refer to that.
Future Works - Assembly of Components
This section includes Ideas we had to scratch due to failures and time constraints that we would have developed with more time
1)The 3x3 grid base plate was attached to the pillars using 5mm diameter screws shown by the first two pictures.
2) The buttons were placed in the circular holes that are in the grid base plate using the fishing line to secure the buttons and twine was tied to the fishing line to be able to choose a certain button by pulling on the twine.
3) FF wires were used to connect the left legs of the button pins in the same column in order to connect to the ground pin on the Arduino board.
Due to the FF wires not sticking when positioned upside down it led to not getting the proper button readings. The idea had to be scratched and the Tinker CAD model was replicated without any of the 3D printed models. With more time and better materials this idea would have been developed more.
Robot Arm attachment
We wanted to add a robot arm that would move to press the buttons by attaching a servo motor to a claw, due to unexpected weather delays, and limited resources we didn't have time to do that but these are different parts we would have added to make our design even better.
To improve on aesthetics and readability we would have used 3D printed "x" and "O" buttons that the arm would pick up and use to press down on the buttons.