TICO – Tic -Tac-Toe Arduino Robot
by AlexF277 in Circuits > Arduino
3547 Views, 35 Favorites, 0 Comments
TICO – Tic -Tac-Toe Arduino Robot
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
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.
- Arduino Nano microcontroller.
- 3 X MG90S Metal servos(It is possible but not recommended to use the SG90 plastic servos).
- 38 KHz IR receiver.
- IR remote (this one is recommended but your regular TV remote can work as well).
- 3 X AA / AAA batteries and a battery holder
- Button module
- 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.
- 5V passive buzzer
3D Printing Parts
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
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
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
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
Use 2 X 12mm screws to assemble the eraser gripper.
At this stage, you can also install the board in its place.
Arms Assembly
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
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 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
To upload the code, you will need Arduino IDE.
You will also need to install the following libraries:
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 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.