8-Puzzle Touch Console with Camera
A mini-console that turns your photos into an 8-puzzle you can play using the touchscreen or buttons.
Author: Alexandru Maria-Mihaela
GitHub Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-maria-alexandru
Description
This project is a laptop-like mini-console equipped with an attached camera. When a game begins, the camera takes a photo that is sliced into a 3x3 grid, shuffled and one tile is removed to create a classic sliding 8-puzzle. Players must reassemble their picture by sliding the tiles using either the touchscreen or physical buttons. The interface also features a built-in timer that tracks both the current elapsed time and the player's best score.
Motivation
I chose this project because it is based on a console I had when I was little. I could take a picture and instantly play it as a sliding puzzle, and I wanted to recreate that fun experience.
Architecture
The software architecture of the console is modular, divided into distinct layers that separate the core game logic from direct hardware interaction. The main components are:
-
Game Engine: This is the software "brain" of the application. It manages the internal state of the 8-puzzle game (a 3x3 matrix), tracks the position of the empty space and validates allowed moves. It also evaluates the win condition (checking if the tiles are in the correct order) and keeps track of the move count or elapsed time.
-
Input Management Subsystem: It is responsible for capturing and processing user input (buttons pressed, movements made on screen).
-
Graphics & Display Subsystem: It is responsible for rendering the visual representation of the game state to the screen. This includes drawing the 3x3 grid, updating the positions of the numbered tiles, and rendering user interface elements (such as the move counter or timer).
-
Audio Subsystem: It translates specific game events triggered by the Game Engine into corresponding sound effects, such as a mechanical click when a tile successfully slides, an error tone for invalid moves, or a victory jingle when the puzzle is solved.
Log
Week 13 - 19 April
Ordered the hardware components.
Week 20 - 26 April
Week 27 - 03 May
Week 04 - 10 May
Hardware
- STM32U5 microcontroller (Nucleo-U545RE-Q)
- 3.5" Touch Screen 480x320 SPI TFT ILI9488: The display unit of the console
- VGA Camera OV7670 640 x 480px: Captures images input for the system
- Microswitches TC-1212T (12x12x7.3mm): Mechanical tactile switches used for the directional pad and user action buttons
- Acoustic buzzer for microcontrollers: Provides auditory feedback and sound effects for various game events
- DC-DC Step-up Module 1-5V to 5V: A voltage regulator that boosts the fluctuating battery power to provide a stable 5V output for the microcontroller and display
Schematics
Bill of Materials
Software
| Library | Description | Usage |
|---|---|---|
| st7789 | Display driver for ST7789 | Used for the display for the Pico Explorer Base |
| embedded-graphics | 2D graphics library | Used for drawing to the display |