Skip to main content
Version: ACS CC

Tic-Tac-Toe Contactless Game

This project brings the timeless fun of Tic-Tac-Toe to life with a touchless, futuristic twist, letting you play the classic game using your bare hands.

info

Author: Visan Rares-Stefan
GitHub Project Link: https://github.com/UPB-PMRust-Students/proiect-raresvizan.git

Description

This project implements a physical Tic-Tac-Toe (X and O) game using a 16x16 LED matrix display driven by a Raspberry Pi Pico 2W. Players interact with the game using ultrasonic distance sensors, pointing with their hands to select grid positions. A passive buzzer provides audio feedback, and two physical buttons are used for confirming moves and resetting the game.

Motivation

The motivation behind this project is:

  • To explore human–machine interaction through non-traditional interfaces.
  • To create interactive and fun embedded system for the boring old game of Tic-Tac-Toe played by everyone during classes.
  • To try an unique way of choosing the desired cell. No basic buttons, no Playstation type joysticks from 2003...DISTANCE SENSORS & BARE HANDS.

3. Architecture

The system has the following layers:

  • Input Layer:
    • 2x/3x Ultrasonic distance sensors (for selecting grid positions using finger)
    • 2x Push-buttons (confirm, reset, etc.)
  • Processing Layer:
    • Raspberry Pi Pico 2W
    • Game logic engine written in Rust
  • Output Layer:
    • 4x MAX7219-controlled 8x8 LED matrices
    • 1x Passive buzzer for sound feedback

Communication is done using:

ComponentInterfaceConnection Notes
LED Matrix (4x)SPIDIN, CLK, CS to SPI bus
Ultrasonic SensorsGPIOEach sensor uses TRIG + ECHO
BuzzerGPIOSimple digital on/off control
Push ButtonsGPIOConnected to GPIO with pull-ups

Diagram

Schematic Diagram

Log

Week 5 - 11 May

Week 12 - 18 May

Week 19 - 25 May

Hardware

The Raspberry Pi Pico 2W is the central microcontroller for the Contactless Tic-Tac-Toe Game. With its dual-core ARM Cortex-M0+ processor, Wi-Fi capability, and abundant GPIO pins, it provides all the required interfacing power to run the system efficiently.

It reads input from three HC-SR04P ultrasonic sensors to detect hand proximity, allowing players to choose the row and column of the cell without touching anything. The 4x MAX7219 8x8 LED Matrix modules are chained together to form a large 16x16 display grid, visually representing the game board in real time. Two tactile push buttons are used to confirm actions and reset the game. A passive buzzer generates sound effects, enhancing user feedback and engagement.

Schematics

TODO

Bill of Materials

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller40 RON
MAX7219 LED MatrixDisplaying the game (Output Device)4 x 17.5 RON
HC-SR04P UltrasonicSelecting the cell by hand (Input Device)3 x 7 RON
Passive BuzzerSelecting the cell by hand (Input Device)1 RON
Push ButtonConfirm move / Reset Game2 x 2 RON
BreadboardTesting the connections5 RON
Jumper wiresConnecting the components4 x 3 RON
Total152 RON

Software

LibraryDescriptionUsage
embedded-halHardware Abstraction Layer for embedded systemsAbstracts SPI and GPIO interfaces for peripherals like sensors
embassyAsync framework for embedded RustManages async tasks for input polling, game logic, and display update
embedded-graphics2D graphics library for embedded devicesUsed to render the Tic Tac Toe grid and player markers (X/O) on the LED matrix
max7219Rust driver for MAX7219 LED matrix controllerControls the 8x8 LED matrices over SPI
hc-sr04HC-SR04 ultrasonic sensor driver (if using precise timing via pulse input)Reads distance data from gesture sensors
logLogging facade for RustProvides internal logging for debugging
panic-probePanic handler for embedded systemsHelps diagnose runtime panics
static-cellSafe static storageFor safely storing peripherals and shared resources in async context