TICO – Tic -Tac-Toe Arduino Robot | Documentation

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

In this article, we 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.

Down the road, we will also release a series of coding lessons for kids to learn to code while teaching Tico to play Tic-Tac-Toe.
Also, we are working on DIY kits that will make TICO accessible for those who don’t have a 3D printer or don’t want to source all the components. This will be similar to the Smart Racing Track kits and lessons we already have available.

Please read this article to know which hardware and electronics to order to complete this build.

Getting parts ready

You will need the following parts:

3D printed parts

The STL files can be found here: 

https://www.thingiverse.com/thing:4946788

Arms

We recommend printing the arms in a different color (our arms are colored orange).

Board

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):

51391820804_e57caa3da4_c
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 (we used hot glue) like in the photos below:

 

51391820269_8bc3b9c025_c
51392103120_2b022e478e_c

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).

We recommend using Allen screws because they are easier for kids to work with.

 

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.
 

* 3 X 
MG90S Metal servos(It is possible but not recommended to use the SG90 plastic servos).
 
 
* IR remote (this one is recommended but your regular TV remote can work as well).
 
* 3 X AA / AAA batteries and a battery holder 
 
 
ST7735 TFT Display – The display we used in our photos is blue and not red, this is not as this is the same screen. Be sure to use a screen with ST7735 controller.
 

Assembling Tico

There are three servos in this build: Two servos for the arms and one for lifting the pen.
We will start with the LIFT servo.

Step 1: LIFT Servo

Take one of the plastic servo arms (included in the servo bag) and drill a 3mm hole in the center of it. The result should be the same as the photo below:

51391343588_e3f382145d_c

Now, 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.

51391342733_91f8b3321a_c

We now have an important step: 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 below.

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

Step 2: LEFT/RIGHT Servos

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

Now 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.

51390328247_330a5c0714_c

The RIGHT/LEFT servos holder should also be attached to the base using a 14mm screw and nut.
Do not tighten the screw. The parts should be able to rotate against each other freely.

51391820589_40e2e4206b_c

Step 3: Eraser holder

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

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

Step 4: Arms Assembly

Assemble the arms precisely, as shown in the photos below. 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 below:

Now we have an important step: 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:

51400779999_bf60e5d309_c
51391820339_15ab118d7e_c
51391343073_1549373468_c (1)

Step 5: Display

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!

The assembly process is not short, but once it is complete, you should have something looking like this:

51391088266_a2c3196826_c

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 (we will share the code with you at the end of the article).

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

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.

 

How To Play

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.

 

Each cell is numbered as shown on the image below:

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 🙂

Adding AI

Arduino is an amazing little device, but it doesn’t have enough computing power to perform any Artificial Inelegance-related calculation.

Luckily, we connected an infrared receiver to our Arduino, which means he can communicate with other more powerful devices that can make complicated calculations and only communicate the results of those calculations to Arduino via IR.

For example:
Instead of using the remote control to tell Arduino which move a person made, we can set up a Raspberry PI computer with a camera. This bigger computer is powerful enough to perform some image recognition techniques and recognize the location of the human’s game-move. Then it can “tell” Tico about this move using IR Led (just like the IR Led inside the remote control). Arduino will not even know the data was sent by another computer, as it will use the same IR commands as the remote control.

How about two Ticos playing with each other with the help of AI?
The possibilities are endless, and adding AI capabilities is something we haven’t implemented yet. But, will definitely be tinkering with AI soon!

 

Building your own Tico?

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