TICO – Tic -Tac-Toe Arduino Robot

by AlexF277 in Circuits > Arduino

3171 Views, 33 Favorites, 0 Comments

TICO – Tic -Tac-Toe Arduino Robot

FKQR4U6KUB8LGSC.jpeg

TICO is a 3D printed, Arduino-powered Tic-Tac-Toe robot that inspires kids to learn code, robotics, and electronics.

In this intractable, I will explain how to print and assemble Tico. Then, we’ll provide a working code that can bring Tico to life and ready to play.

The initial design of Tico was inspired by the popular Plot clock project.

Supplies

parts (1).jpg
51392103120_2b022e478e_c-pbzaqjspn91ohb50jzz20a5phpzdimwwffa99to4ga.jpg
51391820269_8bc3b9c025_c-pbzaq7kt6ekyadmrjcowlv8prpnlqkke1qsy1868kg.jpg

Marker

Tico was designed to hold the following Shuttle Art marker:

https://www.amazon.com/Shuttle-Art-Magnetic-Whiteboard-Dry-Erase/dp/B086W55NRY/

You can use other small whiteboard markers as well. However, they may require some adjustments.


Eraser

Prepare the eraser by cutting a small piece of cloth from a standard whiteboard eraser and sticking it onto the 3D printed eraser part (hot glue will work great).


Screws

To connect the 3D printed parts together you will need the following M3 screws:

7 X M3 | 12mm

2 X M3 | 14mm

4 X M3 | 8mm

You will also need 7 X M3 Nylon nuts (regular nuts will also work).

 

Electronics

The Arduino code below uses various electronic components to provide an excellent game experience. However, many of these components are optional, where you can start with just the Arduino and the servos if you'd like.

3D Printing Parts

51391820844_e8ea573916_c (1).jpg

3D print the included parts. There is no need for support and printing time is about 2 hours.

I recommend printing the arms in a different color (orange part in the photo).

The board part should be printed in white.



Prepare Board

51391820804_e57caa3da4_c-pbzafppov07on4vmttcvrileyte1s8walsjr3zqhbo (1).jpg

The board part should be printed in white and then covered with clear packing tape as shown in the the photo below (the tape will make it very easy to erase the board between games)

LIFT Servo

51398737950_02dfef6341_c.jpg
51397726531_9d61dacfb4_c.jpg
51391342733_91f8b3321a_c-pbzfbo427j2zzbakddfq0m4q6g4loiff4oww7ouek4.jpg
51398737885_4a90e13d5b_c.jpg
51397726596_f7da0ed2f5_c.jpg
51398462724_bfa9cfa77b_c-1.jpg
IMG_9289 (1).jpeg
51391343588_e3f382145d_c-pbzejpewvyswkxwunsaac661yryhooewaa7v8cb25w.jpg

Take one of the plastic servo arms (included in the servo bag) and drill a 3mm hole in the center of it.

Use a cutter to make the arm shorter.

Attach the two parts using a 12mm screw and nut as shown in the photos below (orientation is important!)

Do not tighten the screw. The parts should be able to rotate against each other freely.

Attach the LIFT servo to the base using two screws included in the servo bag.

Important: Connect the servo to an Arduino and rotate it to 80 degrees. Only after doing this, attach the arm to the servo, like shown in the photos.

The angle between the servo and the arm should be 90 degrees as shown in the photos (this is important).



LEFT/RIGHT Servos

51391820589_40e2e4206b_c-pbzgm3d3qymtdzuzafue5weadjb7ucq66gu7ho0f90.jpg
51390328247_330a5c0714_c-pbzgj47i3uk4mg6mo5ix9nfqnlzdguwrrqgus4fayc.jpg
51392103540_584a8238cd_c (1).jpg
51391820644_726f936fd1_c (1).jpg
51391820649_c8786abaa5_c (1).jpg

Attach the servos to the holder as shown in the photos below (orientation is important!).

Attach the RIGHT/LEFT servos holder to the LIFT servo arm with a 12mm screw and nut.

Do not tighten the screw. The parts should be able to rotate against each other freely.

The RIGHT/LEFT servos holder should also be attached to the base using a 14mm screw and nut.




Eraser Holder

51391088641_f3713a5f59_c (1).jpg
51392103450_95615f2f15_c (1).jpg
51391088216_ce20c1c05e_c-1.jpg
51398462649_3fe0a4de0c_c.jpg

Use 2 X 12mm screws to assemble the eraser gripper.

At this stage, you can also install the board in its place.

Arms Assembly

51391343073_1549373468_c-1-pbzhc5g17maz8u0d4pc2abob82vj8a6affwsftdir8.jpg
51391820339_15ab118d7e_c-pbzhbjtqufhdtsvrmxzn6z4pk7u3b8sgogwmeg9kqc.jpg
51400779999_bf60e5d309_c-pc3obh6spauueiw8n5itfqlbswuf061jpt4cyyd2r8.jpg
51400780039_529665b4e3_c.jpg
51400012951_e60df003ae_c.jpg
51392103705_44421a4d17_c (2).jpg
51391343188_6af68a9b83_c (2).jpg
51391819939_6c7279a4e0_c (2).jpg
51390327857_eb5675d3fe_c (2).jpg
51391343208_3026085a01_c (2).jpg
51392103705_44421a4d17_c (1).jpg
51391343188_6af68a9b83_c (1).jpg
51391819939_6c7279a4e0_c (1).jpg
51390327857_eb5675d3fe_c (1).jpg
51391343208_3026085a01_c (1).jpg

Assemble the arms precisely, as shown in the photos. Use 12mm screws and nuts.

Do not tighten the screw. The parts should be able to rotate against each other freely.

Do not put the arms on the servos (we will do it soon).

Inside the servo bag are two additional plastic arms that we haven’t used yet.

Use a cutter to make them “one-sided,” as shown in the photos.

Important: Connect the servos to an Arduino and rotate them to 130 degrees (left servo) and 140 degrees (right servo). Only after doing this, attach the arms to the servos like shown in the photos below (do not rotate the servos while doing so).

The angle between the left arm and the right arm should be exactly 90 degrees, as shown in the photos.

Display

51391342928_fdfa4e6203_c (1).jpg
51391342948_fccf1f13b0_c (1).jpg
51392103090_8d60a80021_c (1).jpg

Assemble the display parts as shown in the photos below.

Nuts are not required for the display frame screws.

(Sometimes, the displays will come with 2mm holes. In such a case, you will need to use a 3mm drill to make the holes big enough for the screws).

The display should be attached to the base using a 14mm screw and nut.

Ready!

51391088266_a2c3196826_c-pbzhpmgr64qxnmfugizk0xa5qwgxk3nsa4jc2lef6c.jpg

The assembly process is not short, but once it is complete, you should have something looking like what you see at the photo.




Wiring

Tico now has a body, and it is time to start building its soul.

Below we explain how you should wire all the electronic components to work with the code we created for Tico (Code is shared below).


Servos

Lift Servo – Arduino Pin 5

Right Servo – Arduino Pin 6

Left Servo – Arduino Pin 7

The Arduino 5V should not power the servos. Instead, use an external source to power the servos. In our case, we use 3 X AA/AAA batteries.

 

TFT Display

CS – Arduino Pin 10

DC – Arduino Pin 9

RESET – Arduino Pin 8

SDA – Arduino Pin 11

SCL – Arduino Pin 13

VCC – 5V

 

Other components

IR receiver – Arduino Pin D2

Buzzer – Arduino Pin A5

Button – Arduino Pin D4

Code

ada (1).png
ir-rem (1).png

To upload the code, you will need Arduino IDE.

You will also need to install the following libraries:


IRremote , Adafruit st7735



The code can be found here: https://github.com/PlayRoboticsGit/tico

A few notes about the code:

* The initial design of Tico was inspired by the popular Plot clock project.

Parts of the Plot clock’s code are used in Tico’s code.

* The code has a lot of comments, so you can understand what is going on.

* Please note that the code was created to teach kids to code, so it is optimized for simplicity and not for efficiency.

* The code was not designed to make Tico a perfect player. The purpose is to leave room for improving the code and also to let kids win sometimes.

Playing

Tico - Remote control
moves (1).jpg

Tico doesn’t have a camera. So, when playing against a human, there is no way he will know which move is the human making unless we will tell him.

Making moves using the remote control

When it is your turn to make a move, click the location of the game-move on the remote control, and Tico will mark the board for you (see video).

Each cell is numbered as shown on the attached photo.


Making moves using the serial monitor

If you don’t have a button and remote control (or IR receiver), you can use a serial monitor to start the game and tell Tico the location of the move you would like to make.

Search the code for SERIAL_MONITOR_MODE setting and enable it.

Want to draw your own moves?

Once you tell Tico which game-move you want to make, he can draw the move for you. If you wish to mark the board yourself, look for the following setting in the code and disable it DRAW_HUMAN_MOVE.

Tico will then wait for you to draw your moves. Once you finish drawing the move, you will need to tell Tico the location of the action you draw by using the remote or the serial monitor. Please don’t cheat 🙂


Building your own Tico?

Share your questions or build and join the conversation on the Tico Facebook group.