Skip to main content

Robo Tic Tac Toe

An interactive game of tic tac toe against a robotic arm.

info

Author: Emma Răchițeanu
GitHub Project Link: https://github.com/UPB-FILS-MA/project-emma-rachiteanu

Description

Robo Tic Tac Toe provides engaging gameplay in which a human player competes against a pre-programmed robotic arm. For simplicity, the game features a display board to which the robotic arm points to indicate its move. Players use a control panel on a website, with each control corresponding to a different space on the game board where the move will be executed. This information is transmitted via Wi-Fi to the micro-controller, enabling it to make its move.

Motivation

For this project, I aimed to create something both fun and intricate. Merely creating a game felt insufficient, so I decided to build a robotic arm to enhance the interaction. I chose tic tac toe because it is relatively straightforward to program, making it the ideal game for this task. I found this approach to be both innovative and enjoyable.

Architecture

  • Microcontroller: The Raspberry Pi Pico microcontroller handles input from the mobile website and processes it to determine subsequent moves. The programming aims to maximize the robotic arm's chances of winning.
  • Display: This component displays game data on a 3x3 grid filled with X's and O's. The display is sized to allow for pointer inaccuracies.
  • Mobile website: This site features a simple 3x3 grid design, acting as the control interface for the player. Inputs are transmitted to the microcontroller via Wi-Fi.
  • Robotic arm: After the microcontroller decides on a move, the robotic arm points to one of the nine grid positions. Both servos adjust continuously to ensure accuracy. The lower servo is equipped with an L-shaped component to enable slight rotation, while the upper servo has a longer attachment to ensure it can reach all positions.

Block Diagram Block Diagram Block Diagram

Log

Week 6 - 12 May

In the first week, I focused on figuring out the hardware and getting started on the tic tac toe code.

Week 7 - 19 May

I finished the STL files for the robotic arm and finished the hardware part.

Week 20 - 26 May

Hardware

  1. The Arm Three servo-motors are used: one is for spinning the circular plate, moving the arm left and right, while the other two are for extending and retracting the arm. They are powered using a 9V battery and a 5V Voltage regulator. The robotic arm functions using servo motors capable of lifting up to 750g at 5V, which maneuver 3D-printed components forming the structure of the arm. These components are designed with minimal infill to ensure they are lightweight enough for smooth movement. The pointer is mounted loosely on an axis, allowing it to maintain vertical orientation consistently.

  2. Display Three LCD displays are mounted on the Pico, each containing a row of X's or O's.

Schematics

Block Diagram Block Diagram Block Diagram Block Diagram

Bill of Materials

DeviceUsagePrice
Rapspberry Pi Pico WThe microcontroller35 RON
3* Servo Motor SG90 9gThe servomotors45 RON
3* LCD 1602 i2cDisplay of the game48 RON
PLA FillamentPlastic fillament125 RON
L78055V Voltage regulator2 RON

Software

LibraryDescriptionUsage
embedded-graphics2D graphics libraryUsed for displaying the tic tac toe grid
pwmPulse-width modulationUsed for controlling the servos
rp2040-halHardware Abstraction Layer (HAL) for the RP2040 microcontrollerFor managing the I2C communication for the display and PWM signals for controlling the servos
rppalUsed for interacting with the hardware featuresUseful for managing the GPIO, I2C, PWM, etc
  1. servo documentation + code snippet in python
  2. robot arm with the GPIO mapping
  3. tic tac toe code logic for C++ or Python
  4. i2c lcd display