Skip to main content
Version: ACS CC

Rusty Goals

A dual-controller foosball game

info

Author: Cristina Stîngă
Github Project Link: https://github.com/UPB-PMRust-Students/acs-project-2026-Cristinaaa12

Description

The project is an interactive foosball game designed for a dynamic two-player experience. Each player uses a custom-built remote controller to command their digital striker on the field. The strikers are powered by stepper motors and move along the OX axis to position themselves and execute rapid striking maneuvers to kick the ball.

Using a set of arcade-style buttons, players can move their striker left or right to block shots and trigger a strike action to score a goal. The system features a distributed architecture, where a central STM32 master coordinates the movement while two Raspberry Pi Pico units handle player input and real-time scoring updates on OLED displays. To ensure reliability and precision, the machine is equipped with endstops to recognize its frame boundaries and infrared sensors to automatically detect goals.

This project combines hardware engineering and real-time control into a fun, high-speed test of player coordination.

Motivation

I wanted to create an interactive project that I could test and enjoy with my classmates. After researching various concepts, I was inspired by a unique foosball mechanism I discovered on social media.

Architecture

The project uses a modular design where different parts work together to control the game and track the score in real-time.

Main Components:

  • Processing Units

    • STM32 Nucleo-U545RE-Q: This is the main controller. It handles the game logic and monitors all sensors at high speed.
    • Raspberry Pi Pico H: These boards manage the buttons and screens for the players. They send player inputs to the STM32 and update the displays based on the information received back.
  • Movement & Action

    • Attacker Mechanism: This part uses stepper motors and linear rails. The motors are connected to the STM32 through A4988 drivers, which translate digital signals into precise physical movement.
  • Sensors & Feedback

    • Goal Detection: Infrared sensors are placed in the goals. When the ball passes, the system automatically updates the score.
    • OLED Displays: Small screens that show the current score.
    • Endstops: Limit switches that tell the motors to stop at the edges.
  • User Controls

    • Arcade Buttons: High-quality buttons that players use to move and shoot. They are designed for fast and repeated use.

Diagram

Log

Week 6 April - 12 April

  • Thought about the game concept and made a first list of needed parts.

  • Looked into how the players should move and kick.

Week 13 April - 19 April

  • Checked if the STM32 and Pico work well together.

  • Figured out how to link the controllers to the main board.

  • Decided to use buttons instead of joysticks for better control.

Week 20 - 26 April

  • Ordered all the necessary electronic components and hardware parts.

  • Sent the custom-designed slider parts for 3D printing to begin the mechanical assembly.

Hardware

The system uses one main controller (STM32 Nucleo-U545RE-Q) and two secondary boards (Raspberry Pi Pico H) to handle the game smoothly.

  • Main Controller (STM32 Nucleo-U545RE-Q): This is the brain of the project. It runs the game logic and tells the motors how to move. It communicates with the player boards using Serial communication via USB-C modules and sends signals to the motor drivers.

  • Player Boards (Raspberry Pi Pico): Each player has a Pico board. Its job is to read the Arcade Buttons and show the score on the OLED screens.

  • Motors & Movement: I use NEMA 17 motors with a GT2 belt system to move the players. Linear bearings and steel rods make the movement smooth, while Endstops stop the motors safely at the edges.

  • Sensors: IR Sensors are placed in the goals. When the ball passes through, the sensor sends a signal to the STM32 to increase the score.

  • Power Supply: A 12V adapter powers the motors. I use an LM2596 converter to change 12V into 5V for the controllers.

Schematics

Bill of Materials

DeviceUsagePrice
STM32The microcontroller-
Raspberry Pi Pico HBoards for the players to read button inputs and control the screens41.14 RON x 2
NEMA 17 Stepper MotorProvide the physical force for moving and kicking the ball67.06 RON x 2
A4988 DriversAct as intermediaries to control the motors based on STM32 signals8.09 RON x 2
A4988 Expansion BoardSimplifies wiring and protects drivers from voltage spikes9.97 RON x 2
OLED Displays (0.96")Small screens that show the live score to each player16.95 RON x 2
Infrared obstacle sensorDetect when the ball enters the goal to update the score automatically3.12 RON x 2
Endstops SS-5GL2Small switches that detect when the slider reaches its physical limit5.23 RON x 4
Arcade ButtonsDurable buttons used by players to move and shoot9.99 RON x 6
LM2596 Step-Down ModuleConverts 12V to stable 5V output6.69 RON
GT2 Timing PulleyUsed to drive the belt and move the players4.67 RON x 2
GT2 Timing BeltTransfers rotation into linear movement6.70 RON x 2
LM8UU Linear BearingsEnsure smooth sliding on the steel rods4.90 RON x 8
GT2 Idler PulleyKeeps the belt tensioned and aligned10.89 RON x 2
Type-C Panel ModuleProfessional connection for USB-C cables11.53 RON x 4
3D Printed PartsCustom mounts and sliders-
Linear Shafts (8mm x 300mm)Precision steel rods for the track28.49 RON x 4
USB-C Braided Cables SetConnect controllers to the STM329.15 RON
12V 5A Power AdapterMain power source for the entire system50.70 RON
DC Female Jack AdapterConnects power adapter to wiring4.14 RON
Resistor KitUsed for current limiting, signal conditioning and pull-up/down configurations15.16 RON
Mini Breadboard (170 pts)Provides a stable mounting point for the Pico H and connects arcade buttons/OLEDs2.42 RON x 2
Breadboard (830 pts)Main hub for STM32 integration10.00 RON
Electrolytic CapacitorFilters power supply noise and protects drivers from voltage spikes3.03 RON x 3
TOTALEstimated Total Project Cost727.09 RON

Software

LibraryDescriptionUsage
embassy-stm32Hardware Abstraction Layer for STM32 microcontrollersUsed to control the motor pins, read the IR sensors and handle Serial communication
embassy-rpHardware Abstraction Layer for the Raspberry Pi PicoUsed on the player boards to read the arcade buttons and drive the OLED displays
embassy-executorAn async/await executor for embedded systemsUsed to run multiple tasks at once, like moving the motor while checking for button presses
embedded-graphicsA 2D graphics library for embedded screensUsed to draw the score on the OLED displays
ssd1306OLED Display driverThis is the specific driver that talks to my 0.96" screens via I2C
embassy-timeHandles timing and delaysUsed to control the motor speed and to make sure a button press is counted only once
defmtA highly efficient logging framework for resource-constrained devicesUsed for debugging
panic-probePanic handlerUsed for debugging crashes